Richard Monson-Haefel wrote:
> I would argue that the ResultSet interface is far more reusable and usable then
> an object graph or even an array of structures. The reason is simple, the
> ResultSet interface never changes across queries. No matter what data is
> captured the ResultSet interface remains the same. This makes it easier for
> developers to work with because they already understand the semantics of the
> interface (its always the same). In addition, it makes it easier for
> requirements to change because it fairly simple to introduce new columns of data
> or remove them.
So the more flexible an object is the more reusable it is? But objects
exist to place structure and order around an otherwise disorganized
collection of data and behavior.
By your argument above, the code below is the ultimate reusable object
framework that can be used for every system in existence. I submit that
it is actually not particularly well designed or usable. I show this to
illustrate that I think this particular argument is a red herring.
Implementation is deleted for conciseness.
public abstract class ReusableObject extends HashMap {
public void addCommand(String key, ParameterTakingRunnable r);
public void removeCommand(String key);
public void invokeCommand(String key, Object[] params);
// inherit all get/put operations
}
public abstract class ParameterTakingRunnable implements Runnable {
public void setParameters(Object[] parameters);
public void run();
public Object getReturnValue();
}
Cheers,
Laird
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".