No constructors, If You Please

Quite some time ago there was a lot of discussion about adding interfaces and constructors and a bunch of other Java-esque features to CF. Apart from the great comments by Jared and Sean on the fact that you don’t NEED a constructor as a language construct (the init() convention is fine), I have one more reason to not want constructors – it makes circular resolution of constructor dependencies impossible.

One of the limitations of ColdSpring is that you can’t have constructor injection of circular dependencies. The reason is (presumably) because ColdSpring follows the Init() convention and treats init() as a genuine constructor. If it treated it as a pseudo constructor (which is what it is), there wouldn’t be a problem.

In LightWire, all of the objects are instantiated (without calling the init method) and then the init method is run in each allowing for circular constructor dependencies because of the fact that init() isn’t a true constructor so I can “create” all of the dependent objects and then immediately afterwards can init() them with their dependencies before returning the requested object. Of course, I probably need to do some thinking about making this thread safe for application scoped objects, but it allows for full or lazy loading and for resolution of circular dependencies even in the “constructor” arguments which seems to me to be pretty cool.

So, please don’t add more limitations to ColdFusion. I like it just the way it is!

Comments
Rolex's Gravatar they are high quality timepieces which is attractive,<A href="://www.newstylerolex.com/" title="Cheap Brand Name

Watches">Rolex</A> -
<A href="://www.newstylerolex.com/" title="Replica Rolex">Replica Rolex</A> -
<A href="://www.newstylerolex.com/" title="Brand Name Watches">Replica Watches</A> -
<A href="://www.sunglassvip.net" title="Welcome to our Replica Watches website">Replica rolex</A> -
<A href="://www.sunglassvip.net" title="high quality timepieces">Rolex</A> -
<A href="://www.2g-3g.com" title="high quality timepieces">Rolex</A>
<A href="://www.watches-life.com" title="cheap price">Rolex</A>
<A href="://www.watches-life.com" title="cheap price">Replica Rolex</A>
<A href="://www.rolex-hot.com" title="cheaper price">Rolex</A>
<A href="://www.rolex-hot.com" title="cheaper price">Replica Rolex</A>
<A href="://www.vertuexclusiveshop.com" title="cheaper vertu">Vertu</A>
<A href="://www.vertuexclusiveshop.com" title="cheaper Replica vertu">Vertu Replica</A>
,good time!
# Posted By Rolex | 7/28/09 2:28 AM
Guojuicycoutureout's Gravatar ://www.outletfactory-coach.net coach factory outlet
://www.outletcoach20l2.net coach outlet online
://www.coachoutlet20l2.com coach outlet
://www.coachs2011.com coach outlet online
://www.juicycoutureoutlet2012.net juicy couture outlet online
://www.outletcoach20l2.net Coach outlet store online
://www.coachoutlet20l2.com Coach outlet online
://www.coachs2011.com coach outlet store online
# Posted By Guojuicycoutureout | 11/27/11 10:15 PM
Guojuicycoutureout's Gravatar ://www.coachs2011.net coach outlet
://www.outletcoachcoupon.com coach outlet coupon
://www.jacketnorthface.net north face jackets
://www.coachs2011.net coach outlet store online
://www.saleburberryscarf.com burberry outlet
://www.outletcoachcoupon.com coach outlet
://www.coachs2011.net coach outlet online
://www.jacketnorthface.net north face outlet
://www.outletcoachcoupon.com coach outlet online
# Posted By Guojuicycoutureout | 11/27/11 10:15 PM
Guojuicycoutureout's Gravatar ://www.coachoutlet20l2.com/ coach outlet
://www.outletcoachcoupon.com/ coach outlet coupon
://www.coachoutlet20l2.com/ coach outlet store online
://www.coachoutlet20l2.com/ coach outlet online
://www.scarfburberry2011.com/ burberry scarf
://www.outletscoaches.com/ coach outlet online
://www.online-outlet-coach.com/ coach outlet online
://www.outletscoaches.com/ coach outlet
://www.outletcoachcoupon.com/ coach outlet online
# Posted By Guojuicycoutureout | 11/27/11 10:16 PM
Guojuicycoutureout's Gravatar ://www.juicycoutureoutlet2012.net juicy couture outlet
://www.juicycoutureoutlet2012.net juicy couture outlet online
://www.juicycoutureoutlet2012.net juicy couture online
://www.juicycoutureoutlet2012.net juicy couture outlet store online
# Posted By Guojuicycoutureout | 11/27/11 10:16 PM
michael kors stores's Gravatar The post is written in very a good manner and it entails much useful information for me. I am

happy to find your distinguished way of writing the post. Now you make it easy for me to

understand and implement the concept. Thank you for the post.
://www.korsoutletstores.com/
://www.korsoutletstores.com/kors-handbags-c-75.html
# Posted By michael kors stores | 4/5/12 2:23 AM
michael kors outlet online's Gravatar Your weblog is not only informative and also extremely artistic too. ://www.korsbagsoutletus.com/
://www.korsbagsoutletus.com/kors-bags-sale-c-69.html
# Posted By michael kors outlet online | 4/20/12 12:56 AM
Cosplay Costume's Gravatar ://www.cosplayeasy.com Cosplay Costume
://www.cosplayeasy.com/assassins-creed-altair-mens-costume-p-638.html Assassin's Creed Altair men's Costume
# Posted By Cosplay Costume | 4/22/12 7:37 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.5.006. | Protected by Akismet | Blog with WordPress