> How do you communicate between bounded contexts when using CQRS? In "normal" DDD I would use an application service from another app service.
You can still use an app service. The service defines the commands and domain events within the scope of an activity within a BC.
> Would you suggest to duplicate the room types (a subset, only bookable) in the hotel into RoomBooking or should I expose queries from HotelSetup which then RoomBooking could ask for number of rooms in a room type?
You need to analyse if the team that manages Bookable rooms (defines bookable rooms and closes rooms for booking) are distinct from the people that manages bookings. Most probably are since hotel inventory and maintenance is managed differently.
So if the HotelSetup defines what is bookable or not then you don't need to replicate the entire Bookable inventory. Instead you can use a shared view.
The RoomBooking BC can simply publish events of what is booked (RoomBooked). The Hotel Setup publishes events of what is available to be booked (BookableRoomDefined, RoomClosedForBooking). The View denormalizes both data streams into one shared view.
If your BCs are well defined this should be enough.
Nuno
HotelSetup.RoomRegisteredEvent => RoomBooking.CreateBookableRoomCommand
>How do you communicate between bounded contexts when using CQRS? In "normal" DDD I would use an application service from another app service.You only apply CQRS within a bounded context so I don't think that is what causing your "communication needs". Cross BC queries is usually a sign that the responsibilities of your BC's needs to be adjusted.
>RoomBooking will handle bookings, checkins, checkouts, etcWhy would booking be concerned about checkins and checkouts?
> 1..* BookableRoomIs each individual room really nessesary for doing a reservation?>HotelSetupWouldn't this BC be interested in who is checking in and who's is checking out? (you mention that this BC is responsible for the cleaning of the rooms)
Perhaps "HotelManagement" or "Facilities" would be a better name?
>RoomBooking could ask for number of rooms in a room typeCouldn't this be modeled as two different concepts? ( HotelSetup is master for the "capacity" of the hotel and Booking is master for "availablity")
>When command BookRoomTypeCommand is arriving I probably also want to do some validation that there are enough rooms available.Validating availability should be easy since it's owned by the booking BC.Is the command really invalid if there is no availability? (hint: overbooking policies)
You check-in on a room booking but maybe you're right that those are separate BC. Actually it was a made up example because I haven't done those stories. This post was more on how to handle the communication.