Question

I am trying to study some aspects of ddd with the domain of a car rental website.

The user/customer selects a car from a start and destination station and the time period.

The price calculation depends on various things like payment method, time, car classification and so on. The data is retrieved from a subsystem which differs in data access strategy from the rest of the application.

There are several actors in the domain like station service, call center...

Idea for the bounded context are

  • Company (employee, car, station)
  • Booking (reservations, model for booking request process)
  • Pricing (the price model)
  • Billing (rental billing, positions, customer)

After defining the bounded context I am unsure if the aggregated roots of each are correct. My thoughts are

  • Company: all three of them
  • Booking: reservation (access to billings, the car and customer)
  • Pricing: tariff matrix
  • Billing: customer (access to reservations, billings)

If needed I can add some class diagrams to show the different bounded context. If more information is needed, a class diagram or this should be migrated to an other section feel free to ask/do it.

Was it helpful?

Solution

With what little experience I have with the car rental domain, I'd say you are on the right track. A couple of things you should be aware of: Bounded Context are a logical separation, not a physical one. As such, using something like a compositional UI, would allow you to display pricing information as part of the booking process. You'd be hosting UI components from different BCs side by side, and using them to guide the end user through the process he's trying to complete. The other thing is, you're looking for aggregate roots in all of the BCs, but I do hope you realize that you don't need a domain model in each and every one of them. Maybe a simple datamodel will do if things are not "core" to your business or crud-based by nature. That's the beauty of BCs, the ability to make deliberate technology choices.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top