Model View Controller Pattern Overview


The interaction between the business logic, display, data retrieval, and data storage needs to have a structured approach. One of these approaches is the Model View Controller pattern. The Model View Controller (MVC) is a methodology that TSC has had great success with. This method gives rise to segmentation of a client/server system, allowing a client system to call server components through a controlling component. This controlling interface determines which functionality needs to be called on which data. The objective is to design a system to have a central location that controls the data access and information creation, which then returns the information to the client interface for display.

The MVC is composed of three parts: the data model, the information view, and the controller. The data model maintains the data, which describes data storage and the current state of the system. The controller provides the channel that the request enters and then interprets and directs the call to the relevant business logic. The view then displays the data that is returned.

The controller determines from the client's request what functionality is needed and then calls the relevant method. These methods may reside in a ColdFusion page, a custom tag, a user-defined function, a ColdFusion Component (CFC) or even a call to a Service outside the current domain. With the introduction of CFCs this segmentation has become more manageable than combinations of the other methods. A CFC allows the collection of related functionality into a module, which can then be invoked in a number of different ways. This invocation can be from the <cfinvoke> tag, the createObject function, or a remote system (such as Flash) calling the method. The traditional means of http post and get also have the ability to invoke these methods.

TSC believes the power of the CFCs has given it a more resourceful approach to ColdFusion application development. Previously, custom tags, user-defined functions, and other techniques could not quite deliver the efficient segmentation of a system into the MVC pattern. CFCs also give the ability to group similar components into packages, allowing for inheritance and restricting access to methods.



Reality Macromedia ColdFusion MX. Macromedia Flash MX Integration
Reality Macromedia ColdFusion MX: Macromedia Flash MX Integration
ISBN: 0321125150
EAN: 2147483647
Year: 2002
Pages: 114

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net