Hi all,
I'm gradually making progress on getting a handle on the wonders of
coldbox and I'm up to exploring the various methods available for
handling the model. I initially started by setting up Lightwire, which
seems to make sense and all works nicely. I then noticed that CB
appears to have its own methods for dealing with injection and
singleton caching and so forth. This leaves me with a few questions:
a) is there any benefit to using lightwire vs the CB "native" bits?
b) are the two engines designed to be used in collaboration with each
other or does one replace the other? Is the CB getBean stuff an
interface to lightwire or is it a completely seperate entity?
c) I've read the caching docs for coldbox, but exactly what difference
does using LW or CB make to caching? Is one faster than the other for
creating transients like the user bean below?
Say I have a gateway object which has to create a new User bean. I've
tried the two methods below and both work fine, but I can't see any
clear reason to use one over the other.
LIGHTWIRE:
<!--- metadata --->
<cfproperty name="ioc" inject="coldbox:plugin:IOC" scope="variables" /
<!--- create a bean --->
<cfset var User =
ioc.getBean("UserBean").init(argumentCollection=arguments) />
OR BEANFACTORY:
<!--- metadata --->
<cfproperty name="beanFactory" inject="coldbox:plugin:beanFactory"
scope="variables"/>
<!-- create a bean -->
<cfset var User =
beanFactory.getModel("com.model.security.User").init(argumentcollection=arguments)>