Object behavior
Designing object behavior is a critical aspect of object-oriented software development. Object behavior refers to how objects of a class interact with one another and the system as a whole. In our object identification in the previous chapter, we listed some operations, but we want to dig in and discover how our objects interact. Here are some considerations for designing object behavior:
- Identify objects and classes:
- You can begin by identifying the objects and classes in your system. These represent the entities and concepts that your software will model. We focused on this in Chapter 3. One example from our event ticketing system is the
Person
object, which represents the patrons’ purchasing tickets. We also have previously identifiedOrders
,Tickets
, andPayment
classes. Figure 4.17 later in this chapter shows an updated version of the UML class diagram from Chapter 3.
- You can begin by identifying the objects and classes in your system. These represent the entities and concepts that your software will model. We focused on this in Chapter 3. One example from our event ticketing system is the
- Define object responsibilities:
- Determine what each object’s responsibilities...