| | While the MVC design pattern is typically used for constructing entire user interfaces, the designers of the JFC used it as the basis for each individual Swing user interface component. Each user interface component (whether a table, button, or scrollbar) has a model, a view, and a controller. Furthermore, the model, view, and controller pieces can change, even while the component is in use. The result is a user interface toolkit of almost unmatched flexibility. | To mitigate the risk associated with creating a robust client tier, developers have produced several frameworks and design patterns with varying degrees of success. The Model-View-Controller (MVC) paradigm remains one of the more enduring patterns. However, the traditional MVC scope falls short when it comes to the control of GUI elements (widgets). MVC does not handle the complexities of data management, event management, and application flows. As an adaptation of the MVC triad, the HMVC -- Hierarchical-Model-View-Controller -- paradigm seeks to redress some of the above-mentioned issues. We developed this pattern during the course of our work in the field. HMVC provides a powerful yet easy-to-understand layered design methodology for developing a complete presentation layer. While MVC provides an efficient framework for developing GUI interaction, HMVC scales it to the entire client tier. Some key benefits of a responsibility-based, layered architecture include: | However, many in the Java community criticize Java Foundation Classes (JFC) and Swing. Swing doesn't offer much help in creating a high-level Model-View-Controller (MVC) client architecture. This proves frustrating in the J2EE world, where any reasonable server application returns transfer objects, or so-called plain old Java objects (POJOs), to a client. A lot of manual coding is required to map POJO fields to Swing components and vice versa. | Heresy: A deliberate deviation from the orthodox doctrine. SQLTags (sqltags.org) is, indeed, a deliberate deviation from the orthodoxy of the Model-View-Control (MVC) design pattern; therefore, SQLTags is heresy, but is it necessarily "bad?" In this article, I will introduce the SQLTags toolkit and when it can be successfully employed. | Swing (and AWT) pioneered the use of MVC in Java. Surprisingly Swing stays one of the most convoluted and counterintuitive MVC frameworks with very little guidance on how to do things right. This article discusses problems with Swing application design and shows where and how to apply MVC principles to solve them. | In this interview, I discuss Model-Driven Architecture, or MDA, with Andrius Strazdauskas, R&D; Manager, Gary Duncanson, President and CEO, and Daniel Brookshier, Chief Architect of No Magic. Prior to this interview my understanding was that MDA was an attempt to program in pictures or diagrams, and I was skeptical. My impression was that MDA proponents were claiming that you could do a high-level design, and push a button to generate the code, without worrying about all those little details that pop up when you actually do code by hand. | In the first part of his interview with Artima, Parr discusses the importance of model/view separation, and points to ways of enforcing such separation even when many programmers work on an application. | | To show how to use MVC in a Web-based application, I've created a simple project consisting of several JSP Views—viewable in any web browser—several helper bean and action classes, and a Servlet controller class. The business objective will be to display weather information based on the user's ZIP code or city name. The project's structure is generic enough to make it easily modifiable for any type of larger online application. Enterprise-level applications usually have a database in the back end, to fetch dynamic data for the views, comprising a so-called three-tier architecture—client application, server processes, and enterprise data services; in my case, hoverer, all data info will be stored in a HashMap object. | Design patterns [1] have emerged as one of the leading approaches in achieving the much-hyped re-use benefit of object-oriented design and programming. The Model-View-Controller (MVC) pattern is one of the oldest and most commonly used, particularly within GUI and graphical programming, and its origins can be traced back to the early days of SmallTalk. |
|