Mach II is framework that is designed to help manage the complexity of large application design. Mach II is the first OO framework design for Cold Fusion. Fuse Box is an earlier Cold Fusion framework that was more procedural or linear, using circuits and actions.
Mach II uses a XML based notation that uses a central controller as the road map for the application. The controller (/config/mach-ii.xml) holds definitions to other parts of the application, like listeners, filters, plug ins and view files. The main workhorse of the controller is the event. The application has lots of events, each of which contains all the "work" needed to complete the event request. Each event is like a small little autonomous part of the application. Events lend themselves to web development because almost every action taken in a GUI can be thought of as an event, like clicking a button or choosing from a list or clicking a link. The directions needed to complete the request are encapsulated in the mach II event.
The mach II controller file has listeners, filters and plugins registered as part of its configuration. The Listener, filter and plugin registrations are conceptual pointers to CFC files in the application. Best practices suggest that the listeners be registered to Services.
Filters and plugins are special types of CFCs that can be registered within specific events to automate frequently needed code, like login check.
The controller also has a properties section that contains hard coded values that are used and referenced throughout the application.
If the event requested needs data then a listener notification is made and a service manager is called, possibly with some arguments or parameters (data needed to process the request). The service or manager would call into the data access layer which would then in turn call to the persistence layer or the database. In many cases, the data is then returned from the database to the data access object to the service back to the controller who stored the result in an event argument (variable) that is then consumed or displayed by the presentation layer or view file.
MachII implements this type of MVC design patten and is specifically designed to work best with well defined objects that adhere to these principles.
Event arguments are event specific or scoped variables defined in the event that are available to the listeners and view pages to help control flow or make decisions during execution of the event.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment