COMPUTER LANGUAGES HTML,C,C++.JAVA,.NET AND MULTIMEDIA basics and programs click home button
C++ LANGUAGE BENEFITS OF DATA ABSTRACTION
Benefits of Data Abstraction
Data abstraction provides two important advantages:
• Class internals are protected from inadvertent
user-level errors, which might corrupt the state
of the object.
• The class implementation may evolve over time in
response to changing requirements or bug reports
without requiring change in user-level code.
By defining data members only in the private section
of the class, the class author is free to make changes
in the data. If the implementation changes, only the
class code needs to be examined to see what affect the
change may have. If data is public, then any function
that directly access the data members of the old
representation might be broken.
No comments:
Post a Comment