Designing with the DDD spirit
We have learned in the previous chapter an overview of DDD. In our implementation, we will follow the spirit of DDD to design the business classes.
Domain objects
If we were to read all the stories and think of a domain model, we might come up with the following classes:
Figure 8.12 – A diagram of the domain classes
- Service: Represents the service offered by the barber, with
AppointmentTimeSpanInMin
being the duration of the service andIsActive
being true to offer it to the client. - Customer: Represents a customer. We are currently only interested in their name.
- Employee: This class will expand at a later phase to have more info, but for now, we only need the name.
- Shift: Represents a unique availability time for the barber. The back office application (not within scope) will allow the business owner to add shifts for employees on a daily basis to cover at least 7 days forward. So, whenever we present...