MVC (Model-View-Control) is a design pattern designed to separate the model, view and controller. It is strongly suggested to apply MVC pattern to your application, not only because it easy to develop and maintain, but also the performance is great.
The view is UI -- a composition of components. As described in the UI Composing section, UI can be implemented by a ZUML document or in Java. For sake of description, ZUML is used to illustrate the concept and features.
The controller is a Java program that is used to glue UI (view) and Data (model) together.
For typical database access, the glue logic (i.e., control) can be handled by a generic feature called Data Binding. In other words, the read and write operations can be handled automatically by a generic Data Binding, and you don't need to write the glue logic at all.
The model is the data an application handles. Depending on the application requirement, it could be anything as long as your controller knows it. Typical objects are POJOs, beans, Spring-managed beans, and DAO.
In additions to handling the data in a controller, some components supports the abstraction model to uncouple UI and data. For example, grid, listbox and combobox support ListModel, while tree supports TreeModel.
|Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.|