Transaction Script or Domain Model

Despite the large number of application design approaches, two main ones stand out: Transaction Script Domain Model The first is simple and allows for conveniently organizing code into separate procedures that process external requests. However, as application logic becomes more complex, spreading it across many procedures leads to code duplication and other issues. Furthermore, mixing database interaction with logic processing complicates unit testing and reduces code reliability. On the other hand, using a Domain Model at the start often seems like over-engineering, adding significant code without guaranteeing freedom from errors. However, in the long term, this approach enables the creation of programs with complex domain logic without an exponential increase in complexity. ...

2022-12-07 · 2 min · 357 words · Andrey

Layers in Software Design

Separation of concerns is one of the most important principles in software design. A common way to adhere to this principle is to divide the application code into several levels of abstraction or layers, each performing a strictly defined function. Infrastructure Layer The Infrastructure Layer is the outer layer that handles all interactions between the application and the outside world. It includes all code that works with external dependencies, such as databases, third-party services, API controllers, etc. It contains implementations of entity repositories, adapters for message queues and external systems, and libraries for network operations, file access, and even system timers. ORMs and similar tools are encapsulated here. ...

2022-08-27 · 2 min · 261 words · Andrey

An Advanced Approach to Software Architecture

The Control Code project aims to propose an advanced approach to software architecture that offers many benefits and is fairly easy to implement. It also provides an application framework with a fast-start application template, a set of modules with standard features, an extensible design, and flexible user configuration capabilities. The framework is based on the most reliable software development patterns: Transaction Script and Domain-Driven Design (DDD). It uses an extensible layered application design and facilitates further application evolution. ...

2022-04-03 · 3 min · 443 words · Andrey

Namespaces

DDD and Microservices Namespace Naming Conventions Building software systems using microservices and Domain-Driven Design (DDD) reduces overall complexity and simplifies development by dividing a complex system into separate, smaller subsystems (called bounded contexts in DDD). To simplify implementation, we propose the following namespace naming conventions for .NET microservices. Namespace Templates System: Short name of the software system. Context: Name of the bounded context (subsystem). Domain Layer Namespace Description {System}.[Context].Domain Domain entities and value objects Application Layer Namespace Description {System}.[Context].Contracts Service interfaces, other interfaces, and data contracts {System}.[Context].Services Service implementations {System}.[Context].UnitTests Entity and service unit tests Infrastructure Layer Namespace Description {System}.[Context].AdaptersImpl Implementation of adapters {System}.Host.Controllers API controllers {System}.Host Application host (includes services, adapters, and controllers) {System}.Tests Integration and component tests Adapter Suffixes Repository Adapter Gateway Provider Store Db

2022-04-03 · 1 min · 127 words · Andrey