What is an Object Objects are key to understanding object-oriented technology. An object can be considered a "thing" that can perform a set of related.

Slides:



Advertisements
Similar presentations
By Waqas Over the many years the people have studied software-development approaches to figure out which approaches are quickest, cheapest, most.
Advertisements

When is Orientated Programming NOT? Mike Fitzpatrick.
Department of Computer Engineering Faculty of Engineering, Prince of Songkla University 1 5 – Abstract Data Types.
1 OBJECT-ORIENTED CONCEPTS. 2 What is an object?  An object is a software entity that mirrors the real world in some way.  A software object in OOP.
BITS Pilani Avinash Gautam Department of Computer Science and Information Systems.
Classes & Objects Computer Science I Last updated 9/30/10.
Introduction to Object Oriented Programming Java.
OBJECT-ORIENTED PROGRAMMING CONCEPTS (Review). What is an Object? What is an Object? Objects have states and behaviors. Example: A dog has states - color,
INSTRUCTOR: SHIH-SHINH HUANG Windows Programming Using Java Chapter3: Introduction to Classes and Objects 1.
OOP & JAVA. HelloWorld.java /** * The HelloWorld class is an application that * displays "Hello World!" to the standard output. */ public class HelloWorld.
What is an object? Your dog, your desk, your television set, your bicycle. Real-world objects share two characteristics: They all have state and behavior;
Object-oriented Programming Concepts
Object Oriented Paradigm Programming Paradigms En Mohd Norafizal A.Aziz.
Java Objects and Classes. 3-2 Object Oriented Programming  An OO program models the application as a world of interacting objects.  A typical Java program.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
Chapter 4 Objects and Classes.
Introduction to Object-oriented programming and software development Lecture 1.
An Object-Oriented Approach to Programming Logic and Design
Object Oriented Programming Concepts Fatih University Ceng-104-A Introduction to Object Oriented Programming Harun Reşit Zafer This is a slide version.
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Object Oriented Programming Principles Lecturer: Kalamullah Ramli Electrical Engineering Dept. University of Indonesia Session-3.
SNPL1 Woochang Lim What (Variable) + How (Function) = Object Objects are the physical and conceptual things we find in the universe around us. Object-Oriented.
Prepared by: Elsy Torres Shajida Berry Siobhan Westby.
Object Oriented Programming Concepts. Object ► An object is a software bundle of related state and behavior. ► Software objects are often used to model.
Learners Support Publications Object Oriented Programming.
Abstraction ADTs, Information Hiding and Encapsulation.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
 Objects versus Class  Three main concepts of OOP ◦ Encapsulation ◦ Inheritance ◦ Polymorphism  Method ◦ Parameterized ◦ Value-Returning.
Ihsan Ayyub Qazi Introduction to Computer Programming Recitation 3 Ihsan Ayyub Qazi.
OOP (Object Oriented Programming) Lecture 1. Why a new paradigm is needed? Complexity Five attributes of complex systems –Frequently, complexity takes.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
By : Robert Apeldorn. What is OOP?  Object-oriented programming is a programming paradigm that uses “objects” to design applications and computer programs.
Java Inheritance in Java. Inheritance Inheritance is a mechanism in which one object acquires all the properties and behaviors of parent object. The idea.
Author: DoanNX Time: 45’.  OOP concepts  OOP in Java.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (2/2)
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
Industrial Group Project Introduction to Object Oriented Programming Adelina Basholli, February, 2016.
Welcome to OBJECT ORIENTED PROGRAMMING Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand.
Object means a real word entity such as pen, chair, table etc. Object-Oriented Programming is a methodology or paradigm to design a program using classes.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
 The Object Oriented concepts was evolved for solving complex problems. Object- oriented software development started in the 1980s. Object-oriented design.
Object-Oriented Programming
Object-Oriented programming for Beginners LEAPS Computing 2015
OOP - Object Oriented Programming
CompSci 280 S Introduction to Software Development
Programming paradigms
Object-Orientated Programming
Object Oriented Programming
Object-Oriented Programming Concepts
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING
Sachin Malhotra Saurabh Choudhary
Concepts of Object Oriented Programming
JAVA By Waqas.
University of Central Florida COP 3330 Object Oriented Programming
CHAPTER 5 GENERAL OOP CONCEPTS.
Classes and OOP.
Programming in Java Sachin Malhotra, Chairperson, PGDM-IT, IMS Ghaziabad Saurabh Chaudhary, Dean, Academics, IMS Ghaziabad.
OOP What is problem? Solution? OOP
Object Oriented Programming
University of Central Florida COP 3330 Object Oriented Programming
03/10/14 Chapter 9 Inheritance.
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
PRINCIPALES OF OBJECT ORIENTED PROGRAMMING
OBJECT ORIENTED CONCEPTS
البرمجة الكينونية بلغة جافا 1294
Object oriented vs procedural programming
Basic OOP Concepts and Terms
Object-Oriented Programming
Presentation transcript:

What is an Object Objects are key to understanding object-oriented technology. An object can be considered a "thing" that can perform a set of related activities. In pure OOP terms an object is an instance of a class.

Real World Objects Real-world objects share two characteristics. They all have state and behavior. Objects State Behavior Let’s take an Example of a “Dog”

Example : A “Dog” Object Dog have a State and as well as Behavior. Dog’s States are : Name Color Height Weight Dog’s Behaviors are : Walking, Eating, Barking

Software Engineering Objects Software objects are conceptually similar to real-world objects. An object stores its State in Fields (Variables) and exposes its Behavior through Methods (Functions). Methods operate on an object's internal state and serve as the primary mechanism for object-to-object communication.

Software Engineering Object

Bicycle Object By attributing State (current speed, current pedal cadence, and current gear) and providing Methods for changing that state. For example, if the bicycle only has 6 gears, a method to change gears could reject any value that is less than 1 or greater than 6.

What is a Class In the real world, you'll often find many individual objects all of the same kind. There may be thousands of other bicycles in existence, all of the same make and model. Each bicycle was built from the same set of blueprints and therefore contains the same components. A Class is the Blueprint from which the individual objects are created

Example for a Class class Bicycle { int speed = 0; //Fields (Varibales) int gear = 1; //Fields (Varibales) void changeGear(int newValue) { gear = newValue; } void speedUp(int increment) { speed = speed + increment; Expose the Behavior through the Methods void printStates() { System.out.println (“ speed:" + speed + " gear:" + gear); }

class BicycleDemo { public static void main(String[] args) { // Create two different Bicycle objects Bicycle bike1 = new Bicycle(); Bicycle bike2 = new Bicycle(); // Invoke methods on those objects bike1.speedUp(10); bike1.changeGear(2); bike1.printStates(); bike2.speedUp(10); bike2.changeGear(2); bike2.printStates(); }

Four Main OOP Concepts For build a Software System it need many Objects and Classes. It is like a big organization with thousands of employees. So to reduce the complexity OOP use several techniques, which can be group under four main concepts. Inheritance Encapsulation Polymorphism Abstraction

Inheritance Allow Classes to inherit commonly used State and Behavior from other Classes. Ability to create a new class from an existing class by extending it.

Encapsulation A class is kind of a container or capsule or a cell, which encapsulate a set of methods, attribute and properties to provide its indented functionalities to other classes. That idea of encapsulation is to hide how a class does its business, while allowing other classes to make requests of it.

Polymorphism It is a ability of an object to take on many forms. In OOP Polymorphism is archive by using many different techniques named Overriding, Overloading.

Abstraction Abstraction is the process of refining away all the unneeded/unimportant attributes of an object and keep only the characteristics best suitable for your domain. E.g. for a person: you decide to keep first and last name and SSN. Age, height, weight etc are ignored as irrelevant. Abstraction is where your design starts.

Modularization  One of the most prominent problems in software engineering has been how to program large and complex pieces of software. Often, large projects involve hundreds of programmers working on millions of lines of code. In this kind of environment, it is easy to lose track of what particular code does, or to produce code that must be rewritten elsewhere. To avoid such poor-planning scenarios, computer scientists began to organize around the concept of "modularization," which means to break up and organize code based on the task it executes. In this way, code becomes reusable and easier to debug and manage.

Modular programming is the process of subdividing a computer program into separate sub-programs. A module is a separate software component. It can often be used in a variety of applications and functions with other components of the system. Similar functions are grouped in the same unit of programming code and separate functions are developed as separate units of code so that the code can be reused by other applications. Object-oriented programming (OOP) is compatible with the modular programming concept to a large extent. Modular programming enables multiple programmers to divide up the work and debug pieces of the program independently.