OOP : A ticket to the Railway Reservation System

When we start the implementation of any project, the first thing that comes to our mind is what are it’s elements! OOP is a concept which lets you explore minute intricacies of a system while also letting you create innumerable packets of similar elements. 

Consider a train – the most amazing of all the modes of travelling, isn’t it? Let us explore this train and divide it into it's elements :  Train ––> Bogies ––> Compartments ––> Births ––> Upper/Lower. There can be multiple ways of dividing a train into it's sub-parts. 

Similarly what parts can a Railway Reservation System have? We can have 1. Ticket booking 2. Enquiry 3. Ticket Cancellation 4. Seat Availability Status and what not!
Amalgamating these using the wieldy concepts of OOP and the system is ready! 

OOP will enable us to create classes and objects. A class is a blueprint and an object is an instance of that class. When you book a train ticket, you select the source, destination and train running between these places. Can a train be considered as class? The answer is YES. Janshatabdi Express, Rajdhaani Express, etc. can be objects of this class. Similarly we can define various derived classes and make use of the property of inheritance. Did you know you can book a parcel service which can be delivered via train? We can consider passenger trains, express trains,  cargo trains, etc. as the sub classes here. The user will select what type of train service he requires based on his need. A cargo train can be treated as subclass of train class, mentioning parcel id, amount, etc. with other basic train details already stored. Reusability and Reduced code - ✅

Bill Gates once said,

" Measuring programming progress by lines of code is like measuring aircraft building progress by weight."

Now, let us make you a user of our system. You have successfully logged into our system creating your own account. How can we keep your credentials safe and restrain others to login to your account? We can use encapsulation. A user will set a password and every time he/she logins, the password will be verified at the backend. In the frontend, you will be logged in unless you have forgotten your password! Privacy and Security - ✅



A ticket can be booked, the details can be stored. The same ticket can be viewed and details can be retrieved for confirmation status, cancellation, etc. All these actions are intertwined. All elements of a system should  smoothly interacting with each other. OOP helps us link these actions, link the objects from different classes, reuse the code, reduce the code length and making the system dynamic, i.e. easily upgradable and maintainable. 

Now that we have all the ticks, we all can agree that OOP is the best solution for handling and implementing an efficient Railway Reservation System! So let us get ready to witness the process of creating this system!

- Aditya Wyawahare 
 (K 84)

Comments

  1. Thank you for your comment! Feel free to ask any doubts!

    ReplyDelete
  2. Thank you for your comment and support @Techno_plug_in_hybrid_vehicle! Feel free to ask any doubts!

    ReplyDelete
  3. Replies
    1. Thank you for your comment! Feel free to ask any doubts!

      Delete
  4. Good work! Can you tell me more about OOP?

    ReplyDelete
    Replies
    1. You can check other posts in our blog to know more about OOP.....in short OOP is a way of writing computer programs using "objects" to represent data and methods instead of instructions.

      Delete
  5. Replies
    1. Thank you for your comment! Feel free to ask any doubts!

      Delete
  6. This was really helpful! Good work! ��

    ReplyDelete

Post a Comment

Popular posts from this blog

Do you have a ticket?

It's moderator's Office

Dynamic Memory Allocation in C++