"Jeeves" <
XXXX@XXXXX.COM>a écrit dans le message de news:
XXXX@XXXXX.COM...
Quote
This is a very interesting concept. However, this is easily acheivable
by considering TDataset as the Mediator class in VCL. This is how we
have gone ahead with our framwork and developed a huge application with
very minimal issues.
The Model:
----------
There is a TDomainObject which abstracts all the basic methods related
to CRUD. Every derived class introduces a set of published properties
and all the business validations. Relations to modules are done as
either a Collection (one to many) or as a Subset (one to one). This is
the core of the system. Simple and straight-forward. This becomes our
Model.
This seems Ok as long as the TDomainObject is separated from the actual
database.
Quote
The Mediator:
-------------
Then we use Objec Dataset and Collection data set to identify these
objects as dataset.
The GUI
-------
Well any data aware controls from any vendor.
Works simply great and we are able to use the models independently of
the user interface.
In theory, using TDataset derivatives that supply objects are a good idea
but, unlike Wayne, I still can not get on with the idea.
The problems I have include the concept that a TDataset is just that: a set
of data, not a single object. When it comes to displaying a form that
represents a single object, you really don't need a class that has methods
like Next and Eof :-) OTOH, it is a relatively good match for a mechanism to
supply the data for a list or grid UI element. There are just too many
extraneous properties, methods and events in TDataset to convince me that it
is a suitable class for a UI mediator.
It would not be too much hassle however to create a mediator class that can
sit between a property of an object and a non-data-aware UI element. You
might even try doing the same thing for d-a controls ??? Although this is
where .NET really shines as their d-a controls will just as easily link to
properties of objects as they will to fields of tables.
Joanna
Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker