| Matt, ColdSpring is best used to provide the larger infrastructure pieces of your application, so it'll build you up some nice sets of controllers amd service-layer objects and persistence objects... but when it comes to getting individual data-bearing objects, you're best bet is to have a ColdSpring-controlled service-layer object ask a ColdSpring-controlled constants object where to find User.cfc, then call createObject() itself. Otherwise you develop dependencies within your model on ColdSpring and start to work at cross-purposes with the whole framework. Example: <bean id="constants" class="some.path.to.constants"> <property name="BeanStore"> <value>some.path.</value> </property> <property name="DbMode"> <value>dev</value> </property> <property name="foo"> <value>bar</value> </property> </bean> <bean id="UserService" > <constructor-arg name="constants"><ref bean="constants /></constructor-arg> </bean> -- in userService.cfc (pseudo-code)-- <cffunction getUser()> ... query, calls, whatever ... <cfreturn createObject("component",getConstants().getValue("beanstore") & "User").init(someData)> </cffunction> /Example This may not be the best example, but it was handy in my head... it shows the idea of using ColdSpring to set up your applications infrastructure and using your objects in a modular way, but not creating dependencies on ColdSpring from within your model... because UserService relies on Constants, but neither of them explicity rely on ColdSpring you have a nice, abstracted way of getting each object to the right place but neither of them call ColdSpring directly and the User still gets created. I hope that helps... if you need clarification just say the word. :) Laterz, J ------------------------------------------------ Jared C. Rypka-Hauer Continuum Media Group LLC Member, Team Macromedia - ColdFusion "That which does not kill me makes me stranger." - Yonah Schmeidler On Mar 23, 2006, at 1:18 PM, Matt Williams wrote:
|
- [coldspring-dev] Bean and Singleton Matt Williams
- [coldspring-dev] Bean and Singleton Ken Dunnington
- [coldspring-dev] Bean and Singleton Matt Williams
- [coldspring-dev] Bean and Singleton Jared Rypka-Hauer
- [coldspring-dev] Bean and Singleton Jared Rypka-Hauer
