Professional Documents
Culture Documents
In ZK
Simon Massey
(Revised Q2 2012)
Introduction
Overview
Why Patterns?
The Triumvirate
View
View
Model
Model
who?
who?
The View
View
View
Model
who?
ZK Micro-Model == View
Listbox
Composer
ListModelList
ListModelList
(view layer)
Collection<Book> books
(business domain layer)
View
Model
Model
who?
Model
who?
who?
Alphabet Soup
MVC: Model-View-Controller
Often cited but do we really know it as well as we
believe?
MVP: Model-View-Presenter
A specialism of MVC with a dominant controller
MVVM: Model-View-ViewModel
The Microsoft WPF pattern of the Application Model
but how do we use it with ZK?
MVB: Model-View-Binder
A clearer moniker for "MVVM" with ZK
Martin Fowler:
Different people reading about MVC in different
places take different ideas from it and describe
these as 'MVC'.
Anon on c2.com:
Stuff nearest the User becomes the View, stuff
nearest the database becomes the Model, stuff in
between becomes the Controller. Marketects then
refer to their project's architecture as "MVC",
borrowing that acronym's impressive lineage(!!!)
Controller Of What?
View
View
?
Model
Model
Controller
Controller
Model-View-ZKComposer
Model-View-Presenter
Legend
View
Model
compiles to
events
Presenter
Presenter
Model-View-Presenter
Model-View-Controller
Legend
View
compiles to
bindings
events
Model
Controller
Controller
Model-View-ViewModel
ViewModel Nirvna
It's all about the Binder. The name Model-ViewBinder (MVB) highlights the key part
Model-View-Binder
View
Binder
Binder
<<reflection>>
ViewModel
Legend
compiles to
command
DomainModel
load
Model-View-Binder (Simplified)
View
Legend
compiles to
updates
Binder
Binder
<<reflection>>
Application Model
(has internal layers)
loads
Model-View-ZKBind
ViewModel Choices
Summary
Summary (Cont 1)
Summary (Cont 2)
References
Corrections