cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kay Michael <Michael....@icl.com>
Subject RE: SAT API Proposal (Draft 3) - NodeInputSource
Date Fri, 11 Feb 2000 09:56:55 GMT
> Or maybe we could do without an InputProvider object altogether?
> 
>   public void process( InputSource xmlSource, Node node);
>   public void process( InputSource xmlSource, OutputStream 
> byteStream);  //
> convenience
>   public void process( Node node, String baseURI);
>   public void process( Node node, String baseURI, Node node);
>   public void process( Node node, String baseURI, 
> OutputStream byteStream);
> // convenience
> 
> It makes multiple process methods, which isn't great, but it 
> simplifies things in another direction. 
>
My usual rule of thumb is that if you have two methods with the same name
but different operand types, there will soon be a third and a fourth, and
it's time to take advantage of polymorphism and invent a generalization of
the different operands. If you have five then there's definitely an
abstraction lurking around somewhere that needs to come out into the open.

Mike

Mime
View raw message