3 The existing codebase: requirements and properties

 

This chapter covers

  • HTTP routes, resources, and endpoints
  • Auto-properties and init only setters
  • Configuring an ASP.NET service

In this chapter, we meet our employer: Flying Dutchman Airlines. We consider its business needs and are given requirements to refactor their codebase by. The application we examine in this (and the next) chapter is a back-end web service developed on the .NET Framework following the Model-View-Controller (MVC) pattern. The code has many readability and security issues, so don’t be surprised if there are pieces of code in this chapter that you don’t like. The point of this chapter is for us to determine where we can make changes to the existing codebase. We look in-depth at the models, views, and configuration of the (messy) codebase in this chapter, preparing us to refactor the code in later chapters.

Figure 3.1 In this chapter, we start Part 2: Inheriting Code. We look at what requirements are laid out for us for the rest of the book, and what models and views the existing codebase contains.

3.1 Introducing “Flying Dutchman Airlines”

3.2 Taking a look at our requirements

3.2.1 Object-Relational Mapping (ORM)

3.2.2 The GET /flight endpoint: retrieving information on all flights

3.2.3 The GET /flight/{flightNumber}: Getting specific flight information

3.2.4 The POST /booking/{flightNumber} endpoint: booking a flight

3.3 Getting to terms with the existing codebase

3.3.1 The database schema and its tables

3.3.2 The existing code base: web service configuration files

3.4 Summary

sitemap