Monday, December 14, 2015

Data Abstraction


   >>> Abstraction refers to the act of representing essential features without including the background details or explanations.

   >>> Abstraction is "the process of identifying common patterns that have systematic variations; an abstraction represents the common pattern and provides a means for specifying which variation to use".

   >>> To implement real world entity into program. Class uses the concept of abstraction.

   >>> Simplifying complex reality by modelling classes appropriate to problem.

   >>> Abstraction is a process that involves identifying the crucial behaviour of an object and eliminating irrelevant and tedious details.

   >>> Classes use the concept of abstraction and are defined as a list of abstract attributes.

   >>> Simplifying complex reality by modelling classes appropriate to problem and working at the most appropriate level of inheritance for a given aspect of the problem.

   >>> An inheritance tree can grow quite large.

   >>> When the Mammal and Cat classes are complete other mammals such as dogs (or lions,tigers and bears ) can be added quite easily. The Cat class can also be a superclass to other classes.

   >>> For example, it might be necessary to abstract the Cat class further to provide classes for Persian cats, Siamese cats and so on. Just as with Cat the Dog class can be the parent for GermanShepherd and Poodle ( See Figure Below ). The power of inheritance lies in its abstraction and organization techniques.



   >>> Note that the classes GermanSheherd and poodle both inherit from Dog each contains only a single method. however, because they inherit from Dog, they also inherit from Mammal. Thus, the GermanSpherd and Poodle classes contain all the attributes and methods included in Dog and Mammal as well as their own.

   >>> An abstract class is parent class that allows inheritance but can never be instantiated.

   >>> Abstract classes contain one or more abstract methods that do not have implementation. Abstract classes allow specialization of inherited classes.

   >>> Take an example of inheritance example; in that page I mention one example of shape class, rectangle class, circle class etc. The shape is an abstract class and provides common characteristics.

   >>> In the real world you never calculate the area or perimeter of a generic shape you must know what kind of geometric shape you have because each shape (eg. square, circle, rectangle etc ) has its own area and perimeter formulas. 

No comments:

Post a Comment