"Bruce Wood" <(E-Mail Removed)> a écrit dans le message de news:
(E-Mail Removed)...
> A classic three-tiered design. The UI component talks only to the
> business layer, never to the data layer. The business layer
> encapsulates business rules, but also knows how to talk to the data
> layer to load and fetch instances of itself. The data layer would like
> to be ignorant of the the other two layers, but unfortunately it can't
> be, because it has to know how to build and return business objects
> that it has fetched from the database.
What you are talking about is something with which I have a great deal of
experience :-)
I have done all of this in Delphi which has even tighter restrictions on not
having circular references between units (code modules). I have designed
three main frameworks that provide all the services necessary for completely
non-circular management of business, storage and UI layers.
The frameworks are :
Value Type (not the same as ValueType :-) ) - this provides more metadata
than reflection and allows you to detect when an object goes dirtyas well as
providing validation callbacks.
Object Persistence - this is a mechanism that allows you to change
databases, even in mid-execution without changing any of your client code.
All objects are retrieved from or passed to the Persistence Broker, which
examines the ValueTypes and dynamically creates SQL, XML, CSV or whatever
you want to use for storage/retrieval/etc.
Model View Presenter - this is a very sophisticated version of MVC which
allows the management of UI interaction to be completely separated from the
business layer. It also uses the Value Types to obtain the data that it
requires to display.
There is absolutely no knowledge of the business layer in either the OPF or
MVP frameworks.
I have written several articles on these subjects; if you are interested,
they can be found on my website (I'm not very good at web design)
www.carterconsulting.org.uk. You might also find some of my writings on
Borland's Code Central.
I teach OO design more than I do anything else; and am now enjoying learning
all about Delphi Mk2 (C#) <vbg> I am also a member of Borland"s TeamB which
is their equivalent of Microsoft's MVPs.
Joanna
--
Joanna Carter
Consultant Software Engineer