BCE/ECB: Semantics over Bureaucracy 📎
A Package per Feature made the case for the Business Component (BC): one package per responsibility. Inside a BC the next question appears immediately: where does a class go? In most projects that question spawns bureaucracy: naming debates, layout documents, style-guide meetings. BCE answers it once, with three fixed packages. The generation BC from lightmetal:
lm.generation
├── boundary
│ ├── LightMetal.java
│ ├── LightMetalChat.java
│ └── LightMetalText.java
├── control
│ └── TokenAccumulator.java
└── entity
├── Response.java
└── Tps.java
The motivations:
- No placement debates. Every class has exactly one obvious home. The three names are fixed, so reviews argue about the semantics, not bureaucracy, and every BC in every project reads the same way. The convention is cross-technology: the same three package names structure a Java server, a web frontend, or infrastructure code. MVC only names roles, and every MVC framework invented its own directory layout. BCE is the only architectural standard where the layer names are the structure itself, fixed for over three decades.
- One entry point for the outside world. The
boundaryis the facade actors talk to: the CLI, an HTTP client, a test. It adapts external protocols and carries cross-cutting concerns like mapping or authorization. Other BCs may callcontroldirectly; external actors never do. - Logic stays procedural.
controlholds stateless, function-like units. They are implementation details, trivially unit-testable and freely replaceable. - State has a home.
entityholds the domain objects. They can be rich, carrying behavior next to their data, or anemic records passed between controls. Both are fine; what is fixed is where they live.
Dependencies flow in one direction: boundary calls control, control uses entity, never the reverse. And a BC only gets the layers its responsibility demands: lm.tokenization is a single control package, and that is fine.
See bce.design for the pattern rules. And yes, LLMs also like stability and predictability: airails.dev.