Logo

Navigation
  • Home
  • Services
    • ERP Solutions
    • Implementation Solutions
    • Support and Maintenance Solutions
    • Custom Solutions
    • Upgrade Solutions
    • Training and Mentoring
    • Web Solutions
    • Production Support
    • Architecture Designing
    • Independent Validation and Testing Services
    • Infrastructure Management
  • Expertise
    • Microsoft Development Expertise
    • Mobile Development
    • SQL Server Database and BI
    • SAP BI, SAP Hana, SAP BO
    • Oracle and BI
    • Oracle RAC
  • Technical Training
    • Learn Data Management
      • Business Intelligence
      • Data Mining
      • Data Modeling
      • Data Warehousing
      • Disaster Recovery
    • Learn Concepts
      • Application Development
      • Client Server
      • Cloud Computing Tutorials
      • Cluster Computing
      • CRM Tutorial
      • EDI Tutorials
      • ERP Tutorials
      • NLP
      • OOPS
      • Concepts
      • SOA Tutorial
      • Supply Chain
      • Technology Trends
      • UML
      • Virtualization
      • Web 2.0
    • Learn Java
      • JavaScript Tutorial
      • JSP Tutorials
      • J2EE
    • Learn Microsoft
      • MSAS
      • ASP.NET
      • ASP.NET 2.0
      • C Sharp
      • MS Project Training
      • Silverlight
      • SQL Server 2005
      • VB.NET 2005
    • Learn Networking
      • Networking
      • Wireless
    • Learn Oracle
      • Oracle 10g
      • PL/SQL
      • Oracle 11g Tutorials
      • Oracle 9i
      • Oracle Apps
    • Learn Programming
      • Ajax Tutorial
      • C Language
      • C++ Tutorials
      • CSS Tutorial
      • CSS3 Tutorial
      • JavaScript Tutorial
      • jQuery Tutorial
      • MainFrame
      • PHP Tutorial
      • VBScript Tutorial
      • XML Tutorial
    • Learn Software Testing
      • Software Testing Types
      • SQA
      • Testing
  • Career Training
    • Career Improvement
      • Career Articles
      • Certification Articles
      • Conflict Management
      • Core Skills
      • Decision Making
      • Entrepreneurship
      • Goal Setting
      • Life Skills
      • Performance Development
      • Personal Excellence
      • Personality Development
      • Problem Solving
      • Relationship Management
      • Self Confidence
      • Self Supervision
      • Social Networking
      • Strategic Planning
      • Time Management
    • Education Help
      • Career Tracks
      • Essay Writing
      • Internship Tips
      • Online Education
      • Scholarships
      • Student Loans
    • Managerial Skills
      • Business Communication
      • Business Networking
      • Facilitator Skills
      • Managing Change
      • Marketing Management
      • Meeting Management
      • Process Management
      • Project Management
      • Project Management Life Cycle
      • Project Management Process
      • Project Risk Management
      • Relationship Management
      • Task Management
      • Team Building
      • Virtual Team Management
    • Essential Life Skills
      • Anger Management
      • Anxiety Management
      • Attitude Development
      • Coaching and Mentoring
      • Emotional Intelligence
      • Stress Management
      • Positive Thinking
    • Communication Skills
      • Conversation Skills
      • Cross Culture Competence
      • English Vocabulary
      • Listening Skills
      • Public Speaking Skills
      • Questioning Skills
    • Soft Skills
      • Assertive Skills
      • Influence Skills
      • Leadership Skills
      • Memory Skills
      • People Skills
      • Presentation Skills
    • Finding a Job
      • Etiquette Tips
      • Group Discussions
      • HR Interviews
      • Interview Notes
      • Job Search Tips
      • Resume Tips
      • Sample Resumes
 

C++ Abstraction

By Sripriya R | on April 26, 2007 |
C++ Tutorials

Abstraction is one of the most powerful and vital features provided by object-oriented C++ programming language. Modularity is very important in any programming language, it provides flexibility to users for using the programming language. This aspect is well achieved with high performance by the concept of abstraction in C++. In object-oriented programming language the programmer can abstract both data and code when needed.

What is Abstraction

The concept of abstraction relates to the idea of hiding data that is not needed for presentation. The main idea behind data abstraction is to give a clear separation between properties of data type and the associated implementation details. This separation is achieved in order that the properties of the abstract data type are visible to the user interface and the implementation details are hidden. Thus, abstraction forms the basic platform for the creation of user-defined data types called objects.

Data abstraction is the process of refining data to its essential form. An Abstract Data Type is defined as a data type that is defined in terms of the operations that it supports and not in terms of its structure or implementation.

In object-oriented programming language C++, it is possible to create and provide an interface that accesses only certain elements of data types. The programmer can decide which user to give or grant access to and hide the other details. This concept is called data hiding which is similar in concept to data abstraction.

How Types of Abstraction Differs:

There are two broad types of abstraction:

  • functional abstraction
  • data abstraction.

The main difference between functional abstraction and data abstraction is that functional abstraction refers to a function that can be used without taking into account how the function is implemented. Data abstraction refers to the data that can be used without taking into account how the data are stored. There is also a difference in the way the access takes place in functional abstraction and data abstraction.

In functional abstraction, access to the function is provided through a specific interface defined to invoke the function. In contrast, in data abstraction, access to the data is provided through a specific set of operations defined to examine and manipulate the data. For instance, when a programmer is using C++ standard data types, this means that users are using the concept of data abstraction. When using data types, the users are not concerned with how the data is stored but they are concerned with what operations are provided and what properties are supported.

Reasons for the need of Abstraction

Flexibility in approach:

By hiding data or abstracting details that are not needed for presentation, the programmer achieves greater flexibility in approach.

Enhanced Security:

Abstraction gives access to data or details that are needed by users and hide the implementation details, giving enhanced security to application.

Easier Replacement:

With the concept of abstraction in object-oriented programming language, it is possible to replace code without recompilation. This makes the process easier and saves time for users.

Modular Approach:

In object-oriented programming language C++, the abstraction concept helps users to divide the project application into modules and test each of them separately. Then all modules are integrated and ultimately tested together. This approach makes the application development easier.

There are various ways of achieving abstraction in object-oriented programming language C++. One approach is to take modular based code that is broken apart into smaller segments, known as functions. This functional or modular approach helps the code to be reused again and again when needed. For example, a programmer might write a function for computing an average and another programmer might write a function for computing salary. These functions can be reused when needed, by anyone. The modular based approach helps to centralize all data of a similar type, under the control of a type module. Defining module types allow the module to be an abstract data type. In many other programming languages, there is a small drawback associated with the approach to accessing module type.

In C++, this problem is resolved through the concept of friend functions. Friend functions resolve the problem by associating with one of the classes or some of its members as friends of the other class.

The concept of abstraction brings forth another related term known as encapsulation. Encapsulation is the process of combining or packaging data with functions and thereby allowing users to create a new data type. This new data type is termed abstract data type. Though the new data type is similar to that of built-in data type, it is termed abstract data type because it enables users to abstract a concept from the problem space into the solution space. Apart from the above, all the features that hold for built-in types also hold for abstract data types. Type checking process that are performed for built-in types are also achieved in the same way and level for abstract data types.

« « Advantages and Disadvantages of Web 2.0
How Web 2.0 Will Change The Internet » »

Author Description

Avatar

Free Training

RSSSubscribe 394 Followers
  • Popular
  • Recent
  • C++ Looping

    September 4, 2007 - 0 Comment
  • C++ Functions with Arguments

    September 21, 2006 - 0 Comment
  • Elements of Object Oriented Programming

    June 10, 2006 - 0 Comment
  • C++ Friend Functions

    September 28, 2007 - 0 Comment
  • C++ Type Conversions

    August 13, 2006 - 0 Comment
  • C++ Storage Classes

    September 10, 2007 - 0 Comment
  • Basic concepts of OOPS and Structure of C++ program

    July 26, 2006 - 0 Comment
  • C++ Static Functions

    October 1, 2007 - 0 Comment
  • C++ Class Constructors and destructors

    August 17, 2006 - 0 Comment
  • C++ Function Passing Types

    September 12, 2007 - 0 Comment
  • C++ Dereference Operator

    October 14, 2007 - 0 Comment
  • C++ Memory Management Operators

    October 12, 2007 - 0 Comment
  • C++ Void Pointer and Null Pointer

    October 12, 2007 - 0 Comment
  • C++ Pointers

    October 1, 2007 - 0 Comment
  • C++ Static Functions

    October 1, 2007 - 0 Comment
  • C++ Friend Functions

    September 28, 2007 - 0 Comment
  • C++ Pure Virtual Function and Base Class

    September 28, 2007 - 0 Comment
  • C++ Virtual Functions

    September 25, 2007 - 0 Comment
  • C++ Inline Functions

    September 25, 2007 - 0 Comment
  • C++ Function Passing Types

    September 12, 2007 - 0 Comment

Exforsys e-Newsletter

ebook
 

Related Articles

  • C++ Dereference Operator
  • C++ Memory Management Operators
  • C++ Void Pointer and Null Pointer
  • C++ Pointers
  • C++ Static Functions

Latest Articles

  • Project Management Techniques
  • Product Development Best Practices
  • Importance of Quality Data Management
  • How to Maximize Quality Assurance
  • Utilizing Effective Quality Assurance Strategies
  • Sitemap
  • Privacy Policy
  • DMCA
  • Trademark Information
  • Contact Us
© 2023. All Rights Reserved.IT Training and Consulting
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptReject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT