Domain
Definition
A Domain is a entity containing various business logic and terminology regarding an area of expertise. It's important to define the goal and the terminology of the domain before working on it. A domain should clarify and isolate a part of a complex software to create smaller pieces of code to maintain. It's easier to manage a medium to large team with well defined domains because each team can focus on one domain at a time. The domain is not linked to one technology. A domain is mostly composed of entities (models) and logic (services).
Goal and Guidelines
- An application can use various domains to operate.
- A domain should be as much isolated as possible and reusable in many applications.
- A domain has his own test suite and can run independently.
- The dependencies of a Domain should be as minimal as possible. Ideally a Domain is an independent application but it's not mandatory.
In Rails
- Domains should be in
app/domain
- Domain should be a module (namespace) and inside this module you can have various modules and classes.
Notes
Creating a new Domain should be a team decision. The Domain should be scopes to a specfic task.