1. Nadar saraswathi college of atrs and science,Theni.
DATA HIDDING AND DATA ABSTRACTION
SUBIMITTED BY
A.NAGA VARTHINI
I MSC CS
2. Data hiding:
Data hiding is also known as data encapsulation and it is the
process of hiding the implementation of specific parts of the
application from the user.
Data hiding plays a major role in making an application
secure and more robust.
Data hiding in python can be achieved by declaring class
members as private by putting a double underscore (__) as prefix
before the member name.
4. Advantage of data hiding:
Enhances security by encapsulation important data
Hides irrelevant information from end user by
disconnecting object within the class from the useless
data.
Prevent creation of links to wrong data.
5. DATA ABSTRACTION:
An abstract class can be considered as a blueprint for
other classes. It allows you to create a set of methods that must
be created within any child classes built form the abstract class.
A class which contains one or more abstract methods is
called an abstract class.
6. Why use Abstract Base classes:
By defining an abstract base class, you can define a
common Application Program Interface(API) for a set of
subclasses.
7. How Abstract Base classes work:
By default, Python does not provide abstract classes.
Python comes with a module that provide the base for
defining Abstract Base Classes(ABC) and that module name is
ABC.
8. Concrete methods in Abstract Base classes:
Concrete classes contain only concrete (normal) methods
where as abstract classes may contain both concrete methods
and abstract methods.
Concrete classes provides an implementation of abstract
methods, the abstract base class can also provide an
implementation by invoking the methods via super().
9. Abstract Properties:
Abstract classes include attributes in addition to
methods, you can require the attributes in concrete classes by
defining them with @abstractproperty.