1

I'm thinking how and when a DCI context can be used in a Web application. I'm considering this high-level use case:

  1. User enters city, arrival, departure, room type and clicks "Search".
  2. System displays a list of hotels
  3. User clicks on a Hotel logo to read its details
  4. System displays hotel details
  5. User clicks "Book now"
  6. System displays payment form
  7. User enter customer details, billing information and clicks "Submit".
  8. System validates billing information and displays a booking confirmation.

This is very high-level and surely needs to be broken down. The first steps (1-2, 3-4, 5-6) feels like simple resource requests that could be handled with some search- and REST-architecture. So my first question is, is there a need for a DCI-context in those cases, isn't plain MVC enough? Of course a "Hotel" data entity could play a role, but would you consider it feasible, especially if it's the only actor?

The last step is where I see that DCI could be very useful, for now there is work to do in a procedural fashion. (Creating a Customer, adding a Booking to the Hotel, sending confirmation mail...)

What are your thoughts on this? Am I on the right track?

ciscoheat
  • 3,719
  • 1
  • 35
  • 52

1 Answers1

1

I think I would say that a context starts at step 2. You have a list of offers that plays a part. Currently those offers are hotel offers but what's a hotel offer? they might be different things. Some might be from brokers and some might be directly from hotels those are two different types of entities but they play the same part in this context, you might have many more types some which might be contexts the self. E.g. flight and hotel combined to an offer, where in that context a hotel/broker offer and a cheap flight offer plays each a role but the the listed use case you shouldn't have to worry about this but simply make it possible for the domain to evolve independently of the use case and though the use case is book cheap hotel I'd say that the form which we are trying to capture can be expressed better (though not exact) with "find best offer"

Then when picking a specific offer I'd agree that you start a new context

Rune FS
  • 21,497
  • 7
  • 62
  • 96