OOP is essentially relational programming. It programs relations among objects. The encapsulation should be on the logic of relationship.
Transport is a relationship between passenger, viechle and state. Some passenger transports with a car, others by foot. It's the Transport's responsibility to update the states of passenger and viechle.
Encapsulation on entities sometimes is not enough to make a good OOD.
Transport is a relationship between passenger, viechle and state. Some passenger transports with a car, others by foot. It's the Transport's responsibility to update the states of passenger and viechle.
Encapsulation on entities sometimes is not enough to make a good OOD.