P.Rizzi Ag.Mobilità Ambiente wrote:
I read the liked article and I should say I never thought abot that before.
Anyway I like the minimal interface style (also extreme programming says not
to implement something until is actually needed, if I remember well).
Then one may implement a wrapper or helper class that gives a more human
friendly interface, like this:
public class HumanListWrapper implements List
{
private List theList;
public Object last()
{
return theList.elementAt(theList.size() - 1);
}
}
public class HumanListHelper
{
public static Object last(List theList)
{
return theList.elementAt(theList.size() - 1);
}
}
I don't know how this can be applied to GeoTools, though...
Well what I mentioned the other day was this idea:
public interface List {
public Object get( int index );
public int size();
}
public class ListImpl implements List {
.....
public Object last(){
return get( size()-1 );
}
}
The idea being that we can insert helper methods on our implementations,
this is within the bounds of reason (as a lot of the time the interfaces
will be in GeoAPI and out of our direct purview).
Jody
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel