WizIQ helps you learn and teach online - any subject you can think of!
Join for FREE

Object Oriented Programming Concepts 1

Add to Favourites
Post to:

Description
Object Oriented Programming Concepts

Comments
Lokesh Kumar
By: Lokesh Kumar
737 days 12 hours 32 minutes ago

These concepts were really helpful

Dew
By: Dew
590 days 14 hours 14 minutes ago

Nice. Can revise all oops concept at a glance.

Shastinathan
By: Shastinathan
528 days 16 hours 12 minutes ago

Great Job!!! highly useful

KYAW KYAW OO
By: KYAW KYAW OO
500 days 10 hours 11 minutes ago

Hi,

I tried to download but I couldn't get what I want.

Pls help me to get this real slides instead of something like [Content_Types].xml so on

I am looking forward to hearing from you.


Thanks and best regards

Presentation Transcript Presentation Transcript

Object-Oriented Concepts : Object-Oriented Concepts D.S Giri LipNi Services http://SliceData.BlogSpot.com dharmendra.giri@gmail.com

Index:- : OO Programming – What? / Why? and Benefit Real World Objects Data Abstraction Class / Objects Aggregation Association Encapsulation Inheritance Polymorphism Interface / Events / Listeners UML Notations Modeling Tools - Rational Rose Concepts LipNi Services 2 Index:-

Object-Oriented Programming : An approach to application development Appropriate for large-scale applications with teams of developers OO programming paradigm: collection of objects Object-Oriented Programming 3 LipNi Services

Slide 4 : Global Variables -lifetime spans program execution. Local Variables - lifetime limited to execution of a single routine. Nested Scopes - allow functions to be local. Static Variables - visible in single scope. Modules - allow several subroutines to share a set of static variables. Module Types - multiple instances of an abstraction. Classes - families of related abstractions. The Evolution of OOPS 4 LipNi Services

Why OO-Programming? : Reduces conceptual load by reducing amount of detail Provides fault containment Can’t use components (e.g., a class) in inappropriate ways Provides independence between components Design/development can be done by more than one person Why OO-Programming? 5 LipNi Services

Slide 6 : An instance of a class is know as an Object. Languages that are based on classes are know as Object-Oriented. Eiffel C++ Modula-3 Ada 95 Java SmallTalk Microsoft .NET Languages - C# and VC++ etc Keys to OO Programming The concept of objects and object-oriented programming exist in dozens of computer languages. The object model is implemented with sometimes slight and sometimes substantial differences in each of these languages. 6 LipNi Services

Benefits of Object-Oriented Development : Promotes code reuse Reduces code maintenance Simplifies extending applications Benefits of Object-Oriented Development 7 LipNi Services

Basic Concept : Object-orientation is so called because this method sees things that are part of the real world as objects. Phone Bicycle Human Being Insurance policy are objects. In everyday life, we simplify objects in our thinking we work with models. Software development does essentially the same: objects occurring in reality are reduced to a few features that are relevant in the current situation. Basic Concept 8 LipNi Services

Real World Objects : Real World Objects Complex realities are made more manageable by abstract models. 9 LipNi Services

Data Abstraction : Data Abstraction Abstraction is the presentation of simple concept (or object) to the external world. Abstraction concept is to describe a set of similar concrete entities. It focuses on the essential, inherent aspects of an entity and ignoring its accidental properties. The abstraction concept is usually used during analysis: deciding only with application-domain concepts, not making design and implementation decisions. 10 LipNi Services

Data Abstraction : Data Abstraction Two popular abstractions: Procedure abstraction - This is to decompose problem to many simple sub-works. Data abstraction- This is to collect essential elements composing to a compound data. These two abstractions have the same objective: reusable and replaceable. 11 LipNi Services

Data Abstraction:- Data Abstraction : Data Abstraction:- Data Abstraction Example of Data Abstraction. 12 LipNi Services

Encapsulation : Encapsulation Encapsulation means as much as shielding. Each object-oriented object has a shield around it. Objects can't 'see' each other. They can exchange things though, as if they are interconnected through a hatch It separates the external aspects of an object from the internal implementation details of the object, which are hidden from other objects. The object encapsulates both data and the logical procedures required to manipulate the data. 13 LipNi Services

Example of Encapsulation Concept. : Example of Encapsulation Concept. 14 LipNi Services

Class Modeling – “CLASS” : Class Modeling – “CLASS” A class is used to describe something in the world, such as occurrences, things, external entities, roles, organization units, places or structures. A class describes the structure and behavior of a set of similar objects. It is often described as a template, generalized description, pattern or blueprint for an object, as opposed to the actual object, itself. 15 LipNi Services

Class Modeling – “OBJECT” : Class Modeling – “OBJECT” Once a class of items is defined, a specific instance of the class can be defined. An instance is also called “object”. The table gives some examples of classes and objects Class and Object. 16 LipNi Services

Property and Method : Property and Method Properties in a class are used to present the structure of the objects: their components and the information or data contained therein. (e.g., name, owner, ground clearance).An instance of a class has the properties defined in its class and all of the classes from which its class inherits. Methods in a class describe the behavior of the objects. It represents a function that an instance of the class can be asked to perform. An example of a Dog Class 17 LipNi Services

Class and Object : Class and Object Each instance contains the same properties and handlers as the class, but the properties values of each instance are encapsulated. You may change them without affecting the other instances or the class script. 18 LipNi Services

The Nature of an Object : The Nature of an Object An object is a discrete entity. In object-oriented programming, an object is the product or instance generated by a class. An object can have properties, exhibit behaviors, execute methods, and calculate and return values. Reusability and encapsulation are the two most obvious benefits of object-oriented programming paradigms. You can use a single class script to create an unlimited number of specialized instance objects, and each of those objects is a protected, encapsulated instance. In other words, the instances don’t affect or alter the class; they don't affect or alter one another. 19 LipNi Services

Composition Object : Composition Object A composition object is an object based on a physical thing, like this refrigerator. 20 LipNi Services

Composition Object : Composition Object The refrigerator object is not empty. It has a series of shelves inside and each one contains other objects. The top shelf, for example, has a milk carton in it. So just to recap, the refrigerator has a milk carton. The milk carton, in turn, has a quantity of milk inside it The "has-a" relationship between various objects in composition objects is similar to spatial relationships in everyday things. 21 LipNi Services

Inheritance Object : Inheritance Object These objects are generally used to model conceptual relationships rather than spatial ones. Lots of things exist only as conceptual or classification concepts and have no actual physical form. These are the sorts of things that fit well in this type of object structure. 22 LipNi Services

Inheritance Object : Inheritance Object What sort of fruit is a fruit? Can you ask for fruit at breakfast and be certain of the result? Only in the sense that you’ll probably be given some sort of fruit, but you have no idea whether to expect strawberries or bananas. Yet there is a substantial difference between strawberries and bananas. A strawberry is a fruit. A banana is a fruit, as is a kiwi. Because of this conceptual (is a type) relationship between objects, these objects inherit certain common qualities from their original classification. Fruit are all plants, and all are sweet, and all have seeds (barring genetic manipulation). This group gets their name, "inheritance object," from this relationship. The reason that they are all able to descend from one class is because we are able to conceptually link these things together. Their common origin exists in our heads. 23 LipNi Services

Association : Association An association is a relationship between different objects of one more classes. A simple example of an association is the relationship among an enterprise, departments and employees 24 LipNi Services

Multiplicity : Multiplicity In the simple case, an association is represented by a single line between two classes. Usually, however, associations are shown in as much detail as possible. Then, the association receives a name and a numerical specification (Multiplicity indication) of how many objects on one side of the association are connected with how many objects on the other side. Example of association with multiplicity. Common multiplicities are: 25 LipNi Services

Aggregation : Aggregation Aggregation is a special form of association. Aggregation is the composition of an object out of a set of parts. A car, for example, is an aggregation of tires, engine, steering wheel, brakes and so on. These parts may in turn be aggregations: a brake consists of disk, pads, hydraulic, etc. Aggregation represents a “has” relationship: a car has an engine. Instead of aggregation, some people talk about “whole-part” hierarchy. Enterprise represents a “whole” end and Department represents a “part” end. 26 LipNi Services

Inheritance : Inheritance Inheritance is the property whereby one class extends another class by including additional methods and/or variables. The original class is called the superclass of the extending class, and the extending class is called the subclass of the class that is extended. Since a subclass contains all of the data and methods of the superclass plus additional resources, it is more specific. Conversely, since the superclass lacks some of the resources of the subclass, it is more general or abstract, than its subclasses 27 LipNi Services

Inheritance: Example : Inheritance: Example Example, where Circle and Rectangle inherit from GeomFigure and own all attributes and methods from GeomFigure. 28 LipNi Services

Interface : Interface Interface classes are abstract definitions of purely functional interfaces. They DO NOT define any attributes or associations. An interface can not instantiate any object instances. They only define a set of abstract operations. They often define pre-conditions, post-conditions, invariants and possible exceptions for these operations. Example the String class implements the interface Sortable. Note that isEqual() in the interface Sortable do not have method implemented, but String must have its implementation on isEqual() since it is defined to implement Sortable. 29 LipNi Services

Event and Listener : Event and Listener An event listener is an object to which a component has delegated the task of handling a particular kind of event. In other words, if you want an object in your program to respond to another object which is generating events, you must register your object with the event generating object, and then handle the generated events when the come. 30 LipNi Services

Example : Example JButton is a kind of event source component. When the event is activated, it will notify ActionListener to handle it. The EventHandler is a ActionListener responsible for the event. 31 LipNi Services

Object Communication : Object Communication Communication between objects is achieved by exchanging messages These messages lead to the operations, which means that an object understands precisely those messages for which it has operations. Message Exchange in Classes 32 LipNi Services

Polymorphism : Polymorphism Polymorphism indicates the meaning of “many form.” In object-oriented design, polymorphism present a method can has many definitions (forms). Polymorphism is related to Overloading Overriding. Overloading indicates a method can have different definitions by defining different type of parameter, for example  getPrice(): void getprice(String name): void   getPrice() has two different forms – is the same meaning of different definitions. 33 LipNi Services

Polymorphism: Overriding : Polymorphism: Overriding Overriding indicates that subclass and parentclass have the same methods, parameters and return types (namely to redefine the methods in parentclass). 34 LipNi Services

Polymorphism: Example : Polymorphism: Example encrypt(String) method has three definitions, distribute in subclass and parentclass. Document object claims Encryption object to assist ecryption. In its encryString() method, it doesn’t indicate RSAEncryption or DesEncryption is the encryption actor, just only send a message to Encryption object: EncryptString(Encryption e) {    result = e.encrypt(source);    … } 35 LipNi Services

UML: Unified Modeling Language : UML: Unified Modeling Language The Unified Modeling Language was originally developed at Rational Software but is now administered by the Object Management Group. It is a modeling syntax aimed primarily at creating models of software-based systems, but can be used in a number of areas. It is: 36 LipNi Services

UML: Unified Modeling Language : UML: Unified Modeling Language Syntax only - UML is just a language, it tells you what model elements and diagrams are available and the rules associated with them. It doesn't tell you what diagrams to create. Comprehensive - it can be used to model anything. It is designed to be user extended to fill any modeling requirement. Language independent - it doesn't matter what hi-level language is to be used in the code. Mapping into code is a matter for the case tool you use. Process independent - the process by which the models are created is separate from the definition of the language. You will need a process in addition to the use of UML itself. Well documented - the UML notation guide is available as a reference to all the syntax available in the language. 37 LipNi Services

UML Notations – A Summary : UML Notations – A Summary 38 LipNi Services

UML Notations – A Summary : UML Notations – A Summary 39 LipNi Services

Modeling Tools : Modeling Tools Rational Rose Except the Ration Rose, there are still many other UML modeling tools, such as:- ArgoUML Borland Together Rational XDE Eclipse Power Designer Visual Paradigm MagicDraw etc. 40 LipNi Services

Rational Rose : Modeling Tool : Rational Rose : Modeling Tool Rational Rose is a program that allows you to build models based on the Unified Modeling Language or more commonly known as the UML. You are able to create three diagrams in Rational Rose:- Use-case diagram Sequence diagram Class diagram. 41 LipNi Services

Thank You : Thank You Question ? You can reach me at dharmendra.giri@gmail.com Or Visit my BLOG http://SliceData.BlogSpot.com 42 LipNi Services

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no.:


Area code Number
Subject you are interested in:
Word verification: (Enter the text as in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
11 Members Recommend
64 Followers

Your Facebook Friends on WizIQ