StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...
Free

Concept of Encapsulation and Data Abstraction - Report Example

Cite this document
Summary
This report "Concept of Encapsulation and Data Abstraction" discusses Object-Oriented approaches that would be the most reliable software application. Object-Oriented System Engineering would help both companies align their individual information services in a smoother and more efficient manner…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER93.1% of users find it useful
Concept of Encapsulation and Data Abstraction
Read Text Preview

Extract of sample "Concept of Encapsulation and Data Abstraction"

? Object Oriented System Engineering -A brief orientation Contents Introduction 3 2.Object Orientated Paradigm – an overview 3 3.Concept of Classes and Objects 5 4.Concept of Encapsulation and Data Abstraction 6 5.Concept of inheritance 7 6.Concept of Polymorphism 9 7.Advantages of implementing Object Oriented Approach 10 8.Disadvantages of implementing Object Oriented Technology 11 9.Conclusion 12 1. Introduction Transitioning the existing information system paradigms of both companies into object oriented paradigms using Object Oriented System Engineering would help both companies align their individual information services in a smoother and more efficient manner while maintaining their individual customer relationship. This process might initially seem to involve unnecessary transitioning, as the applications can be easily integrated using a middleware application which requests/respond to queries to and from individual applications running in same/different platforms. Further, the resources (both manpower as well as system) involved in such transitions are much higher compared to developing a middleware application. However the advantages of using object oriented paradigm overwhelms these drawbacks with its enormous optimistic features and functionalities. The amount of effort involved in system transitions though high, is only a one time process. Once the existing models are transformed to object oriented models, the maintenance of the system become much easier and the resources involved for further enhancements would be reduced to a very great extent. Thus the end product of above process using Object Oriented approach would be a most reliable software application which runs on low production/maintenance cost. 2. Object Orientated Paradigm – an overview As compared to procedural or structured programming in which we define a solution to a problem as a set of procedures or actions that can be performed in order to accomplish the task, object orientated approach solves a problem by considering each entity involved in the problem as real world objects. For example, in a banking system, some of the entities involved are customers, account, loan, etc. A customer can have one or more accounts and may borrow one or more loans. In object oriented approach, each of these entities are treated as objects as shown in below figure (fig 1). The objects communicate with each other by sending and receiving messages to perform the required task. Fig 1: Object oriented approach in banking application The structure of the entity in terms of all the functions (methods) and the data (inputs and outputs) involved for an object are defined in separate modules called Class. For example, in the above diagram, the data involved for the customer object would be customer id, customer name, customer address, customer contact number, customer email, etc. The functions involved would be to add customer data, get customer data, update customer data, etc. The bundle of all these data in the form of variables/data fields and all these functions in terms of methods are defined as a template/structure in a module (a piece of code stored separately) called Class (name it CUSTOMER). Similarly, the data fields involved for the account object would be customer id, account number, PIN number, user id, password, account balance, interest etc and functions would be add account, verify account, get account info, get balance, set balance, etc. The data structure for this is stored in another class named ACCOUNT. The same procedure is followed for all the objects that are involved in the requirement. Thus the above figure is updated with the data fields and methods for each class as shown below (fig 2). This diagram/graphical representation of class in terms of data fields and methods is called Unified Modelling Language (UML) diagram. Though there are many data/methods involved in real scenario for each object, only few are shown in figure as example. Fig 2: UML diagram showing class definition for each Object Thus, in the above figure each class has its own set of data fields and methods that can act upon these data fields thereby simulating the real behaviour of the objects in the real world. The objects communicate with each other by passing messages through arguments. 3. Concept of Classes and Objects In the previous section, we have come across classes and objects at many places. Classes are nothing but the actual data structure consisting of data fields (variables) and methods (functions) that operates on these data fields. In the above figure, CUSTOMER, ACCOUNT and LOAN are classes. Objects are instances of a class. For example, in order to create a new customer, we create a new instance of the CUSTOMER class and call its Add_Customer_details method to add the details of the customer. This new instance of the CUSTOMER class we created above is called the object (the customer object). The object then takes the form of a real world object and performs any of the tasks defined in its class definition from within another class (the class which created this object). Any number of instances can be created for a class as shown in fig 3. Fig 3: Creating objects of a class 4. Concept of Encapsulation and Data Abstraction Encapsulation is concept of binding the data fields and the data methods which operates/acts on these data fields into a single entity (the class). The member data (data fields of the same class) are accessible only to the member methods (methods of same class). Thus encapsulation facilitates hiding of data from outside of its declaration boundary, thereby protecting the data from unauthorized and non-intended users. Data abstraction is the concept of providing the user of the object a well-defined and meaningful interface through which they can access all the methods defined in the class definition of the object while hiding the actual physical implementation of the methods. For example, in the above considered application, the user can retrieve the account information, by creating an object of the customer class and then by creating object of account class for the customer object and finally accessing by accessing the get_account_details method of the ACCOUNT class. The get_account_details method of the ACCOUNT class may have any complex logic for retrieving and presenting the account details for different type of customers/accounts, but the user just needs to know the name of the interface (method get_account_details) to access the required information. This concept of providing the user with a well defined interface to access the data while hiding its physical implementation details is called data abstraction. By using the concept of data abstraction, objects of any class can be created and can be used to perform any number of tasks defined in its class definition by just knowing its interface details (method names and its purpose). Thus if all the operations of both companies are defined in terms of objects, then each operation can communicate with each other smoothly by just knowing each other’s interface details. 5. Concept of inheritance Inheritance is a special concept in Object Oriented Programming by which the programmers can reuse common piece of code without re-writing them each time they want to perform a particular task. For instance, in the above example, the bank may have many type of customer like individual customers, corporate customers, business customers etc. However all types of customers share common properties (data and methods) of the customer class (customer id, customer name, address, contact no, email) along with some additional properties for each individual class. Instead of defining these properties again for each type of customers, we can just extend the CUSTOMER class in the newly defined class. This concept of extending or using the properties of existing class in another class is called inheritance. The inherited class would then include properties of both the parent class from which it is inherited as well as its own. In this way, we can re-use the existing class for similar functionality instead of re-writing the entire piece of repeated code. This is shown in below figure (fig 4). Fig 4: Concept of Inheritance Using the concept of inheritance, we can extend the properties/functionality of any class by extending them in another class and adding only the additional properties in the derived class. In this way, unnecessary impact on existing functionality of the system during enhancements is completely eliminated. Further, re-using the existing class for similar functionality not only reduces the coding time but also its size. 6. Concept of Polymorphism In general, the term polymorphism is used to refer things that takes multiple (more than one) forms. In object oriented technology, polymorphism is the concept by which the same method name can take different forms depending on the context it is used. For example ADD (int a, int b) can be defined to add two integers while the same method name but with different set of parameters ADD (String a, String b) can be defined to concatenate two strings. Further, polymorphism enhances the concept of inheritance: method in the parent class can be re-defined in the derived class by defining a method with the same name as the method in parent class. However, programmer is free to use either the method of its parent (using super keyword) or method of the derived class (directly). For instance, in the above example, Print_Report () method in CUSTOMER class is used to print all the customer information. The same method can be defined in its derived class INDIVIDUAL_CUSTOMER with the same but with additional features as shown below: Print_Report(){ Super.Print_Report(); Println(reference_details);} The above piece of code re-defines the Print_Report method of its parent and adds extra functionality to it. It uses the method of its parent class to print all common customer information and then print its own unique information (reference details). Print_Report () when called with CUSTOMER object will refer to Print_Report () of the CUSTOMER class and when called with a INDIVIDUAL_CUSTOMER object will refer to Print_Report () method of the INDIVIDUAL_CUSTOMER class. Thus, using the concept of polymorphism, the same method name can be used to perform multiple purposes depending upon the context it is used. 7. Advantages of implementing Object Oriented Approach Reduced Complexity: As the overall operation of the view of interaction between real world objects involved in the system, the understanding, development and maintenance of the system becomes much easier and simpler. Component Re-use: With the concept of inheritance, the existing classes can be re-used in the newly defined class for similar functionalities. This not only reduces the coding size but also the time required for coding. Ease of enhancements: With the combined concept of data abstraction, inheritance and polymorphism, changes can be made independently on individual classes during enhancement of the system, which is pretty much easier as compared to traditional way of recursively modifying each and every module involved/impacted by the enhancement. Ease of maintenance: The individual classes can be maintained independently which eases the task of location of a particular piece of functionality within large scale applications. Data security: With the concept of data encapsulation which facilitates data hiding, data can be made highly secure by allowing only the intended users of the data to access them. However, visibility of data can be controlled by using public and protected keywords. 8. Disadvantages of implementing Object Oriented Technology Adequate training period: As Object Oriented Paradigm is being introduced as a new concept in our company, most of the resources may not be aware of the technology. Hence adequate training should be provided to our resources in order to successfully deploy the integrated application using Object Oriented approach. This will definitely consume higher time as compared to using the existing technology. Increased design period: As most of the programs in the current applications would be very old and might have been developed by ex-employees of our company, a detailed analysis of physical and logical implementation details of the existing system is required before transitioning the system. This would increase the time period of the design phase, which would further add up to the overall development time. Identification of ideal IDE: The readability of the object oriented coding is much complex as compared to other coding in procedural languages due to the fact that the programs are organised into classes. In a procedural language, if we want to know the implementation detail of a function, we can go through the program and find the function definition somewhere within the program. But in object oriented approach, we may need to navigate through different files (classes) to find a function (method) definition. Hence an integrated development environment that lists all classes available for the project and supports simpler file navigations and provides find options must be identified for the programmers in order to develop and maintain programs efficiently. 9. Conclusion Thus, upon analysing the concept of Object Oriented Paradigm, its advantages and disadvantages, we can conclude that: though the initial process of transitioning both the existing systems using Object Oriented approach might consume little higher time and resource as compared to other solutions, the advantages it can bring in to our business overwhelms these drawbacks and helps us to build a more reliable integrated application that can be easily maintained and can be extended in the future with less modifications and complexity. Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(“Object Oriented Technology Essay Example | Topics and Well Written Essays - 1500 words”, n.d.)
Object Oriented Technology Essay Example | Topics and Well Written Essays - 1500 words. Retrieved from https://studentshare.org/information-technology/1450542-object-oriented-technology
(Object Oriented Technology Essay Example | Topics and Well Written Essays - 1500 Words)
Object Oriented Technology Essay Example | Topics and Well Written Essays - 1500 Words. https://studentshare.org/information-technology/1450542-object-oriented-technology.
“Object Oriented Technology Essay Example | Topics and Well Written Essays - 1500 Words”, n.d. https://studentshare.org/information-technology/1450542-object-oriented-technology.
  • Cited: 0 times

CHECK THESE SAMPLES OF Concept of Encapsulation and Data Abstraction

Object Oriented Programming

This research paper talks about the object oriented programming paradigm, its main concepts and principles (encapsulation, polymorphism, abstraction, dynamic binding and message passing) and how the paradigm may be applied to computer software or computer applications design.... In OOP, the represented objects have specific data fields such as rows and columns in the design of databases.... Furthermore, a set of operations as presented within the class are owned by objects which means that objects in OOP own a copy of specific data that is held within the program....
7 Pages (1750 words) Research Paper

Classes and Class Hierarchies in C++

It is a complex relationship that provides opportunity for reuse of objects and data variables in different classes.... Encapsulation supports the use and reuse of the An exampleExthe ample of implementation of encapsulation is shown in the sample source code below.... Since C++ is an Object-Oriented Application, we correct the duplication by use of the concept of inheritance.... abstraction is the definition of data and programs with the representation of the same form as the meaning and keeping the implementation details separate....
9 Pages (2250 words) Essay

Object-Relational Database

In RDBMS, there is no concept of reusability, because there are not any concepts of inheritance and polymorphism.... An object represents a real-life model encapsulating both data and operations within itself.... That type describes the attributes (data) and operations (methods) of an object record.... Here every record is termed to be active, persistent objects encapsulating both data and methods.... The only way to access any data is through the object methods....
11 Pages (2750 words) Essay

Can Teaching The Key Ideas Of Object Orientation Be Aided By Using Visual Representations

… In computer science, object-oriented programming (OOP), it is a computer programming paradigm that emphasizes the following concepts: Objects - Packaging data and functionality together into units within a running computer program; objects are the basis of modularity and structure in an object-oriented computer program....
33 Pages (8250 words) Dissertation

Object oriented development

The traditional or unstructured programs were replaced by a much better, more reliable procedural programming based on the concept of procedure call .... The fundamental concepts of OOP (short for object oriented programming) are class, object, encapsulation, inheritance, abstraction, and polymorphism.... An abstraction is the ability of a program to disregard the details of an object's class or subclass and simplify it into a more suitable general level....
5 Pages (1250 words) Essay

Article question

abstraction: It means including important characteristics and leaving other details.... es this disadvantage can be minimized by proper documentation to some extent such as avoid use of same variable but if we study the information hiding concept deeply then it states that direct access to critical data is not possible by the user of the program.... These attributes are encapsulation, information hiding and inheritance.... encapsulation: It is communication between different things....
1 Pages (250 words) Assignment

Object-Oriented System Engineering

he structure of the entity in terms of all the functions (methods) and the data (inputs and outputs) involved for an object are defined in separate modules called Class.... For example, in the above diagram, the data involved for the customer object would be customer id, customer name, customer address, customer contact number, customer email, etc.... The functions involved would be to add customer data, get customer data, update customer data, etc....
9 Pages (2250 words) Report

Unified Software Development Process and OOAD

… The paper "Unified Software Development Process and OOAD" is a perfect example of a report on design and technology.... The development of software application has transitioned from just, writing of codes to a process that entails transforming user's requirements into a software application or system....
9 Pages (2250 words) Report
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us