Take a look at the Tartan framework. It looks really confusing initially, but it takes care of inter-object relationship problems with a remarkable degree of simplicity once you get your head around it.
I've also had great success with taking the configuration management objects (AppLoader, AppManager, ListenerManager, PropertyManager, etc.) from Mach-II, tweaking them to handle different object types (services, daos, etc. rather than listeners, filters, events, etc.). It's simpler than Tartan, and targetting a different objective, but its quite effective if you already have a functioning object model and just need an abstract way to wire it together. Tartan, just for comparison, is a framework for implementing the business logic as well as managing the various objects. cheers, barneyb On Wed, 16 Mar 2005 19:54:02 +0800, James Holmes <[EMAIL PROTECTED]> wrote: > I'd like to check on some of the reading I've been doing. > > I am starting to use composition in my CFCs (because I only use inheritance > for an "is-a" relationship). I want to reuse the objects I've instantiated > in the central object from the outside; the reading I've done suggests the > best way to do this is to use a getter method that returns the instantiated > object. > > E.g. I have some sort of central component > > <cfcomponent output="no" hint="The central component"> > > <cffunction name="init" output="false" returntype="void" access="public" > hint="The method to instantiate a new object"> > <cfset oObject1 = CreateObject("component","Component1")> > <cfset oObject2 = CreateObject("component","Component2")> > </cffunction> > > <cffunction name="getObject1"> > <cfreturn _oObject1> > </cffunction> > > <cffunction name="getObject2"> > <cfreturn _oObject2> > </cffunction> > > ...etc etc > > </cfcomponent> > > I could then, in the CF page that uses the central component, do this: > > <cfset oMyCentralObject = > CreateObject("component","CentralComponent").init()> > <!--- now call a method1 in object1---> > <cfset MyMethodReturn = oMyCentralObject.getObject1().Method1() > > This is how some articles say it should be done - any feedback? > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:198988 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54