| Lesson 4 | Design Patterns Course project |
| Objective | General specifications for the "Gang of Four" course project. |
The seven-module course project is a small traffic-flow simulation. It provides one stable problem in which object creation, composition, communication, and changing behavior can be examined without requiring a graphical interface.
The first model contains a single intersection with two traffic directions. Vehicles proceed on green and stop on red. Pedestrians cross at the crosswalk only when the pedestrian signal displays Walk. The simulation advances through discrete time steps rather than depending on real elapsed time.
The project covers the simulation model and its control logic. A graphical interface, geographic map, database, and network service are outside the required scope. Keeping those concerns separate allows the same model to be driven by a console program, tests, or a future interface.
Begin with responsibilities rather than pattern names. Candidate domain concepts include:
These are candidates, not a final class list. For example, vehicle and pedestrian might share an interface, signal types might share state behavior, and the controller could be divided if it accumulates unrelated responsibilities.
These invariants provide concrete tests. A pattern is useful only if it helps preserve them while supporting a likely change.
Do not answer all five by automatically adding all five patterns. Each module should leave the design no more complex than its requirements justify.
Your first task is to propose the primary objects and classes for this system. Include a brief responsibility for each candidate and identify at least one uncertain boundary that you expect to revisit.