Presentation is loading. Please wait.

Presentation is loading. Please wait.

Overview of OOPs (Object Oriented Programming Structure) Concepts

Similar presentations


Presentation on theme: "Overview of OOPs (Object Oriented Programming Structure) Concepts"— Presentation transcript:

1 Overview of OOPs (Object Oriented Programming Structure) Concepts

2 OOP Paradigm  Programming paradigm - Way of thinking / approaching a problem Style of computer programming, serving as a way of building the structure and elements of computer programs.  Influences the programming language and other things built on top of the language, such as libraries, frameworks, and common styles and patterns of programming.

3 OOP Paradigm Way of looking at something.
When TV came out it was a new paradigm; everything changed Twitter is a new paradigm in communication When the Internet took off, it was a new paradigm, and now we have Online Shopping for Electronics, Apparel, Computers, Books, DVDs & more

4 OOP Paradigm  Programming paradigm - Way of thinking / approaching a problem Style of computer programming, serving as a way of building the structure and elements of computer programs.  Influences the programming language and other things built on top of the language, such as libraries, frameworks, and common styles and patterns of programming.

5 Types of Programming Paradigm
 Imperative programming paradigm Functional programming paradigm Logic programming paradigm Structural programming paradigm Object-oriented programming paradigm Different paradigms permit and forbid certain techniques.

6 Multi – Paradigm Language
Language that supports more than one paradigm C++ is one such language Supports Procedural/Object Oriented Programming

7 Popular OO Languages—A glance
Java Smalltalk Charm++ Simula Ada Eiffel

8 Advantages of Object Oriented Programming
Improved software-development productivity Consider the entire life cycle of a person to understand Modular (He learn lessons, play, watch TV, prepare food etc) Extensible - objects can be extended to include new attributes and behavior (A baby has name, father name, mother name, when joined school has admission number class of studying, when joined job has employee id, salary etc. Funationalitites that can be performed also increases)

9 Advantages of Object Oriented Programming
reused within and across applications Same person is a employee of an organization, mother/ father at home, son / daughter to their parents Sometimes a person does a job for his family / friends Improved software maintainability: Since the design is modular, part of the system can be updated in case of issues without a need to make large-scale changes

10 Advantages of Object Oriented Programming
Faster development: Reuse enables faster development. Object-oriented programming languages come with rich libraries of objects Lower cost of development: reuse of software also lowers the cost Higher-quality software: Faster development of software and lower cost of development allows more time and resources to be used in the verification of the software.

11 Disadvantages of Object Oriented Programming
Steep learning curve: The thought process involved in object-oriented programming may not be natural for some people, and it can take time to get used to it. Larger program size: More lines of code than procedural programming Slower programs: Object-oriented programs are slower than procedure based programs Not suitable for all types of problems

12 Basis of Object Oriented Programming
View the problem world as a set of objects and communication between the objects Entire world around as can be thought as a set of objects Objects have characteristics and they can perform some functions Similar objects may be grouped together

13 Human Body Parts In OOP Hand: Characteristics:
Covered in skin = true. number of bones = 42 (I have no idea how many a human hand really has) number of fingers = 5. Methods/Things it can do: Grasp object Count to five with fingers Point index finger

14 Human Body Parts In OOP Heart: Characteristics:
Pumps blood = true Internal Organ = true Covered in skin = false Methods/Things it can do: Speed up pumping. Slow down pumping.

15 Features of Object Oriented Paradigm

16 Case Study: OOP Design for Railway Reservation System
Identify the Objects involved in the process

17 Railway Reservation System
Train Coaches / Compartments Station Passenger Employee of railways Route Ticket Distance matrix

18 What is UML? UML stands for “Unified Modeling Language”
It is a industry-standard graphical language for specifying, visualizing, constructing, and documenting the artifacts of software systems The UML uses mostly graphical notations to express the OO analysis and design of software projects.  Simplifies the complex process of software design . What does UML stand for? . Industry standard . Graphical notation . Modeling tool … simplifies software design process

19 Why UML for Modeling Graphical notation to communicate more clearly
Help acquire an overall view of a system. UML is not dependent on any one language or technology. UML moves us from fragmentation to standardization. . More precise than natural language … less detailed than source code . Not dependent on any language . Standardized by various groups

20 Encapsulation Binds together the data and functions that manipulate the data, and that keeps both safe from outside interference and misuse Classes are in C++ to encapsulate C with Classes - Name given by Stroustrup Classes are extension of structures with functions as members In C++, structures can also have functions

21 Class is generalization of objects where data and functions are grouped

22 Class Depicts the set of similar objects as mentioned in the previous example. It distinguishes one type of object from another type A Class is an User defined data type A class comprised of attributes and functions. Attributes defines the properties of the object and function describes “What an object is capable of doing” The class is like a blue print of a house and it indicates how the data and functions are used by the objects.

23 Objects In programming perspective, instance of a class

24 Classes and Objects in Railway Reservation System
Train Tamilnadu SF Express Coaches/Compartment B1 Station Chennai Central Passenger Any person travelling in train Employee of railways Travelling Ticket examineR (TTR) Route (Stations through which train travel) Chennai Central (Terminus), Vijayawada, Warangal ... New Delhi Ticket Ticket possessed by a passenger Distance matrix Distance between stations of Indian railways

25 Class diagram in UML Used for describing structure and behavior in the use cases Provide a conceptual model of the system in terms of entities and their relationships Used for requirement capture, end-user interaction Detailed class diagrams are used for developers

26 Class diagram in UML Each class is represented by a rectangle subdivided into three compartments Name Attributes Operations

27

28

29

30

31 Data Abstraction Providing only essential information to the outside world and hiding their background details By abstraction, a programmer hides all but the relevant data about an object in order to reduce complexity and increase efficiency Stepping away from a complex or unsafe algorithm by black boxing it and always using that black box Makes code to be manageable

32 Data Abstraction Access Labels Enforce Abstraction:
Three Access labels in C++ Private Public Protected

33 Data Abstraction in UML
Modifiers are used to indicate visibility of attributes and operations. ‘+’ is used to denote Public visibility (everyone) ‘#’ is used to denote Protected visibility (friends and derived) ‘-’ is used to denote Private visibility (no one) By default, attributes are hidden and operations are visible.

34 Other UMLs diagarams shall also be referred

35 Data Abstraction

36 Abstraction in Railway Reservation System
Classes Information Hidden Train Date of manufacturing for engine Coaches/Compartment Cleanliness, Painted color, Station Length of the stations, shops Passenger Number of children Employee of railways Employee id, Salary Route (Stations through which train travel) Number of tracks Ticket Printed, mobile ticket Distance matrix Quality of track


Download ppt "Overview of OOPs (Object Oriented Programming Structure) Concepts"

Similar presentations


Ads by Google