Entity architecture.

There are two main architectural pattern regarding application structure. The most common one is Layer patter. Layer suggests that you will organize your code in layers which characterize certain system aspect and responsible to carry out that system character. System is building from those layers one on another while the upper layer responsible to receive incoming request (Usually User Interface - UI layer) and return results. The request is processed by calling other system layers to perform their layer specialty as part of the process. Every layer should call only layers near the calling layer, no direct calls over layers should be made. In the end of the process the upper layer return results back to the caller. The most classic separation is to 3 layers a. Presentation – responsible for receiving client request and displaying process data. B. Domain logic also known as Business logic – holds system logic. C. Data access – Retrieving and update system data.

Another well known architecture is the Hexagonal architecture. Hexagonal take another approach to handle system domain model. Instead of well format access order with layers Hexagonal suggest many ways to get request from system outer world and obviously in different format. Request may come from user, database, test text batch file, etc'. Those requests arrives the system and receive by transformers that access model data and return request to the calling entity. This model bypasses the layer model by letting outer yet difference entities to reach system model data by transformers and without given known sequence of calls between layers. (Hexagonal model is drawn as two hexagons one in each other. Every side represents different calling type. The inner hexagon represents the model data and the space between the two hexagons represents the transformers. http://c2.com/cgi/wiki?HexagonalArchitecture ).

I want to suggest architecture that is a mixture between those two approaches and it perfectly meets system of systems. The base assumption behind that architecture is that your IT systems are mix of Entities (systems). Each entity responsible for maintaining it own data, logic, presentation and other agreement tasks. Entity supplies it responsibilities as services to other entities and can consume those services from other entities as well. Entity architecture enable entity to interact with many sources of outer callers (rather then user) but when request intercept by given transform certain layer in the entity called. The called entity layer might use layers beneath but anyway there isn't direct access to non neighbor layer (L2 can't access L4 directly, just through L3). The layer that called by given transform is also the only layer that should return messages (results) back to the transformer. Entity architecture is similar to Hexagonal due to the fact that it enable receiving request from different sources and there isn’t rigid rule about bubbling request through all layers. On the other hand Entity use layers and enforce layers dependency therefore differ from Hexagonal architecture. From Layers point of view Entity architecture similar due to the use of layers but also differ because there might be call directly to any one of the system layers.

Sketch of entity architecture:

L = layer / service

Diagram that represent SOS (system of systems). Every entity implements 3 classic layers (UI, Business Logic and Data Access). Model data encapsulate and can only be access via Data Access layer. Every one of those entity can get call transform to any layer. This model enables every entity to consume UI, BL and DA services from other entities (gray lines).

 

No Comments