I just saw this on another group - http://www.silverwareconsulting.com/index.cfm/2009/5/31/Building-An-Object-Oriented-Model--Recording-and-Sample-Code-Available is a presentation that gives you a great overview of OO in cf.
On Jan 4, 11:46 am, Gavin Baumanis <beauecli...@gmail.com> wrote: > Hi Everyone, > > I was recently chatting at work about how we might go about architecting a > new application. > I suggested that we have; > Objects, > Service Managers > and Gateways. > > Whereby the ServiceManager is the public API for the gateway. > > Then I got asked , "Why?" > > I explained that it was good practice to separate out the plublic API from > the gateway and gave the example of changing database providers. > Eg. Swapping from MS-SQL server to PostGreSQL. > > With my architecture proposal, you only need to change the gateway (perhaps > some minor tweaks to the ServiceManager CFCs. > > So far so goo... Until I got asked "Why" again. > "You still need to change the code somewhere for the new database flavour. > What is the ServiceManager doing for us, it seems like a redundant > duplication of code?" > > Subsequently, I have been thinking about it more - and can't come up with a > good reason. > > I could be doing it completely wrong... > But for the most part, my Service layer becomes a duplicate of the Gateway. > * Ensure we have the required arguments for the gateway, > * Call the gateway functions, using the supplied arguments > * Return exactly the gateway's return value(s) to the consumer. > > 99.9% of the time the arguments are exactly the same, > The data / structure (whatever) that is returned from the gateway, is > returned unaltered to the consumer, too. > For the very small number of times that I might do some data transformation > (in the ServiceManager) before it is returned... well I could simply create > "THAT" method in my gateway and have; > * Call the this.GETTER method > * Transform the data as required > * Return the transformed data > > So am I missing something? Or have I just talked myself out of the > requirement for (perhaps, excluding web-services) of ever needing to have a > separate service layer to a Gateway CFC? > > Gavin. -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com. To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.