Object Oriented Programming

Slides:



Advertisements
Similar presentations
AP Computer Science A – Healdsburg High School 1 Unit 3 - Classes and Objects - Example.
Advertisements

Computer Science Dept. Fall 2003 Object models Object models describe the system in terms of object classes An object class is an abstraction over a set.
Stéphane Ducasse2.1 OOP? What is OOP? Why? OOP in a nutshell.
Object-Oriented Analysis and Design
Objects and Classes First Programming Concepts. 14/10/2004Lecture 1a: Introduction 2 Fundamental Concepts object class method parameter data type.
Objects First with Java A Practical Introduction using BlueJ
OBJECT ORIENTED ANALYSIS & DESIGN Vassilka Kirova Department of Computer & Information Science NJIT.
Object-oriented Programming Concepts
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
Introduction to Programming. To gain a sound knowledge of programming principles To gain a sound knowledge of object- orientation To be able to critically.
CO320 Introduction to Object- Oriented Programming Michael Kölling 3.0.
5.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
1 Object Oriented Programming Development z By: Marc Conrad University of Luton z z Room: D104.
Object Oriented Software Development
Object Oriented Programming Development
BCS 2143 Introduction to Object Oriented and Software Development.
5.0 Objects First with Java A Practical Introduction using BlueJ Introduction to Computer Science I Instructor: Allyson Anderson.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
OBJECTS AND CLASSES CITS1001. Concepts for this lecture class; object; instance method; parameter; signature data type multiple instances; state method.
1 Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill Chapter 2: Object Basics Object-Oriented Systems Development Using the Unified Modeling.
Classes 1 COMPSCI 105 S Principles of Computer Science.
1 COMP 350: Object Oriented Analysis and Design Lecture 1Introduction References: Craig Larman Chapter 1.
Kal Bugrara, Ph.DSoftware Engineering Northeastern University Fundamentals Of Software Engineering Lecture V.
CSC 131 Fall 2006 Lecture # 6 Object-Oriented Concepts.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
5.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
Java Fundamentals Usman Ependi UBD
1 Object Oriented Programming Development z By: Marc Conrad University of Luton z z Room: D104.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Programming. To gain a sound knowledge of programming principles To gain a sound knowledge of object- orientation To be able to critically assess the.
Object Oriented Paradigm OOP’s. Problems with Structured Programming As programs grow ever larger and more complex, even the structured programming approach.
6.0 Objects First with Java A Practical Introduction using BlueJ David J. Barnes Michael Kölling.
Object Oriented Systems Design
UML Class & Object Diagram I
Object Oriented Programming Development
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.
Object Oriented Programming
Object-Oriented Programming Concepts
Cmpe 589 Spring 2006.
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING
Sachin Malhotra Saurabh Choudhary
JAVA By Waqas.
Objects as a programming concept
Objects and Classes CITS1001 week 1.
Objects First with Java A Practical Introduction using BlueJ
Concepts of Object Orientation
Objects as a programming concept
Programming in Java Sachin Malhotra, Chairperson, PGDM-IT, IMS Ghaziabad Saurabh Chaudhary, Dean, Academics, IMS Ghaziabad.
GENERAL OOPs CONCEPTS.
Object Oriented Concepts -I
OBJECT ORIENTED PROGRAMMING overview
OBJECT ORIENTED CONCEPTS
Objects First with Java A Practical Introduction using BlueJ
What is an object? An object represents an individual, identifiable item, unit, or entity, either real or abstract, with a well-defined role in the.
OOP vs Structured Programming
Teach A-Level Computer Science: Object-Oriented Programming in Python
Object Oriented Analysis and Design
Object-Oriented Programming
COS 260 DAY 2 Tony Gauvin.
Object-Oriented Programming
CIS601: Object-Oriented Programming in C++
Objects First with Java A Practical Introduction using BlueJ
Object-Oriented Programming
BCA-II Object Oriented Programming using C++
Objects First with Java A Practical Introduction using BlueJ
Chapter 22 Object-Oriented Systems Analysis and Design and UML
CS 2704 Object Oriented Software Design and Construction
Introduction to Object-Oriented Software Development
Chapter 20 Object-Oriented Concepts and Principles
Presentation transcript:

Object Oriented Programming Introduction

What is object-orientation all about? Principles and techniques for system modeling which: Aim to produce a model of a system manage complexity inherent in analysis, design, and implementation provide methodology for system development provide integrated view of hardware and software 2

How? “Using object-orientation as a base, we model a system as a number of objects that interacts.”

Object Oriented System (OOS) Modelling the system by representing a collection of objects in it Each object represents some part of the system that is independent of other parts The different objects can collaborate to perform a task Interaction between objects through messages

Is it any good? A system which is designed and modeled using an object-oriented technology is: Easy to understand Directly related to reality - reduces the semantic gap between reality and models Natural partitioning of the problem More flexible and resilient to change - allows local modification to models Systems can be developed more rapidly and at a lower cost

OO Programming

Object-oriented Programming What is OOP? OOP is a programming paradigm based on three simple core concepts: Classes: Are “types” of “things” that we can talk about. Objects: Are “instances” or examples of classes. Message passing: Objects interact with each other by passing messages to ask each other to carry out their methods (behaviours).

Why OO programming? Modularity - large software projects can be split up in smaller pieces. Reusability - Programs can be assembled from pre-written software components. Extensibility - New software components can be written or developed from existing ones.

Objects Objects are key-concept to understand object-oriented technology. Objects are entities of the real-world that may interact with their environments by performing services on demand. Examples of real-world objects: your Car, your Cell-phone, the coffee slot-machine. Each Iphone 5s cell-phone is an object and may execute some services.

What is an object? Tangible Things as a car, printer, ... Roles as employee, boss, ... Incidents as flight, overflow, ... Interactions as contract, sale, ... Specifications as colour, shape, …

what is an object? An object represents an individual, identifiable item, unit, or entity, either real or abstract, with a well-defined role in the problem domain. An object is anything to which a concept applies. An object is a “noun”

How to define an object? An object is defined by: Example Attributes (also called fields) Behaviour---what it can do? (also called methods) Example A man can be defined by: Attributes: name, age, job, address,..etc Behaviour: talk, walk, eat, work, study,...etc How to define a bird? A car? A flight?

Classes Objects of the real world may be classified into types: Cars, Cell-Phones, CD Players, etc. Objects of the same type have the same characteristics and are manufactured using the same blueprint. A class is a blueprint or prototype from which objects of the same type are created. A class describes a set of objects having the same characteristics and offering the same services.

Class A class represents a template for several objects and describes how these objects are structured internally Objects of the same class have the same definition both for their operations and their information structure Classes are types of things

Class vs. Object Class People Class Vehicle Class Car John , George, Sara are objects that can be instantiated from the people class Class Vehicle Bus, car, train are objects (instances of the vehicle class) Class Car The blue Nissan, the red Vauxhall, my uncle’s car are objects (instances of the car class)

Class vs. Object (cont.) Find a class to represent the following items: dog, cat, lion, tiger chair, table, wardrobe banana, orange, apple breakfast, lunch, dinner Provide examples of objects that can be instantiated from the following classes Students, Courses, Modules

Instance An instance is an object created from a class A class describes the behavior and information structure of an instance, while the current state of the instance is defined by the operations performed on the instance System’s behavior is performed via the interactions between instances

Object-oriented Basics Fields/attributes Classes define fields (e.g. a Person class could contain fields name, age, sex, etc.) Objects have attributes, which are values stored in fields (e.g. person_1 has attributes “John Smith”, 25, Male) An object’s state is defined by its attributes Methods Classes define methods, which can access or change attributes Objects communicate by calling (invoking) each others’ methods Parameters Methods can have parameters to pass additional information during execution 18

Summary – OO Basics Fundamental concepts Objects Classes Object, Class, Field/attribute, Method, Parameter Objects Represent “things” from the real world, or from some problem domain (e.g. “the red car in the car park”) Classes Objects are created from classes Represent all objects of a kind (e.g. all “cars”) 19