What is the relationship between the application layer and the controlling class?

The Book Using UML and patterns briefly presents the layered architecture, one of which is the application architecture, also called the application controller.

Also features the GRASP pattern called controller, which provides guidelines for creating a controller class (which is not the MVC controller - the latter belongs to the UI layer). (How many controllers!)

The function of this controlling class is only to receive and delegate events of external systems (in general from UI) to the domain layer. It can belong to the application layer or the domain layer, depending on the frameworks used. It is the first class beyond the UI layer to receive system events. It is an invented class (a "pure invention", in the GRASP language).

I am trying to reconcile this knowledge with the knowledge of what an application layer does.

Because it does nothing but delegate, this controller is compatible with application layer? Can it be associated with it? Is it perhaps a first version of what the application layer might have?

Doesn't this layer execute logic that coordinates the objects of the domain model and other layers?

With the implementation and subsequent evolution of the application, how does one turn into another?

Examples, if possible, in Java, if possible.

Author: Piovezan, 2019-02-20

1 answers

(How many controllers!)

Yes, the nomenclature and "function" is similar for the various controllers, but the context differs.

There are the UI controller and domain controller as most commonly used standards.

The UI controller coordinates View access, in an MVC pattern.

Domain controller coordinates access to the domain, and is called the service layer (Fowler) or application layer (Evans). Both are layers indirect (Facade Design Pattern), used to separate classes between subsystems / layers. It brings modularity and better maintainability (you can swap the domain for remote services or switch the view from HTML to Flex, and just change the indirection layer) the GRASP Controller seems to be a hybrid of both.

There is also the front Controller in systems that need, from a single access point, to decide who to send the responsibility for a request (web systems over HTTP for example).

Since each controller "type" has a different implementation, I believe it is easier to search by the context name of the controller you want.

I hope I helped.

 1
Author: Ademir Mazer Jr - Nuno, 2019-03-11 18:06:58