C++ Timesaving Techniques For Dummies
Chapter One
Techique 1
Protecting Your
Data with
Encapsulation
Save Time By
Understanding
encapsulation
Creating and implementing
an encapsulated
class
Making updates to an
encapsulated class
The dictionary defines encapsulation as "to encase in or as if in a
capsule" and that is exactly the approach that C++ uses. An object
is a "capsule" and the information and processing algorithms that
it implements are hidden from the user. All that the users see is the
functional-level interface that allows them to use the class to do the job
they need done. By placing the data within the interface, rather than
allowing the user direct access to it, the data is protected from invalid
values, wrongful changes, or improper coercion to new data types.
Most time wasted in application development is spent changing code ... read full excerpt from C++ Timesaving Techniques For Dummies ebook