Design 1- Designing system using domain entities

The figure below proposes the first design for the Railway Reservation System (RRS):

Let me show you how a Railway Reservation Clerk (RRC) will reserve a ticket

  • RRC will first interact with the Train Entity to find whether a specific train runs on a specific day or not.
  • The train will give a response back to the RRC.
  • If the Train runs on the specific schedule, the RRC will then query the Coach entity to find whether a particular type of coach exists in that specific train on that particular day. (There can be many flows, but for the sake of simplicity, I will consider only the positive flows)
  • If the coach is available, the RRC will query the Berth entity to find whether the requisite numbers of Berths are available in that coach, Train schedule combination.
  • If the requisite numbers of Berths are available, the RRC will then interact with the Passenger entity and the passenger details.
  • Once the Passenger details are entered, the RRC will interact with the Payment entity to authorize the payment.
  • Once the payment is authorized, the RRC will generate the ticket entity and give it to the customer.

Manipulation of different domain entities by the RRC for a behavior- Manipulation of different domain entities by the RRC for a behavior of "Reserve a ticket".

The above was the interaction model for one of the behaviors called "Reserve a ticket".

The system is consistently designed in this way. For any other behavior like "Cancel a Ticket", "Pre-pone a ticket" etc, different Actors interact with other domain entities in accordance to the business logic to get their work done.

Let me tell you more about this system. The system gives us all the functionalities expected from it and gives reliable results.

This system is not a hypothetical system. Systems like this do exist. A centralized architecture of the mainframe systems are an excellent example of these systems.

Have you ever seen a Travel agent booking Airline Tickets?

In case you have, you would have seen them use some Black screens on desktops on which they fire commands and in the process they reserve tickets for us.

If I give you a system like this, what will you have to say about it? Would you use it?

If I was an RRC and if I were to use this system, I would not like to use it. Although the system delivers all the functionalities reliably, I wouldn't have used it.

According to me there are a lot of problems with this system.

Hemant Jha
Founder - VPlanSolutions
Researcher, Trainer