|
Navigation: Programming Cookbook > Creating GUI Applications > Creating MVP Components > Composite MVP Components |
![]() ![]()
|
A Composite component is formed where a more complex model is connected to a composite presenter and to a composite view structure. When the model is connected to the composite presenter it is often treated as several sub-models which are then individually doled out to various sub-presenters. The end result is that a composite triad inevitably consists of a hierarchy of sub-triads, which are comprised either of basic, or composite triads themselves.
A good example of a composite component is a MethodBrowser.

The model of the MethodBrowser presenter is the singleton instance of SmalltalkSystem and the view is a composite built using the View Composer. The composite presenter contains two additional components; a ListPresenter is used to display the list of methods being browsed and the method source text is displayed in a SmalltalkWorkspace presenter.
Let's take a look at some examples of the objects that make up composite MVP components in the basic Dolphin image:
Presenter class |
Model class |
View name |
View class |
Notes |
PersonalAccountShell |
PersonalAccount |
PersonalAccountShell. |
ShellView |
From the Personal Money sample. The view has been built with the View Composer as a top-level shell window containing named elemental views for all of the individual objects within the PersonalAccount model. |
ClassBrowserShell |
SmalltalkSystem |
ClassBrowserShell. |
ShellView |
One of the major tools in the development system. Here, the model (SmalltalkSystem) is an object representing a facade onto the underlying development environment. |
Notice how the above components are very specific to the applications in which they are used. This tends to be the case with composite MVP components.