Identifying cross-cutting concerns

When you separate a project into layers, you will notice some functionality that is repeatedly done in every layer. For example, you will find that you have to do validation functionality in each and every layer. Another example is that you have to authenticate every time in different layers. The best option is to identify these kinds of functionality and group them into one project as cross-cutting concerns.

The name of a cross-cutting concerns project (layer) does not have to be named exactly like that. You may choose to call the project your own name as you see fit. Other candidate functionalities that you could put in the cross-cutting layer include how you manage the application's exceptions, how you cache frequently used objects, and a logger functionality.

The advantage of getting these cross-cutting functionalities into one layer is that you're promoting reuse and that it makes our application a bit more maintainable.

Avoid mixing the cross-cutting code with code in the components of each layer so that the layers and their components only make calls to the cross-cutting components when they must carry out an action such as logging, caching, or authentication.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.128.197.94