|
||||||
|
Encapsulation is a process in which behaviors spread through many methods and classes are brought togethor and hidden behind the "shell" of a single object. So, instead of dealing with many different objects, the user deals only with the one encapsulating object. Encapsulation is very useful in simplifying the interactions between two systems of objects. It can provide a clear delineation between variant and invariant behaviors when the invariant behavior is encapsulated into a single object and the variant behavior is abstracted into an abstract inheritance tree.that is topped by and abstract class with concrete subclasses. --> |