Having a layered architecture brings some benefits to software development. Some of them are;
It is a very common practice to employ classical three tier layered architecture to separate UI, business and data access parts from each other. However, in order to achieve those benefits listed previously, we need to create some other architecture on top of that layered architecture to handle functional aspects which are usually cross-cutting those three layers.
It is possible to create such an architecture which provides a basis to obtain those benefits by employing model-view-presenter (MVP), observer and mediator patterns together. Indeed, some frameworks, such as Vaadin UI Framework, Spring Application Framework, Hibernate Persistence Framework, provide means to easily realize such an architecture in our enterprise projects.
MVP helps us to separate handling backend logic from UI rendering completely. Any UI event, such as button click, list select etc, is immediately translated into a corresponding business event, and is let to be circulated among other components via Observer and Mediator patterns. Those other components are able to handle business events that they are interested in, execute their functionalities, publish new business events, update UI and so on. Components are totally unaware of each other. They can be introduced into the system optionally, and even at run time. As a result, it becomes possible to achieve modularity and reuse both on micro and macro level in our enterprise applications.