[TransWarp] Domain model objects as utilities?
John Landahl
john at landahl.org
Fri Oct 17 17:08:25 EDT 2003
Is it possible to load a peak.model.Element-based object in a [Provide
Utilities] section using config.provideInstance? It appears that
config.provideInstance is expecting something more component-ish, and that
trying to load something model-ish just breaks things in strange ways.
My use case is this: I have a number of classes based on
peak.model.Element, one of which is a primary object that's needed
throughout the application. This object needs to be instantiated and
populated as early as possible and made locatable application-wide. I'm
trying to have the instantiation handled by config.provideInstance in a
[Provide Utilities] section, then do the population elsewhere (e.g. in an
uponAssembly method) before the object is actually used by anything else.
Is this possible using [Provide Utilities], or is this the wrong way to go
about it? If I instead create and offer the object in my top-level
application class, utilities instantiated in a [Provide Utilities] section
(which are actual components, btw) don't see the "offering" because it's
happened too late. Should I be creating these other "utilities" in some
other way as well?
More information about the PEAK
mailing list