Chapter 2. Acme Car Rental

 

This chapter covers

  • Creating requirements for a fictional project
  • Writing code from scratch to satisfy the requirements
  • Taking a pass to refactor messy code, without any AOP
  • Taking a different pass to refactor, this time using AOP

In this chapter, you’ll be coding the business logic for a new application for the (fictional) Acme Car Rental Company. You’ll be given the requirements; you can then follow along as I gradually add code to conform to those requirements.

I’ll start from scratch and not use any AOP. The business requirements are the most important, so we’ll do those first. Once the business logic is working, we’ll add code to cover the nonfunctional requirements. Once we’ve fulfilled the requirements, we’ll look at possible ways to clean up and refactor the code, again without using any AOP to refactor the cross-cutting concerns.

After this first pass, you’ll turn to the long tail of an application’s life. Software is rarely static for long: new features are requested and new bugs are discovered. A piece of software is rarely in development longer than it’s in production, which means that most of the software’s life is the maintenance phase. An application that’s hard or expensive to maintain leads to either high costs or low quality (or both) and eventually spirals into a big ball of mud.

2.1. Start a new project

 
 

2.2. Life without AOP

 
 
 
 

2.3. The cost of change

 
 
 
 

2.4. Refactor with AOP

 
 

2.5. Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest