I have used a single service layer to talk with both Flash and a mach ii or fusebox based application. I work pretty well however sometimes when sending data from flash to CF or vis versa I need to create special methods that only pass structures, arrays, and queries around so that CF can handle it. I would use this same appoarch for web services as well. As the API gets more complex I sometime find that I need to break out a special facade for flash which talks to my main service objects.
Clearly the goal is to reuse as much logic as possible between the HTML and flash interfaces. --Kurt http://jroller.com/page/kwiersma On Wed, 12 Jan 2005 19:27:37 -0500, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > [trim] > > > > > For me, the service layer served the HTML/Mach-II client as > > well as the Flash client. It was the Flash facade. It > > seemed to me to provide the most code reuse and reduce maintenance. > > Well lets assume you have multiple Mach-II applications with their own > individual set of listeners. Each listener talks to shared managers. In this > light, whats happening is you're processing instructions per listener and > asking various managers to carry out their own lifecycles. > > What I'm trying to illustrate is your Listener in a typical Mach-II is > infact your "Flash Fa�ade" if you will. The view informs a listener of its > intention, the intention delegates instructions to sub-children and so on. > > Now in a flash client situation you don't have access to Mach-II framework, > so you could create "flash listeners" aka FlashFacade to take those key > events, process it and delegate it to various managers for their own life > cycles. At no point does Flash know about Managers, and it shouldn't as one > could argue these are subject to change locations throught development > cycle.. If were to happen all you would need to do is update your > listeners/facades (or better yet interface it out). > > I dislike allowing any occasionally connected client from knowing how the > model is peiced together, I'd rather have facades in front of them who take > their intentions and flow it through as that in way is giving control back > to coldfusion vs simply exposing each manager openly (remotely for that > matter). It also makes sure that Managers are treated nicely and are cared > for in a proper manner - reducing rogue flashies from invoking methods that > could be harmful (ie deleteAll() via Manager will simply assume you know > what you're doing and carry it out deleting various sub-objects etc.. Where > as via fa�ade it could go "well, are you sure let me check to see if you > have permissions etc".. Now this could also be classified as a service > instead of fa�ade as a fa�ade realistically is something that gives you a > nice interface into complex underlying objects. A service does this but can > also take onboard its own set of logic (well that's what I assume > anyway..can you tell I'm unsure of that statement now heheheh). > > > > I'm still not quite clear why you want to create another CFC > > just for flash. Even if you do have some "Flash only" > > functionality, those methods could still be in the service > > layer object, Flash calls it and Mach-II doesn't. > > A flash only one is setup for a specific flash client, this may be due to it > having specific security requirements or conditions it has to meet before > enabling the two to marry well.. In that the flash only cfc should be > regarded as part of your view (even though its server side) it just > translate a stateful view into cfmx and from there it gets to play in the > model that's all. You could have one cfc for both Flash & SOAP that carries > out all top level requests (ie BankFacade = BankFacade.deposit(), > BankFacade.generateMonthlyReports(), BankFacade.NotifyPoliceOfRoberry() > etc.. All have their own individual "services/managers" but the end client > doesn't know all it knows is to ask BankFacade... > > Its kind of like McDonalds, you the customer never ask anyone but the > Cashier for your order, they could delegate to each individual services and > managers (chipManager, burgerManager, drinkManager, POSService etc) > > > Scott. > http://www.mossyblog.com ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
