MECHANISMS FOR IMPLEMENTING HEXAGONAL ARCHITECTURE IN NODE JS - Abharian, Yura (Global Prosperity, 2021)
The mechanisms of realization of hexagonal architecture on Node js are substantiated in the article. It is emphasized that when developing an effective web application, it is important to configure the software architecture properly. A great way to build a supported web application is to create a flexible, extensible, and customizable architecture. The concept of hexagonal architecture as a popular architectural pattern in software development is defined. It is emphasized that this style of architecture facilitates the division of tasks, placing logic at different levels of the program. The hexagonal architecture aims to increase the maintainability of web applications so that the code requires less work in general. The scheme of the hexagonal architecture is presented, which is represented by a hexagon, where each of the sides of the hexagon represents different ways of interaction of the system with other systems. Examples of queries using HTTP-queries, REST API, SQL are offered. Each level of the hexagon depends on other layers, so the emphasis is on the ability to make individual changes without affecting the entire system. The structure of the hexagonal representation is described, where the program layer is represented as a hexagon. Inside the hexagon, there are domain objects and uses that work with them. It is emphasized that there are no initial dependencies. All dependencies point to the centre. The inside of a hexagon or domain does not depend on anything but itself. It ensures that business logic is separated from technical levels. It also ensures that it is possible to reuse domain logic. The kernel contains basic business logic and business rules. It is noted that outside the hexagon, there are various adapters that interact with the application. Different adapters will interact with different aspects of the program. The adapters on the left control the application because they call the core of the program. The application controls the adapters on the right because the program kernel calls them.