Enhanced Layered Architectures and Semi-formal Representations in Refactoring Using Domain-Driven Design
摘要
This study examines the optimization of layered architectures and the refactoring process within the context of Domain-Driven Design (DDD). Refactoring is a crucial technique for enhancing software maintainability and adapting to evolving requirements. However, if not approached in a systematic manner, it can potentially result in unintended structural modifications. It is proposed that DDD’s layered architecture, in conjunction with bounded contexts, be employed for the management of domain complexity and the enhancement of system scalability. To illustrate the proposed approach, we consider a barber shop. The system is divided into three contexts: Payment, User, and Employee. Each context utilizes a layered architecture. This approach facilitates the management of domain knowledge, with the Employee context centered around an aggregate root to handle complex domain-specific logic. Furthermore, semi-formal methods, such as robustness diagrams, are integrated to enhance architectural clarity and facilitate communication between developers and domain experts. These semi-formal representations provide a framework for modeling complex systems while maintaining flexibility. Future research will examine the application of these methods to the development of secure systems, including those based on the Internet of Things (IoT), and further refinement of the semi-formal approach to support broader use cases.