You can take two views of an object:
- internal - the structure of its data, the algorithms used by its methods
- external - the interaction of the object with other objects in the program
From the external view, an object is an encapsulated entity, providing services These services define the interface to the object An object should be self-governing Any changes to the object's state (its variables) should be accomplished by that object's methods We should make it difficult, if not impossible, for one object to "reach in" and alter another object's state The user, or client, of an object can request its services, but it should not have to be aware of how those services are accomplished (abstraction - hide details).
Awesome job, it's clear and precise.
ReplyDeletereally good one
ReplyDeletereally good one
ReplyDelete