Designing the movie booking app

In this section, we will do a high-level design of our movie booking web app using ASP.NET Core 2.0. The high-level design of the app is pretty simple, as shown in the following diagram:

We can see that an Online user browses the Movie Booking Web app, which is an Azure web app. Ideally, there should be a service layer in between the Movie Booking Web app and the Database, to allow for a neat, extensible, modular, and layered architecture. However, for the purpose of learning, we will keep things simple and eliminate the service layer for now. The web app gets data and stores the data in the SQL Azure database. If you are worrying about the Azure web app or SQL Azure, stop doing so. We will develop the app locally development machine and deploy it in Azure, and at that time we will take care of the Azure web app and SQL Azure.

Based on the requirements, we need to design the following:

  1. A user interface of the movie booking web app.
  2. A page to list all the movies currently being shown. We will need to design the database model to show the list of the movies currently being shown.
  3. A page to display the details of the selected movie.
  1. A page to display the available seats to choose from.
  2. A login/authentication module using Facebook or Gmail.

For Steps 2 to 4, we need to do database modeling. We will use SQL Express on Windows and use EF Core, which we discussed earlier. Let's do the class design to fulfill the requirements and create the database following the code-first approach. A movie booking system is a complicated and time-consuming system to make. However, what we will make here is a very simple and limited version of a movie booking system, so that we can focus on learning fundamentals rather than on the design of the system. From the requirements, it is clear that we need to have a Movie class to contain the movie information and an Auditorium class where the movie will be shown. The information about which movie is being shown in the auditorium should be stored in a Show class. The auditorium has seats, so we will need a Seat class so that the user can choose a seat and book it using a Booking class to get a ticket through the Ticket class. It's worth reiterating that this is a an over-simplistic design to enable an easy grasp of the system the actual system; may be more complex. The following diagram shows how our classes will be designed as per the preceding analysis:

Since we are using EF Core, our database model will be a replica of these classes, as we saw in the earlier section on getting started with EF Core. Once we are done with these, we will have to develop a simple application that will just do CRUD operations. Now that we have a high-level architecture and class diagrams in place, let's start the coding of the web app.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset