6. Spring Web Applications Flashcards
Model-View Separation Principle
Strict distinction of:
▪ Model components – comprising the business objects of the application domain
▪ View components – comprising the user interface elements
▪ Controller components – comprising the application logic that is in charge of the control flow
Model-View Separation Principle
▪ Implications and responsibilities:
A business object (e.g. Contract, Product, Customer, Sale…) will not call or rely on a user
interface object (e.g. a window, web page, input field…).
A user interface (UI) object will not implement application logic (e.g. calculating tax).
Controller objects receive messages from the UI, call the appropriate business functions, update the data model, and return control back to the user interface for the next interaction.
▪ In a web application, the architecture encompasses two communicating actors:
Client & Server
Client
usually, a web browser running on a desktop or mobile device
Server – a central host upon which the clients depend to provide data and/or computation
Server
a central host upon which the clients depend to provide data and/or computation