Seeing Other Ways to Manage Displays
Several other patterns are similar to MVC. In this section, I tell you about one variant of MVC and also give you insight into how MVC, as discussed in this chapter, differs from the Presentation-Abstraction-Control (PAC) pattern, which is the topic of Chapter 14.
Combining controller and view
Document-View is a variant of MVC that doesn't enforce the strict separation between controller and view that exists in the MVC pattern. In some implementations, the controller and view are tightly interwoven. In the X Windows System, for example, events are dispatched to a window — which means that they're sent to a view rather than to a controller. You lose flexibility and the ability to change controllers relative to views when they're combined in Document-View.
The Document component corresponds to MVC's model component. Because Document and View are loosely coupled, the benefits associated with their separation are achieved in either the Document-View or MVC pattern.
Document-View is useful when you don't need the flexibility of separate views and controllers, or when you want an architectural model that corresponds to a particular toolkit, like the X Windows System.
Comparing Presentation-Abstraction-Control
In the next chapter, I introduce the PAC pattern — another architectural pattern for structuring interactive applications, but one that's quite a bit different from MVC.
MVC is all about creating independent components that are responsible for ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access