Re: whats the purpose of an objectFactory?

2006-12-12 Thread Nando
As others are indicating, factories become more and more useful as your application becomes more and more complex. In the first app i built using CFC's, after about a year of iterations and improvements, i had well over 1800 CreateObject() calls in the thing. One day a problem arose because of

Re: whats the purpose of an objectFactory?

2006-12-12 Thread Nando
PS ... On the way to the post office to check my mail, i realized i forgot to say something in my reply. :-) Your approach of creating all your objects in Application.cfm and placing them in application scope kind of encapsulates your object creation for now. But this approach will break down the

Re: whats the purpose of an objectFactory?

2006-12-12 Thread Phill B
On 12/12/06, Nando [EMAIL PROTECTED] wrote: In the first app i built using CFC's, after about a year of iterations and improvements, i had well over 1800 CreateObject() calls in the thing. By the power of Greyskull! Are you trying to take over the world with your 1800 objects? ;-) We use a lot

Re: whats the purpose of an objectFactory?

2006-12-12 Thread Phill B
I do use this technique. cfif NOT isDefined('application.layout') OR isDefined('url.appInit') I just didn't want to take the time to write it out though. hahaha Thanks for posting that though. I think there are a lot of people that don't know that they need to do these sort of things. Thanks

Re: whats the purpose of an objectFactory?

2006-12-12 Thread Craig Drabik
Why would I want to load an object into the application scope just to load more objects? This is one more piece of code that has to be ran, maintained, suck up processes, suck up memory, to explain Wouldn't it be best to just keep it simple and call right to the CFC? It sounds to me like

whats the purpose of an objectFactory?

2006-12-11 Thread Phill B
I have read a lot about people making their own objectFactory and I still don't see the need for one. Can some one please give me a reason why I would need to use one? So far I have yet to find a reason not to call to the objects directly when I need them. My lack of understanding makes me think

Re: whats the purpose of an objectFactory?

2006-12-11 Thread Adrian
The real benefits I have found are: 1) Objects are initialised in one place only, so if the init arguments change, then I only need to change one piece of code. 2) Objects are created in one place only, so if the location of the component changes, then I only need to change one piece of code.

Re: whats the purpose of an objectFactory?

2006-12-11 Thread Josh Nathanson
into the Application scope, is this just done in App.cfm or App.cfc? Thanks for any guidance. -- Josh - Original Message - From: Adrian [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Monday, December 11, 2006 8:50 AM Subject: Re: whats the purpose of an objectFactory

Re: whats the purpose of an objectFactory?

2006-12-11 Thread Aaron Roberson
Also, what is the generally accepted way to init your classes into the Application scope, is this just done in App.cfm or App.cfc? Thanks for any guidance. I am not one to give guidance since I am new to all this myself, but... I don't use an object factory. Instead I init all of my services,

Re: whats the purpose of an objectFactory?

2006-12-11 Thread Josh Nathanson
He has since blogged about it here: http://www.phillnacelli.net/blog/index.cfm/2006/11/21/ObjectFactory-Explained Thanks for pointing me to that article Aaron. Very helpful! -- Josh ~| Create robust enterprise, web RIAs.

Re: whats the purpose of an objectFactory?

2006-12-11 Thread Phill B
I do all my work in application.cfm file as well. I load the 7 or 8 objects I need and I'm done with it. I just don't see how there code be a speed benefit. Why would I want to load an object into the application scope just to load more objects? This is one more piece of code that has to be ran,

RE: whats the purpose of an objectFactory?

2006-12-11 Thread Ben Nadel
PROTECTED] Sent: Monday, December 11, 2006 2:55 PM To: CF-Talk Subject: Re: whats the purpose of an objectFactory? I do all my work in application.cfm file as well. I load the 7 or 8 objects I need and I'm done with it. I just don't see how there code be a speed benefit. Why would I want to load

Re: whats the purpose of an objectFactory?

2006-12-11 Thread Josh Nathanson
Why would I want to load an object into the application scope just to load more objects? This is one more piece of code that has to be ran, maintained, suck up processes, suck up memory, to explain Wouldn't it be best to just keep it simple and call right to the CFC? I think the idea is

Re: whats the purpose of an objectFactory?

2006-12-11 Thread Aaron Roberson
Another reason why I did not use an object factory is because I noted the fact that you have to register all the DAO's, gateways and beans with the full path in Application.cfm. It seemed just as easy to instantiate all of my objects directly in Application.cfm and assign them to the application

Re: whats the purpose of an objectFactory?

2006-12-11 Thread Phill B
On 12/11/06, Josh Nathanson [EMAIL PROTECTED] wrote: I think the idea is that as long as you have sufficient RAM, a call to the Application scope will always be quicker than than a call to the CFC. If you have a gig of RAM dedicated to CF, a few MB of objects is negligible. If your RAM is an

Re: whats the purpose of an objectFactory?

2006-12-11 Thread Phill B
On 12/11/06, Aaron Roberson [EMAIL PROTECTED] wrote: If that is the case, I just talked myself into using Phill's ObjectFactory.cfc. The benefit over my current method would be that the objects are not instantiated until they are used. Even if a request to instantiate the object is made

Re: whats the purpose of an objectFactory?

2006-12-11 Thread Aaron Roberson
But why not go ahead and get the job done with the initial load of the application? Why wait for it to happen two page loads later? If you initialize all of your objects with the start of your application then the user will have to wait until the objects are all initialized before they can

Re: whats the purpose of an objectFactory?

2006-12-11 Thread Josh Nathanson
to explicitly reload your objects, set the url variable reloadObjects. -- Josh - Original Message - From: Aaron Roberson [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Monday, December 11, 2006 2:23 PM Subject: Re: whats the purpose of an objectFactory? But why not go ahead

Re: whats the purpose of an objectFactory?

2006-12-11 Thread Phill B
On 12/11/06, Aaron Roberson [EMAIL PROTECTED] wrote: If you initialize all of your objects with the start of your application then the user will have to wait until the objects are all initialized before they can view any pages. As you know, CFC's are pretty heavy and createObject, though it is

Re: whats the purpose of an objectFactory?

2006-12-11 Thread Aaron Roberson
I'm going to look for some decent example of a objectFactory and do some testing to see if there is a performance hit. That sounds like a great idea. Here is an objectFactory to look at and compare with: http://www.phillnacelli.net/blog/index.cfm/2006/11/21/ObjectFactory-Explained Please let

Re: whats the purpose of an objectFactory?

2006-12-11 Thread Judith Dinowitz
I'm going to look for some decent example of a objectFactory and do some testing to see if there is a performance hit. That sounds like a great idea. Here is an objectFactory to look at and compare with: http://www.phillnacelli.net/blog/index.cfm/2006/11/21/ObjectFactory-Explained Please let

Re: whats the purpose of an objectFactory?

2006-12-11 Thread Mike Kear
My experience has been thinking i only have a few objects so it's not really worth the effort of building a factory. But i built one anyway for the experience. But when i look at that first OOP project now, a year later, i see my site which was originally going to have only 10 objects now has