|
Posted by Henk Verhoeven on 08/24/05 01:18
topmind wrote:
> I have been experimenting with the generation of CRUD screens (biz data
> edit and display forms) using data dictionaries, which are basically
> tables filled in with attributes about the fields or columns. Although
> I originally agreed with no-code-generation, I have since softened
> somewhat.
>
> One possible reason to generate code is for speed. Acting on meta data
> can be slow and Moores Law hasn't quite caught up just yet on some
> platforms/tools.
>
> Second, code is more elastic than the meta model. If there are things
> that the model driver cannot handle, diddling code is often the only
> alternative.
Well, maybe data dictionaries are somewhat limited as a means for
expressing a model. If you use objects and classes, you can have
subclasses where you can override code. If you use literals in methods
as you declarations, you can override the declarations with different
values but you can also decide to do some calculation to produce the
methods' result. You can also override a method that instantiates a
class and let it instantiate a different one. Then when the model
delegates to that object, you have yet more opportunities to make
overrides.
> In the end I think if there are enough "override events"
> avialable in enough places, then such diddling wouldn't be necessary.
Isn't making an OO desing and writing proper OO code exactly that:
making enough override events? (No, it's also choosing/shaping the right
ones)
> Event-driven programming would take care of stuff not expected in the
> meta model design. However, such a framework would be non-trivial to
> construct because it would probably need many event override points.
>
> Someday in the future it may work, but we are not there yet.
I agree that buiding a VM for an OO language like Java, Smalltalk or php
is a non-trivial event. But so is building real life applications. My
point is: I do not agree with your distinction between the framework and
the model it is executing. The model can express simple 3GL style
commands or more sophisticated ones, like with QBE. There is no
fundamental disctinction between semantically more rich objects and
objects modeling 3GL statements: as soon as there is delegation to
objects that are created and configured by the model, the model has been
'programming itself'. At the same time the model can be partly expressed
in the same language as the framework itself. Building an application is
both overriding AND extending the framework. Refactoring of the
application can lead to those extensions being drawn into the framework
itself, or the framework to be refactored to add some very usefull new
override events needed by the application. Waiting until someone builds
this fantastic silver bullet framework or MDA tool is limiting yourself.
Your only limit should be your imagination.
(Nice PR talk huh? In practice our time is limited, and all framework
development is a balancing act between expressive power, simplicity and
flexibility of the framework at one side and getting real life
application(s) to work at the other. ;-) )
Greetings,
Henk Verhoeven,
www.phppeanuts.org.
(BTW, forgive me my remark about data dictionaries for expressing a
model, LISP expresses everything as linked lists, but that does not seem
to limit its expressive power. I guess it's making a distinction between
data and code that is limiting)
[Back to original message]
|