Hmmm ... How would that work? Could you point me in the right direction so i could
experiment and get the hang of it?
You would define a manager object that knew about the Site and knew about Pages and would call methods on both (so the manager would be the entry point, not Site or Page). When the manager object calls a method on a Page object that needs to know about the Site, it passes the Site instance in as an argument.
I'm scanning the MachII core and it looks like the AppManager might be functioning
like the top level of a "composition tree" to join the all the other Managers and
their subcomponents together, sometimes i see this technique of passing "this" through
to a newly created object in the core files ...
Yes, the AppManager in Mach II creates manager objects for plugins, listeners, filters and so on. Most objects can access the AppManager via a getAppManager() call (AppManager calls setAppManager(this) on each of those objects as it constructs them). From the AppManager instance, objects can get at the other manager objects if they need to (e.g., the PropertyManager so they can read/write application properties).
So would a manager be an abstract
class that only serves to join a team of concrete classes together into an application
or a section of the application?
Not necessarily - many manager objects contain some logic to process external requests and delegate them to the appropriate (managed) object.
(The following examples are purely for illustration and do not necessarily represent any sort of recommendation!)
For example, a SiteManager object might have a method createPage() which:
- creates a new Page object
- adds it to the current Site object
- returns the new Page
It might have a renderPage() method which gets passed a Page object and then:
- calls render() on that Page object passing it the current Site object
Note: this means that client code can know about pages but only the SiteManager can actually render them since it's the only part of the app that knows about the current Site.
VERY Much ... a big piece of the puzzle fell somewhere (that seemed like it could be
in the right place but i wasn't sure) in the last day or two, and you just told me
that's where it belongs! Thanks very much Sean.
Cool! Getting your head around the concepts in the Mach II core files can be quite a bit of work (it's hard enough for many folks to get their around the concepts required to use Mach II - but it's well worth the effort!).
Sean A Corfield -- http://www.corfield.org/blog/
"If you're not annoying somebody, you're not really alive." -- Margaret Atwood
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
