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

Asked

Viewed 101 times

0

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

It also features the GRASP standard 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 controller class is only to receive and delegate external system events (usually 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 language of GRASP).

I’m trying to reconcile this knowledge with the knowledge of what makes an application layer.

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

This layer does not perform logic that coordinates the objects of the domain model and other layers?

With the implementation and subsequent evolution of the application, as one turns into another?

Examples, if possible, in Java, if possible.

  • Related (Soen): https://stackoverflow.com/q/5368085/2241463

1 answer

1

(How many controllers!)

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

There is user interface controller and domain controller as most commonly used standards.

The UI Controller coordinates access to View, in a MVC standard.

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

There is also the front controller (Front Controller) on systems that need, from a single access point, to decide to whom to send the responsibility of 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’ve helped.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.