Information Technology Reference
In-Depth Information
Model View Presenter
Before we fully dive into the code, we need to understand how it is composed and de-
signed. UberFire component design is based on a very useful design pattern used for build-
ing user interfaces called Model View Presenter ( MVP ). MVP is based on a highly used
pattern called Model View Controller ( MVC ), but is devoid of one of its biggest issues,
regarding component intercommunication. The idea behind MVP is twofold:
• Each component in a user interface project should have three classes with very
specific responsibilities:
Model : This will handle all the business logic detached from presentation
View : This will handle visual representations of data regardless of the
business logic that created it
Presenter : This will manage communication between two and more com-
ponents
• Each different MVP group should communicate with other components (and, to
some measure, even with itself) by listening and firing events
This creates a very distinctive structure of classes that can be easily changed, to provide
different representations by allowing them to be completely detached from the business lo-
gic and from other visual components. The following diagram of MVP shows the basic in-
teractions that happen with this pattern:
Search WWH ::




Custom Search