Entity–control–boundary
   HOME

TheInfoList



OR:

The entity–control–boundary (ECB), or entity–boundary–control (EBC), or boundary–control–entity (BCE) is an
architectural pattern Software architecture pattern is a reusable, proven solution to a specific, recurring problem focused on architectural design challenges, which can be applied within various architectural styles. Examples Some examples of architectural patte ...
used in use-case–driven
object-oriented programming Object-oriented programming (OOP) is a programming paradigm based on the concept of '' objects''. Objects can contain data (called fields, attributes or properties) and have actions they can perform (called procedures or methods and impl ...
that structures the classes composing high-level object-oriented
source code In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer. Since a computer, at base, only ...
according to their responsibilities in the use-case realization.


Origin and evolution

The entity–control–boundary approach finds its origin in 
Ivar Jacobson Ivar Hjalmar Jacobson (; born September 2, 1939) is a Swedish computer scientist and software engineer, known as a major contributor to UML, Objectory, Rational Unified Process (RUP), aspect-oriented software development, and Essence. Biog ...
's use-case–driven
object-oriented software engineering Object-oriented programming (OOP) is a programming paradigm based on the concept of '' objects''. Objects can contain data (called fields, attributes or properties) and have actions they can perform (called procedures or methods and impleme ...
(OOSE) method published in 1992. It was originally called ''entity–interface–control'' (''EIC'') but very quickly the term "''boundary''" replaced "''interface''" in order to avoid the potential confusion with
object-oriented programming language Object-oriented programming (OOP) is a programming paradigm based on the concept of '' objects''. Objects can contain data (called fields, attributes or properties) and have actions they can perform (called procedures or methods and impleme ...
terminology. It is further developed in the Unified Process, which promotes the use of ECB in the analysis and design activities with the support of UML stereotypes. Agile modelling and the ICONIX process elaborated on top of the ECB architecture pattern with robustness diagrams.      


Principle

The ECB pattern organises the responsibilities of classes according to their role in the use-case realization: * an entity represents long-lived information relevant for the stakeholders (i.e. mostly derived from domain objects, usually persistent);    * a boundary encapsulates interaction with external actors (users or external systems); * a control ensures the processing required for the execution of a use case and its business logic, and coordinates, sequences controls other objects involved in the use case. The corresponding classes are then grouped into service packages, which are an indivisible set of related classes that can be used as software delivery units. ECB classes are first identified when
use cases In both software and systems engineering, a use case is a structured description of a system’s behavior as it responds to requests from external actors, aiming to achieve a specific goal. It is used to define and validate functional requireme ...
are analyzed:   * every use case is represented as a control class; * every different relation between a use case and an actor is represented as a boundary class; * entities are derived from the use-case narrative. The classes are then refined and re-structured or reorganized as needed for the design, for example:   * Factoring out common behaviors in different use-case controls * Identifying a central boundary class for each kind of human actor and for each external system that would provide a consistent interface to the outside world.    The ECB pattern assumes that the responsibilities of the classes is also reflected in the relations and interactions between the different categories of classes in order to ensure the robustness of the design.


Robustness diagram

Robustness diagrams allow to visually represent the relation between entities, controls, boundaries and actors. It uses graphical stereotypes introduced in Jacobson's early work:   The following robustness constraints apply:  * Actors may only know and communicate with boundaries * Boundaries may communicate with actors and controls only. * Controls may know and communicate with boundaries and entities, and if needed other controls * Entities may only know about other entities but could communicate also with controls; In principle entities should not know about boundaries and controls. In practice however, some variants allow entities, boundaries and controls to subscribe as observer to an entity. Similarly, the constraint of a boundary class not knowing about other boundary classes only applies at the highest level, and not between classes that cooperate to implement the same boundary.


Relation to other architectural patterns

There is some similarity between ECB and
model–view–controller Model–view–controller (MVC) is a software architectural pattern commonly used for developing user interfaces that divides the related program logic into three interconnected elements. These elements are: * the model, the internal representat ...
(MVC): entities belong to the model, and views belongs to boundaries.  However the role of the ECB-control is very different from MVC-controller, since it encapsulates also use-case business logic whereas the MVC controller processes user input which would be of the responsibility of the boundary in ECB.  The ECB control increases
separation of concerns In computer science, separation of concerns (sometimes abbreviated as SoC) is a design principle for separating a computer program into distinct sections. Each section addresses a separate '' concern'', a set of information that affects the code o ...
in the
architecture Architecture is the art and technique of designing and building, as distinguished from the skills associated with construction. It is both the process and the product of sketching, conceiving, planning, designing, and construction, constructi ...
by encapsulating business logic that is not directly related to an entity. The ECB can be used in conjunction with the hexagonal architecture, whenever the boundaries form the outer adapter layer.   ECB is compatible with the clean architecture which merges ECB principles with other architectural design paradigms. Clean architecture places entities at the core, and surround them with a use-case ring (i.e. ECB control) and a ring with gateways and presenters (i.e. ECB boundaries).  However, clean architecture requires a one-way dependency from outside to inside, which requires to split ECB controls into use-case logic and object coordination.


See also

*
Architectural pattern Software architecture pattern is a reusable, proven solution to a specific, recurring problem focused on architectural design challenges, which can be applied within various architectural styles. Examples Some examples of architectural patte ...
s *
Use case In both software and systems engineering, a use case is a structured description of a system’s behavior as it responds to requests from external actors, aiming to achieve a specific goal. It is used to define and validate functional requireme ...
* Unified process *
Object-oriented analysis and design Object-oriented analysis and design (OOAD) is a technical approach for analyzing and designing an application, system, or business by applying object-oriented programming, as well as using visual modeling throughout the software development pro ...


Notes and references

{{Reflist Software design Architectural pattern (computer science) Object-oriented programming