Dr Bhargavi Goswami CHRIST Bangalore bhargavigoswamigmail com 91
Dr. Bhargavi Goswami CHRIST Bangalore bhargavigoswami@gmail. com +91 9426669020
� Schildt Herbert, The Complete Reference C++, Tata Mc. Graw Hill, Reprint, 2012. � Deitel&Deitel, C++ How to program, Pearson Education Asia, 6 th Edition, 2008. � Bjarne Stroustrup, The C++ Programming Language, Special Edition, Pearson Education, 2010. � M. T. Somashekara, D. S. Guru, Object. Oriented Programming with C++, 2 nd. Edition, PHI, 2012.
�E Balagurusami, Object Oriented Programming with C++, Mc. Graw Hill Education, 6 th Edition, 2013. � Syllabus includes: Chapter 1 to 11.
� Software Evolution � Procedure Oriented Programming � Objects � Classes � Abstraction � Encapsulation � Inheritance � Polymorphism � Dynamic Binding
Manage Schedule Real life problems Decrease S/w Cost Open Interface Software Quality & Productivity Reusability Tolerant to Updates
� How to represent real life entities of problems in system design? � How to design a system with open interfaces? � How to ensure reusability and extensibility of modules? � How to develop modules that are tolerant to any changes in future? � How to improve software productivity and decrease software cost? � How to improve the quality of software? � How to manage time schedules? � How to industrialize the software development process?
� 50% of software products, never delivered. � 33% of delivered software never used. � 2% used without changes once delivered.
�Bad record of s/w industry in delivering products. �Reason? � 1. Changes in user requirements � 2. Changes in Data Formats
6 5 4 3 2 1 0 Paid but not Delivered Ababdoned, Used after received but not used Not Changes reworked Used as Delivered
� Correctness � Maintainability � Reusability � Openness and Interoperability � Portability � Security � Integrity � User Friendliness
Other Documentat 3% ion 6% H/w Changes 6% Routine Debugging 9% Emergency 12% Data Formats 18% Efficiency 4% User Requiremen t 42%
Maintainability Correctness Interoperability Reusability Portability Security Integrity User Friendly
Object Oriented Lang Procedure Oriented Lang Assembly Lang Machine Lang 1. 0
� Eg. COBOL, FORTRAN, C, etc � Imp. Focus: Problem � Solution: Provided with Functions and Procedures � How: Hierarchical Decomposition � Writes list of instructions / action / flowcharts � But, we least concerned about data and its flow. � Risk for global multi-procedural data. � Not Secure � Vulnerable to accidental modifications of data. � Bugs may creep in � Do not model real life problems well
Main Program Function 1 Function 2 Function 4 Function 3 Function 5 Function 6
� Emphasis on Algorithm � Divide and Rule (small program as function) � Share global data � Data movement is open in function � Function transform data � Top Down Approach
Global Data Function 1 Function 2 Function 3 Local Data
� Here, data is critical element � Data does not flow freely in program � Function – Data coupling is tight � Protection from accidental modifications � Decomposition of problem into #objects / entries. � These objects are using function built data. � Functions of objects can communicate.
Object A Object B Data Function Object C Data Function of objects Communicate.
� Emphasis on Data � Programs are divided into objects � Data characterized by objects tied with functions � Data is hidden � Way of communication is through functions � New Data and Functions can be created easily. � Follow bottom up approach.
Data Abstraction & Encapsulation Classes Objects Inheritance Dynamic Binding Polymorphism Message Passing
� Basic Runtime Entities � Customer, Account, Objects � Bank balance is data. � Balance sheet is a function. � Object has data and code (function). � See next fig.
Object Student Data: Name Birthday Marks Course Functions: Total Average Display
� Entire set of object’s data and code can be defined as user defined data-type called “class”. � Objects are variables of type class. � Class is a collection of objects. � Eg. Mango, apple, orange are objects of class “Fruits”.
� Wrapping of data and function into single class is “Encapsulation”. � Data is secure once encapsulated in class. � Functions connect class and object. � Avoiding data access other than class is facilitating “data hiding”. � “Abstraction” is representing essential features without including background information / explanation. � Abstract information / attributes eg. Size, cost, length, etc. � Abstraction is done using data members as they hold information. � Classes are also called ADT: Abstract Data Types
Bird: Feather Eggs � Reusability � Class features can be inherited to other classes � Tailoring of features is also possible Flying Bird: Size of Wings Robin Swallow Non Flying Birds: Weight Penguin Kiwi
� Operation exhibit different behavior based on provided type of data. � Eg. Add(num 1, num 2) does addition Add(str 1, str 2) does concatenation � Obtained by operator or function overloading. � Allow different internal structures to use same external interface � Also used in implementing inheritance � Done preferably using Function Overloading.
Shape Draw (Circle) Draw (Box) Draw (Triangle)
� Also called Late binding � Dynamically, draw a procedure that will take actions based on type of object provided. � Same as figure, if circle is provided, draws circle.
�A message for an object is a request for execution of a procedure and therefore will invoke function that generates result. � Steps: � Create Class (create members, functions) � Create Objects � Communication happens using functions to obtain desired results. Employee. salary(name) Object Message Information
� Greater productivity, better quality of s/w, less maintenance. � Inheritance: Code Reusability and reduced redundancy � Reuse of standard working modules, save time. � Data Hiding: Secure � Multiple instance of an object can co-exist � Map Objects in problem domain � Problem partition in project based objects
� Data center design, modeling of problem, solution implementation easy. � Bottom Up Approach � Encapsulates details � Message passing system is very simple. � Easy to manage s/w complexity � Compatible with C Language.
Limited GUI Support Limited standard library Thread not supported Difficult to implement web applications
� Real-time systems � Simulations and Modeling � Object oriented Databases � Hypertext, hypermedia and expertext � Artificial Intelligence � Developing Expert Systems � Neural networks and parallel programming � Decision Support and Office Automation System � CAD Systems � Internet of Things � Embedded Programming � Compiler and Operating System development � Developing new programming language
� What do you think are the major issues facing the software industry? � Explain Software Evolution. � How are the data and functions are organized in OOP? � List down unique advantages of OOP. � List 20 real world objects. � List down the advantages of inheritance. � List applications of C++
� Procedure oriented v/s Object Oriented � Object v/s Class � Data Abstraction v/s Data Encapsulation � Inheritance v/s Polymorphism � Dynamic binding v/s Message Passing
Explore more about the topic.
- Slides: 38