CSC/ECE 517 Fall 2009/wiki2 15 sm

From Expertiza_Wiki
Jump to navigation Jump to search

Abstraction and the Object Model

Introduction

Abstraction is a process in which some characteristics of an entity are removed to reduce it to a set of essential characteristics that can effectively define that entity.It is basically done to reduce complexity.For example : the abstraction of a plastic container to a container will retain only the general information on the behavior and attributes of the container.The principle of abstraction is an essential element of Object-Oriented programming.One of the most powerful ways of managing abstraction is by using hierarchical classifications.This helps in layering the semantics of complex systems thus breaking them into chunks of manageable pieces.This method of hierarchical abstractions can also be applied to computer programs.The data from a process-oriented program can be transformed into its component objects using the principle of abstraction.In programming languages,abstraction is a mechanism that emphasizes the general properties of some segment of code and hides details.It involves separating a program into parts that contains certain details and parts where these details are hidden.



Overview

There are two common terms associated with the term abstraction:

  • Client - that part of the program that uses the program component.
  • Implementation - That part of the program thet defines the program component.

The interaction between these two entities is usually restricted to a specific interface.



Types of Abstraction

There are two kinds of abstraction :

  • Procedural Abstraction
  • Data Abstraction



Implementation of Abstraction in Object-Oriented Languages

Uses

  • Flexibility - It provides flexibility since the programmer can now hide the details or data that are not required for presentation.
  • More security - It helps in hiding the implementation details and giving access only to the data.
  • Modularity - It helps a user to divide a large program into chunks of modules.This helps in making the debugging as well as testing a lot more easier.
  • Easy replacement - It is easier to replace code without recompiling.



Links