|
From: Sean A C. <se...@co...> - 2002-11-08 17:50:14
|
On Thursday, Nov 7, 2002, at 10:42 US/Pacific, Nathan Dintenfass wrote:
> It seems we are perhaps heading down a road that is lowering the
> value-add
> of Modus. Perhaps I'm not getting it, though ;)
I thought we were adding value! :)
> If an object instance is basically just a struct that is created based
> on
> XML descriptor which does nothing more than define data types for
> "fields",
> and I then need to create UDF libraries to accomplish basic tasks, I
> am not
> sure we're getting much that can't be done by just having database
> tables in
> the first place.
No, Modus would contain a UDF library that does most of the work. You
would be able to extend base classes and then specify your extended
classes in the XML and Modus would magically use them. Modus would do
the basic stuff automatically for you tho'...
> Here's my real concern: I haven't figured out how to have something
> like a
> "webImage" field in a "dumb" field set up.
"webImage" would be a valid Modus field type - just as it is now - and
the default persistence would treat it as a string, the default
validator would probably do nothing (maybe check it was a valid path /
filename?), the default renderer would generate:
<img src="...">
The *field* is essentially dumb but the renderer knows it is an image.
> That is, right now in the
> modusTest application I can have an image and it takes no more work
> than
> having a piece of text -- that is powerful from a development
> standpoint.
> What would that look like in the set up you are suggesting?
toHTML( myObj, "nameOfImageField" );
which in turn calls:
myObj._modus.getField( myObj, "nameOfImageField" ).toHTML();
or something like that (I haven't quite figured the best way to bind
persister, validator, renderer together in the facade... maybe the UDFs
know and it looks like this instead:
myObj._modus.renderer.toHTML( myObj, "nameOfImageField" );
which in turn calls:
myObj._modus.validator.getField( myObj, "nameOfImageField" );
which in turn calls:
myObj._modus.persister.getField( myObj, "nameOfImageField" );
it all depends how 'lazy' the persister and validator are).
> I'm also a little concerned about the complexity with having the end
> developer needing to pass around the XML descriptors to base
> components.
Nope, no complexity. The developer specifies the object in XML,
indicating type, persistence (optional), rendering (optional). The
application arranges to include a Modus initialization file - as Jeremy
showed - which registers the XML descriptors (just once) and that's it,
you're off to the races!
> basic Modus API (ie: pressRelease.getField("title").toHTML()) to make
pressRelease = get(prid);
toHTML( pressRelease, "title" );
Sean A Corfield -- http://www.corfield.org/blog/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
|