Title: RE: [CFCDev] Erm, DataLayer Factory Question.

 

> -----Original Message-----
> From: Patrick McElhaney [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, 8 December 2004 1:16 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [CFCDev] Erm, DataLayer Factory Question.
>
> On Tue, 7 Dec 2004 18:31:21 -0500, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> wrote:
> > Also keep in mind that I need to make use of a global functions or
> > objects
> Why? Are you sure?

Well Typically yeah.... I'm a little sure..(now you have me second guessing myself)...actually I'm not that sure..

At the time, I wanted to use createSingleton in multiple appServices (ie blogAppService, GuestbookAppService etc), how does one do that ? The only way I can think of is if each appService.cfc creates a local copy of the "singletonManager" .. That or they all extend a baseAppService which has that method located inside them.. Either one is still cumbersome I guess..well my limited exp and my "nervous bump" says bad.


>
> > Thus you see "createSingleton()" methods.
> Are you sure you need those classes to be singletons? If so,
> have you considered putting that "createSingleton()" method
> in an object that you pass around wherever you need it, or
> maybe make it globally available via Mach-ii?

Well up until I spoke with Spike in Seans Breezme (great source guys), I didn't no. Now I can see I need to pass something into these "appService" objects. I settled on a complex object called configBO which has all these "global" concepts (ie getSingleton, createSingleton, getMessageServiceLocator etc). In many ways it could end up being an uber CFMX based "Interface" or an object unto itself.. Still sketchy on how I implement it at this point (suggestions welcome).

>
> > I also figure I would use a "DataLayer Gateway Factory"
> That sounds like a good idea.
>
> I think your DataResourceBean may be unnecessarily
> constrained. You need to know the type of data resource (XML,
> SQL Server, or whatever), and the properties, which vary
> between types. So why don't you just have a type and a
> collection of properties? Use the type to determine which
> factory to create and use the properties collection to
> initialize that factory. Are you familiar with the Abstract
> Factory pattern?

Yeah, now with the introduction to that configBO it starts opening a bit more doors (disregard DataResourceBean now) in regards to using Abstract Factory pattern.. Just confirming it you mean:

http://www.dofactory.com/patterns/PatternAbstract.aspx

If so, translating that to CFMX.. I think I grasp how, but if you have the time, and feel like upskilling a git like me, I'd be interested to see how others translate that concept into CFMX.. It seems clear but..


Regards
Scott Barnes.

Reply via email to