[PEAK] peak DMs and model element component hierarchy

Phillip J. Eby pje at telecommunity.com
Fri Jul 16 23:35:36 EDT 2004


At 10:04 PM 7/16/04 -0500, Doug Quale wrote:
>Looking at the wiki IntroToPeak example and the bulletins example
>included with peak itself, it looks like the Data Manager examples
>create model elements whose parentComponents are the DM instances that
>created them.
>
>Does it make sense to go to extra trouble in the DM to make the
>parentComponent for a model element be the model element it is
>included in, or is this pointless or harmful?  With a model like this
>
>     class Database(model.Element):
>
>         class tables(model.Sequence):
>             referencedType = 'Table'
>
>         class views(model.Sequence):
>             referencedType = 'View'
>
>should the Table and View model objects included in a database object
>have that database as their parentComponent?

Generally speaking, no.  The component hierarchy exists mainly to support 
acquisition of solution-domain configuration information.  Model objects 
are part of the problem domain, not the solution domain.  If a 
problem-domain object wants to take information about some other 
problem-domain object into account, this should be done explicitly.

IOW, the 'solution-domain' context of any 'problem-domain' object is its DM.




More information about the PEAK mailing list