Ok, ok… here is a quick example.
November 16, 2008
This is in no way a tutorial on Cairngorm… in-fact, the use of Cairngorm here is really rough. This is however an Application, using Cairngorm, that is split into Flex Modules. The important thing is the use of a Cairngorm implementation within the modules.
For brevity I’m not using services. There are some important considerations with services and delegates. You can easily define the BusinessDelegates in the module package but in the structure I have shown, you must define the services in the main application.
In actual development, I use a custom implementation of ServiceLocator so that each modules can inject their own Service Objects. This gives me the ability to dynamically load modules at run time and makes the configuration stay where it belongs.
I hope that this small example helps people. I will probably move on to the architecture that I use most now, MVP (Model View Presenter).
Session Facade, meet Business Delegate and his friend Service Locator…
September 27, 2007
A general introduction: The Session Facade enterprise design pattern allows you to create a clean, well-defined interface to complex and/or composited business objects. The Service Locator is an object that gives you a one-stop shop for all your service needs. It holds a reference to all of your services whether they are Remoting, web services, http service calls or other external resources. The Business Delegate is a layer of separation between the Service Locator and the control (command) code, which is very helpful in Flex as it’s an excellent place to setup your responders to the asynchronous calls that you will make and handle service problems.
Facades
The Facade pattern is widely used and usually without notice… Read the rest of this entry »