Entity–control–boundary (ECB), also referred to as entity–boundary–control (EBC) or boundary–control–entity (BCE), is an architectural pattern used in use-case–driven object-oriented software engineering. It structures the classes that compose high-level object-oriented source code according to their responsibilities within the realization of a use case. The pattern partitions a system's objects into three class stereotypes—entities, controls, and boundaries—and is commonly described as a variation or simplification of the Model–View–Controller (MVC) pattern.
Origin and evolution
The entity–control–boundary approach traces its origins to Ivar Jacobson's use-case–driven object-oriented software engineering (OOSE) method, published in 1992 in the book Object-Oriented Software Engineering: A Use Case Driven Approach. The pattern was originally called Entity–Interface–Control (EIC). The term "boundary" subsequently replaced "interface" to avoid confusion with the meaning of "interface" in object-oriented programming language terminology. The pattern is related to, but distinct from, MVC: it is not applied solely to user-interface concerns, and it assigns the "control" role a somewhat different function than the controller in MVC.
Pattern structure
The pattern classifies design elements into three stereotyped roles:
-
Entity: A long-lived, passive element responsible for some meaningful body of information and the behavior organized around that data. Entities represent application-independent business objects—such as a Customer, Transaction, or Order—along with their associated business rules. Entities are intended to be reusable across applications.
-
Control: An element that manages the flow of interaction for a scenario (use case). Control objects hold application-specific domain logic and orchestrate the sequence of operations that realize a use case. They mediate between boundary objects and entity objects. Unlike the controller in MVC, the control object in this pattern is responsible for the overall flow of scenario behavior rather than for user input handling specifically.
-
Boundary: An element lying on the periphery of a system or subsystem that mediates communication with external actors. Boundaries include user interfaces, gateways, proxies, and interfaces to external systems, databases, and devices. Boundary objects handle all logic that deals with factors outside the core of the system.
Relationships and communication rules
The pattern imposes constraints on how elements of the three types may interact. Control elements may communicate with entities, with other controls, and with boundaries. Entities and boundaries, however, should not communicate directly with one another; their interaction must be mediated through control objects. This rule supports separation of the application-independent domain core from external dependencies.
Relation to other architectures
Entity–control–boundary is frequently cited as a foundation for later architectural approaches, including hexagonal architecture (also called ports and adapters) and clean architecture. In these frameworks, the entity and control objects correspond to the domain-logic core, while boundary objects occupy the outer layers that handle external interaction. The ECB pattern underlies the separation of concerns that these later styles formalize, and it supports testability by allowing boundary objects to be implemented as mocks or real actor interfaces.
Applications and references
The pattern is part of the Rational Unified Process and OpenUP methodologies, which provide guidelines for applying ECB during design. It is a documented subject in software-engineering literature, including the Wikipedia article on entity–control–boundary and numerous university and practitioner references, such as guides published by San José State University and the Clemson University open-source repository of the OpenUP guidelines.