On Sun, May 07, 2000 at 11:12:28AM -0700, jon * wrote:
> > MyObj obj = new MyObj();
> > data.getParameters().setProperties(obj);
> > if (obj.validate(data))
>
> That is very cool! That is a really good way to separate out the business
> logic very easily.
I didn't want to muddy what I was saying, but what I actually have here is
that MyObj is an abstract baseclass. Then the first line is more like:
String className = data.getParameters().getString("class");
MyObj obj = Class.forName(className).newInstance();
That way I can write polymorphic actions which are almost entirely decoupled
from the details of the types of objects they are manipulating.
This is a big win for me because I'm developing a very straight forward DB
front end but where I have a lot of different types of objects to manage,
and I don't want to have to rewrite the same controller logic over and over
again for each object type.
--
Sean Legassick
[EMAIL PROTECTED]
...promoting the underground...
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]