Free Low-level design lessonsLow-level design · Stage 1 · Case studies · Step 2
Case study: parking lot
Entities, spot allocation and fee calculation, and where strategy and factory earn their place. About 14 minutes.
Which parts of a parking lot design are the best candidates for the strategy pattern?
- AChoosing a spot and computing the fee, since both rules change
- BStoring the licence plate
- CCounting floors
Show the answer
Choosing a spot and computing the fee, since both rules change. Each can be swapped without touching ParkingLot.
4 questions on this idea
Short questions that apply the idea to new cases: trace it, work out a number, put steps in order. A wrong answer explains itself.
Answer them in your browserFree account, no card. Your progress is saved, and the idea comes back in a quick review later.
Sign up free to solve