Beruflich Dokumente
Kultur Dokumente
– Most vending machines just sit and do nothing because the user
has violated the basic assumptions of their operation.
– because the vending machine was in a state (of waiting for
money) that the user ignored (by making a selection first).
struct personnelRecord
{ char name[100];
int socialsecurityNumber;
char department[10];
float salary; };
Figure 3–3 Employee Class with Protected Attributes and Public Operations
Behavior
• Behavior is how an object acts and reacts, in terms of its state
changes and message passing.
• An operation is some action that one object performs on
another in order to elicit a reaction.
• Object relationships :
– 1. Links
– 2. Aggregation
Links
• Physical or conceptual connection between objects.
One-to-Many Association
• One-to-one:
– Example class Sale and the class CreditCardTransaction
• One-to-many:
• Many-to-many: class Customer and class
SalesPerson
Inheritance
• To express generalization/specialization relationships
Single Inheritance