Fundamental Concepts (Principles) of Object Oriented Programming These slides are based on:

Size: px
Start display at page:

Download "Fundamental Concepts (Principles) of Object Oriented Programming These slides are based on:"

Transcription

1 1 Fundamental Concepts (Principles) of Object Oriented Programming These slides are based on: [1] Timothy A. Budd, Oregon State University, Corvallis, Oregon, [Available] ClickMe, September 2001.

2 2 What is Object Oriented Programming? OOP was invented to mitigate the increasing complexity of software trying to make software simpler and more manageable. The Object Oriented approach is to view software the same way we view the world easier for us to understand. OOP is a way of thinking about how to create computer programs to solve problems Everything is an object, and objects communicate between each other and collaborate to implement tasks. Consider how we might go about handling a real-world situation and then ask how we could design software to do the same.

3 3 Illustration Of OO Concepts Sending Flowers to a Friend Consider the problem of sending flowers to a friend who lives in a different city. Chris is sending flowers to Robin. Chris can t deliver them directly. So Chris uses the services of the local Florist. Chris tells the Florist (named Fred) Robin s address, how much to spend, and the type of flowers to send. Fred contacts a florist in Robin s city, who arranges the flowers, then contacts a driver, who delivers the flowers.

4 4 Community of Agents (Objects) Helping Deliver Flowers Chris Fred:Florist Robin sflorist :Wholesaler :Grower :Gardener Robin :DeliveryPerson :FlowerArranger UML Instance Diagram

5 5 Object Interaction An object oriented program is structured as a community of interacting agents, called objects. Each object has a role to play. Each object provides a service, or performs an action, that is used by other members of the community.

6 6 Messages and Methods The chain reaction that ultimately resulted in the solution to Chris s problem began with a request given to the florist Fred. This request lead to other requests, which lead to still more requests, until the flowers ultimately reached Chris s friend Robin.

7 Messages and Methods Action is initiated in by the transmission of a message to an agent (an object). The message encodes the request for an action and may be accompanied by any additional information (arguments) needed to carry out the request. If the receiver accepts the message, it accepts the responsibility to carry out the indicated action. In response to a message, the receiver will perform some method to satisfy the request. 7

8 8 Object Protocol Each agent has responsibilities that it can do requests that it can fill out Set of responsibilities is called the object s protocol. An object s protocol is the set of methods (responsibilities and behavior) it can do and knows how to do, and the set of responses it can and will send back to the requestor in response to a request to perform a behavior.

9 Information Hiding and 9 Abstraction A receiving agent does not need to advertise or inform the requesting agent how the request will be implemented For example, Fred will not tell Chris how he intends to deliver the flowers, and whether there will be intermediaries involved, horse and buggy, planes, etc. This gives Fred flexibility to implement his methods without the interference from Chris. This results in simpler systems because there is less coupling between objects. Chris s world is simpler because he does not take on the burden on worrying how the request will be implemented. Fred s world is simpler because he does not need to follow Chris s view of how a request should be implemented, if Chris were to specify one.

10 10 Polymorphism A receiving agent can implement a request differently. For example, on one hand, Fred may implement Chris delivery request by sending a message to Robin s florist. On the other hand, Robin s florist, may send a message to the delivery person to send the flowers to Robin. Furthermore, perhaps Fred has multiple ways of implementing the same delivery request, and he chooses the best one according to the situation. This gives Fred flexibility to implement his methods in his own optimal way. It may be too expensive for Fred to deliver the flowers directly to Robin; it could be more efficient to contract Robin s florist to do so. If the flowers were to be delivered to a destination near Fred s business, then Fred may choose to deliver the flowers himself by car/bicycle. Different receiving agents may implement a request in different ways.

11 11 Reusable Components If there is a task to perform, the first thought of the client is to find somebody else he or she can ask to do the work. For example, Fred may not know an efficient way of delivering the flowers to a foreign country. Instead of learning how to do this, Fred will choose to rely on the experience of others who have been doing this in the past and are very efficient at it. Instead of the client inventing the method to do the work, it is natural to look for some other object that can do the work, that has the experience in doing it, and is trusted to do it properly. This concept is one of Building on the Experience of Others When reusable components are used, the software becomes more reliable, less complex for the individual agents, and quicker to develop.

12 12 Classes of Objects Agents of the same type are similar, and they may be classified as a class Although Chris has only dealt with Fred a few times, Chris has a rough idea of the transaction that will occur inside Fred's flower shop. Chris is able to make certain assumptions based on previous experience with other florists, and hence Chris can expect that Fred, being an instance of this category, will fit the general pattern. Other Florists, like Jane, Samantha, and Fernando Other Gardeners, etc. Class for Florists, Gardeners, Delivery Person, etc.

13 13 Inheritance Hierarchy Each class can be organized into a hierarchy Chris knows, for example, that a transfer of money will be part of the transaction, and that in return for payment Fred will offer a receipt. These actions are true of grocers, stationers, and other shopkeepers. Fred is a Florist, Florist is Shopkeeper, Shopkeeper is a Human, Human is a Mammal, Mammal is an Animal, Animal is a Material Object. Classes inherit properties of upper layer classes

14 Categories Surrounding Fred MaterialObject Animal Mammal Human Shopkeeper Florist Non-standard Diagram UML Class Diagram (Showing Inheritance) 14

15 15 A Class Inheritance Hierarchy UML Class Diagram MaterialObject Animal Plant Mammal Flower Dog Human Platypus Carnation Shopkeeper Artist Dentist Florist Potter

16 16 Principles of Object-oriented (OO) Programming 1. Everything is an object An object-oriented program is structured as a community of interacting agents, called objects. Each object has a set of responsibilities (behavior), a set of things it can do. Each object has a role to play and provides a service, or performs an action, that is used by other members of the community.

17 17 Principles of Object-oriented (OO) Programming 2. Objects send messages (requests) to one another Action is initiated in object-oriented programming by sending a message to an object responsible for the action. Messages are usually implemented as methods, a way in which a request is implemented. Additional information is encoded in the argument list of the method, if required. In response, the receiver will perform some method to satisfy the request.

18 18 Principles of Object-oriented (OO) Programming 3. All objects are instances of a class Objects of similar type are grouped into a class Objects within the same class will implement methods in the same way, and they will also have the same set of features (variables)

19 19 Principles of Object-oriented (OO) Programming 4. Encapsulation Encapsulation is the packing of state (variables) and behavior (methods) into a single component (object). An object should have full control over its state and how it implements its behavior. It enforce protecting variables, functions from outside of class. Everything that belongs to objects of a certain class should be included in the class, and everything else should be left out.

20 20 Principles of Object-oriented (OO) Programming 5. Information Hiding and Abstraction The implementation of an object s methods are hidden from external view This means the system will be more flexible for change and optimization, and will also be simpler, because there will be less coupling between classes.

21 21 Principles of Object-oriented (OO) Programming 6. Class Hierarchies Classes may be organized in an inheritance hierarchy, where higher layers contain more general information and lower layers contain more specific information about the class. Lower layer classes in the hierarchy inherit properties of higher layer classes in the hierarchy.

22 Principles of Object-oriented (OO) Programming 7. Method Binding The search for a method to invoke in response to a given message begins with the class of the receiver. If no appropriate method is found, the search is conducted in the parent class of this class. The search continues up the parent class chain until either a method is found and executed If a method is not found, an error message is issued. 22

23 23 Principles of Object-oriented (OO) Programming 8. Reuse and Reusable Components Reusing components increases reliability and quality. Building on the experience of others. Some characteristics that make software more easily reusable are modularity, loose coupling, high cohesion, information hiding and separation of concerns.

24 24 Principles of Object-oriented (OO) Programming 9. Polymorphism Different receiving agents may implement a request in different ways. This gives objects flexibility to implement methods in their own optimal way.

Introduction and Review of Java: Part 2

Introduction and Review of Java: Part 2 Introduction and Review of Java: Part 2 Fundamental Concepts (Principles) of Object Oriented Programming Java s implementation of Object Oriented Programming 1of 59 WHAT IS OBJECT ORIENTED PROGRAMMING?

More information

Object-oriented perspective

Object-oriented perspective Starting Reader #2 Object-oriented perspective Operating system = computer interface Shell/libraries/system calls = OS interface Will return to OS topics in upcoming lectures. Now: OO intro. Objects l

More information

CITS2210. Object-Oriented Programming. Topic 1. Introduction and Fundamentals: Thinking Object-Oriented

CITS2210. Object-Oriented Programming. Topic 1. Introduction and Fundamentals: Thinking Object-Oriented CITS2210 Object-Oriented Programming Topic 1. Introduction and Fundamentals: Thinking Object-Oriented Summary: This topic considers the fundamental concepts behind object orientation, and why they are

More information

Object Oriented Programming עזאם מרעי המחלקה למדעי המחשב אוניברסיטת בן-גוריון

Object Oriented Programming עזאם מרעי המחלקה למדעי המחשב אוניברסיטת בן-גוריון Object Oriented Programming עזאם מרעי המחלקה למדעי המחשב אוניברסיטת בן-גוריון 2 General Information Instructor: Azzam Maraee Office: building 37, room 205 Email: mari@cs.bgu.ac.il Course WEB site: http://www.cs.bgu.ac.il/~oosd142/

More information

CHAPTER 5 GENERAL OOP CONCEPTS

CHAPTER 5 GENERAL OOP CONCEPTS CHAPTER 5 GENERAL OOP CONCEPTS EVOLUTION OF SOFTWARE A PROGRAMMING LANGUAGE SHOULD SERVE 2 RELATED PURPOSES : 1. It should provide a vehicle for programmer to specify actions to be executed. 2. It should

More information

Object oriented programming Concepts

Object oriented programming Concepts Object oriented programming Concepts Naresh Proddaturi 09/10/2012 Naresh Proddaturi 1 Problems with Procedural language Data is accessible to all functions It views a program as a series of steps to be

More information

Chapter 5 Object-Oriented Programming

Chapter 5 Object-Oriented Programming Chapter 5 Object-Oriented Programming Develop code that implements tight encapsulation, loose coupling, and high cohesion Develop code that demonstrates the use of polymorphism Develop code that declares

More information

Object- Oriented Design with UML and Java Part I: Fundamentals

Object- Oriented Design with UML and Java Part I: Fundamentals Object- Oriented Design with UML and Java Part I: Fundamentals University of Colorado 1999-2002 CSCI-4448 - Object-Oriented Programming and Design These notes as free PDF files: http://www.softwarefederation.com/cs4448.html

More information

Elementary Concepts of Object Class

Elementary Concepts of Object Class Elementary Concepts of Object Class Modeling entities and their behaviour by objects. A class as a specification of objects and as an object factory, computation as message passing/function call between

More information

Object-Oriented Programming in C++/Handout 01 Page 1 of 8

Object-Oriented Programming in C++/Handout 01 Page 1 of 8 Object-Oriented Programming in C++/Handout 01 Page 1 of 8 Table of Contents Table of Contents... 1 Learning Objectives... 2 Object-Oriented Approach... 2 Advantages of Object-Oriented Approach... 2 Principles

More information

Chapter 8: Class and Method Design

Chapter 8: Class and Method Design Chapter 8: Class and Method Design Objectives Become familiar with coupling, cohesion, and connascence. Be able to specify, restructure, and optimize object designs. Be able to identify the reuse of predefined

More information

Programmazione. Prof. Marco Bertini

Programmazione. Prof. Marco Bertini Programmazione Prof. Marco Bertini marco.bertini@unifi.it http://www.micc.unifi.it/bertini/ Introduction Why OO Development? Improved structure of software easier to: Understand Maintain Enhance Reusable

More information

OBJECT ORIENTED SYSTEM DEVELOPMENT Software Development Dynamic System Development Information system solution Steps in System Development Analysis

OBJECT ORIENTED SYSTEM DEVELOPMENT Software Development Dynamic System Development Information system solution Steps in System Development Analysis UNIT I INTRODUCTION OBJECT ORIENTED SYSTEM DEVELOPMENT Software Development Dynamic System Development Information system solution Steps in System Development Analysis Design Implementation Testing Maintenance

More information

Underlying computer system = hardware + software

Underlying computer system = hardware + software Underlying computer system = hardware + software Thanks to Chandra Krintz and Kevin Sanft, for this figure and some other parts of these lecture notes. Processing data & instructions Program instructions

More information

Chapter 1: Programming Principles

Chapter 1: Programming Principles Chapter 1: Programming Principles Object Oriented Analysis and Design Abstraction and information hiding Object oriented programming principles Unified Modeling Language Software life-cycle models Key

More information

Goals of the Lecture OO Programming Principles

Goals of the Lecture OO Programming Principles Goals of the Lecture OO Programming Principles Object-Oriented Analysis and Design - Fall 1998 n Discuss OO Programming Principles Ð Messages Ð Information Hiding Ð Classes and Instances Ð Inheritance

More information

Chapter 1: Principles of Programming and Software Engineering

Chapter 1: Principles of Programming and Software Engineering Chapter 1: Principles of Programming and Software Engineering Data Abstraction & Problem Solving with C++ Fifth Edition by Frank M. Carrano Software Engineering and Object-Oriented Design Coding without

More information

1. Write two major differences between Object-oriented programming and procedural programming?

1. Write two major differences between Object-oriented programming and procedural programming? 1. Write two major differences between Object-oriented programming and procedural programming? A procedural program is written as a list of instructions, telling the computer, step-by-step, what to do:

More information

Object-Oriented Programming

Object-Oriented Programming Object-Oriented Programming CS420/520 Winter 2012 Prof Andrew P. Black 1 Administrivia Instructor: Andrew Black, 503 725 2411 (office) 503 803 1669 (cell). email: black@cs.pdx.edu, put [CS520] in subject

More information

Module Outline. What is Object-Oriented? Some Possible Definitions. Why Object-oriented? Fundamentals of Object Orientation

Module Outline. What is Object-Oriented? Some Possible Definitions. Why Object-oriented? Fundamentals of Object Orientation Module Outline Fundamentals of Object Positioning Object Oriented Analysis Fundamentals of Object 1. Encapsulation 2. Abstraction 3. Inheritance 4. Polymorphism The need of Modeling Unified modeling language

More information

What are the characteristics of Object Oriented programming language?

What are the characteristics of Object Oriented programming language? What are the various elements of OOP? Following are the various elements of OOP:- Class:- A class is a collection of data and the various operations that can be performed on that data. Object- This is

More information

Object Orientated Analysis and Design. Benjamin Kenwright

Object Orientated Analysis and Design. Benjamin Kenwright Notation Part 2 Object Orientated Analysis and Design Benjamin Kenwright Outline Review What do we mean by Notation and UML? Types of UML View Continue UML Diagram Types Conclusion and Discussion Summary

More information

Lecture 1. Abstraction

Lecture 1. Abstraction Lecture 1 Abstraction 1 Programming Techniques Unstructured Programming Procedural Programming Modular & Structural Programming Abstract Data Type Object-Oriented Programming 2 Unstructured Programming

More information

Software Development. Modular Design and Algorithm Analysis

Software Development. Modular Design and Algorithm Analysis Software Development Modular Design and Algorithm Analysis Data Encapsulation Encapsulation is the packing of data and functions into a single component. The features of encapsulation are supported using

More information

BASIC CONCEPT OF OOP

BASIC CONCEPT OF OOP Chapter-6 BASIC CONCEPT OF OOP Introduction: Object oriented programmingg is the principle of design and development of programs using modular approach. Object oriented programmingg approach provides advantages

More information

CSIT 2008 June 28, 2008 Anita Verno, Bergen Community College,

CSIT 2008 June 28, 2008 Anita Verno, Bergen Community College, CSIT 2008 June 28, 2008 Anita Verno, Bergen Community College, averno@bergen.edu Introducing OOD, An Example Design Methodologies Alphabet Soup: OOA, OOD, OOP Slides for an Introductory Lesson Why OOD?

More information

THE OBJECT-ORIENTED DESIGN PROCESS AND DESIGN AXIOMS (CH -9)

THE OBJECT-ORIENTED DESIGN PROCESS AND DESIGN AXIOMS (CH -9) THE OBJECT-ORIENTED DESIGN PROCESS AND DESIGN AXIOMS (CH -9) By: Mr.Prachet Bhuyan Assistant Professor, School of Computer Engineering, KIIT Topics to be Discussed 9.1 INTRODUCTION 9.2 THE O-O DESIGN PROCESS

More information

Client Code - the code that uses the classes under discussion. Coupling - code in one module depends on code in another module

Client Code - the code that uses the classes under discussion. Coupling - code in one module depends on code in another module Basic Class Design Goal of OOP: Reduce complexity of software development by keeping details, and especially changes to details, from spreading throughout the entire program. Actually, the same goal as

More information

Object Oriented Programming using C++

Object Oriented Programming using C++ Object Oriented Programming using C++ Programming Techniques Programming techniques evolved so far Modular programming Structured programming Top down programming Bottom up programming Procedure Oriented

More information

Software Design Heuristics

Software Design Heuristics Software Design Heuristics Software Design Heuristics CONTENT 1. Introduction 2. Encapsulation/Information Hiding 3. Strong Cohesion 4. Loose Dr. Samira Sadaoui 1 Introduction Introduction Software Design

More information

Object-Oriented Modeling Using UML. CS151 Chris Pollett Aug. 29, 2005.

Object-Oriented Modeling Using UML. CS151 Chris Pollett Aug. 29, 2005. Object-Oriented Modeling Using UML CS151 Chris Pollett Aug. 29, 2005. Outline Objects and Classes Modeling Relationships and Structures Some Terms and Concepts Objects and classes are fundamental to OO

More information

Inheritance (Outsource: )

Inheritance (Outsource: ) (Outsource: 9-12 9-14) is a way to form new classes using classes that have already been defined. The new classes, known as derived classes, inherit attributes and behavior of the pre-existing classes,

More information

Static and Dynamic Behavior לאוניד ברנבוים המחלקה למדעי המחשב אוניברסיטת בן-גוריון

Static and Dynamic Behavior לאוניד ברנבוים המחלקה למדעי המחשב אוניברסיטת בן-גוריון Static and Dynamic Behavior לאוניד ברנבוים המחלקה למדעי המחשב אוניברסיטת בן-גוריון 22 Roadmap In this chapter we will examine how differences in static and dynamic features effect object-oriented programming

More information

The Essence of Object Oriented Programming with Java and UML. Chapter 2. The Essence of Objects. What Is an Object-Oriented System?

The Essence of Object Oriented Programming with Java and UML. Chapter 2. The Essence of Objects. What Is an Object-Oriented System? Page 1 of 21 Page 2 of 21 and identity. Objects are members of a class, and the attributes and behavior of an object are defined by the class definition. The Essence of Object Oriented Programming with

More information

What is a Programming Paradigm

What is a Programming Paradigm INTRODUCTION This chapter begins with brief discussion of various Programming paradigms that C++ supports i.e., procedural programming style, object based programming style and object oriented programming

More information

Relationships amongst Objects

Relationships amongst Objects Relationships amongst Objects By Rick Mercer with help from Object-Oriented Design Heuristics Arthur Riel Addison-Wesley, 1996, ISBN 0-201-6338-X 8-1 Outline Consider six relationships between objects

More information

Computer Science 32 Object-Oriented Oriented Design and Implementation (in C++ on Linux)

Computer Science 32 Object-Oriented Oriented Design and Implementation (in C++ on Linux) Computer Science 32 Object-Oriented Oriented Design and Implementation (in C++ on Linux) Pre-requisite: CS 24 So already know much C++ including object-based fundamentals: classes and ADTs Also familiar

More information

Object Oriented Programming

Object Oriented Programming Binnur Kurt kurt@ce.itu.edu.tr Istanbul Technical University Computer Engineering Department 1 Version 0.1.2 About the Lecturer BSc İTÜ, Computer Engineering Department, 1995 MSc İTÜ, Computer Engineering

More information

The object-oriented approach goes a step further by providing tools for the programmer to represent elements in the problem space.

The object-oriented approach goes a step further by providing tools for the programmer to represent elements in the problem space. 1 All programming languages provide abstractions. Assembly language is a small abstraction of the underlying machine. Many imperative languages (FORTRAN, BASIC, and C) are abstractions of assembly language.

More information

RDD and Strategy Pa.ern

RDD and Strategy Pa.ern RDD and Strategy Pa.ern CSCI 3132 Summer 2011 1 OO So1ware Design The tradi7onal view of objects is that they are data with methods. Smart Data. But, it is be.er to think of them as en##es that have responsibili#es.

More information

Idioms and Design Patterns. Martin Skogevall IDE, Mälardalen University

Idioms and Design Patterns. Martin Skogevall IDE, Mälardalen University Idioms and Design Patterns Martin Skogevall IDE, Mälardalen University 2005-04-07 Acronyms Object Oriented Analysis and Design (OOAD) Object Oriented Programming (OOD Software Design Patterns (SDP) Gang

More information

2. Classes & Inheritance. Classes. Classes. Éric Tanter Objects and Design in Smalltalk. How do you create objects?

2. Classes & Inheritance. Classes. Classes. Éric Tanter Objects and Design in Smalltalk. How do you create objects? Objects and Design in Smalltalk 2. Classes & Inheritance Éric Tanter etanter@dcc.uchile.cl 1 Classes How do you create objects? Ex-nihilo in prototype-based languages With a class in class-based languages

More information

UML & OO FUNDAMENTALS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 3 08/30/2011

UML & OO FUNDAMENTALS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 3 08/30/2011 UML & OO FUNDAMENTALS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 3 08/30/2011 1 Goals of the Lecture Review the material in Chapter 2 of the Textbook Cover key parts of the UML notation

More information

Abstraction. Abstraction

Abstraction. Abstraction 9/11/2003 1 Software today is more complex than it has ever been. Software controls Space shuttle systems during launch Elevators in 100-story buildings Cross-Atlantic transportation routes of freighters

More information

Object-Oriented Programming Paradigm

Object-Oriented Programming Paradigm Object-Oriented Programming Paradigm Sample Courseware Object-Oriented Programming Paradigm Object-oriented programming approach allows programmers to write computer programs by representing elements of

More information

Lecture 2 and 3: Fundamental Object-Oriented Concepts Kenneth M. Anderson

Lecture 2 and 3: Fundamental Object-Oriented Concepts Kenneth M. Anderson Lecture 2 and 3: Fundamental Object-Oriented Concepts Kenneth M. Anderson January 13, 2005 January 18, 2005 1 of 38 Lecture Goals Introduce the basic concepts of object-oriented analysis/design/programming

More information

CSE 70 Final Exam Fall 2009

CSE 70 Final Exam Fall 2009 Signature cs70f Name Student ID CSE 70 Final Exam Fall 2009 Page 1 (10 points) Page 2 (16 points) Page 3 (22 points) Page 4 (13 points) Page 5 (15 points) Page 6 (20 points) Page 7 (9 points) Page 8 (15

More information

C++ Classes & Object Oriented Programming

C++ Classes & Object Oriented Programming C++ Classes & Object Oriented Programming What is it? Object Oriented Programming 1 Object Oriented Programming One of the first applications of modern computing was modeling and simulation. Scientists

More information

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia Object Oriented Programming in Java Jaanus Pöial, PhD Tallinn, Estonia Motivation for Object Oriented Programming Decrease complexity (use layers of abstraction, interfaces, modularity,...) Reuse existing

More information

Static and Dynamic Behavior עזאם מרעי המחלקה למדעי המחשב אוניברסיטת בן-גוריון מובסס על הרצאות של אותו קורס שניתן בשנים הקודמות ע "י ד"ר גרא וייס

Static and Dynamic Behavior עזאם מרעי המחלקה למדעי המחשב אוניברסיטת בן-גוריון מובסס על הרצאות של אותו קורס שניתן בשנים הקודמות ע י דר גרא וייס Static and Dynamic Behavior עזאם מרעי המחלקה למדעי המחשב אוניברסיטת בן-גוריון מובסס על הרצאות של אותו קורס שניתן בשנים הקודמות ע "י ד"ר גרא וייס 2 Roadmap In this chapter we will examine how differences

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecture 14: Design Workflow Department of Computer Engineering Sharif University of Technology 1 UP iterations and workflow Workflows Requirements Analysis Phases Inception Elaboration

More information

Modellistica Medica. Maria Grazia Pia, INFN Genova. Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico

Modellistica Medica. Maria Grazia Pia, INFN Genova. Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico Modellistica Medica Maria Grazia Pia INFN Genova Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico 2002-2003 Lezione 9 OO modeling Design Patterns Structural Patterns Behavioural Patterns

More information

Components vs. Objects

Components vs. Objects Components vs. Objects Luigia Petre Turku Centre for Computer Science & Abo Akademi University, FIN-20520 Turku, Finland (Presented at Nordic Workshop on Programming Theory, Bergen, Norway, Oct 11-13,

More information

What is Inheritance?

What is Inheritance? Inheritance 1 Agenda What is and Why Inheritance? How to derive a sub-class? Object class Constructor calling chain super keyword Overriding methods (most important) Hiding methods Hiding fields Type casting

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecturer: Raman Ramsin Lecture 10: Analysis Packages 1 Analysis Workflow: Packages The analysis workflow consists of the following activities: Architectural analysis Analyze a use

More information

An Introduction to Software Architecture By David Garlan & Mary Shaw 94

An Introduction to Software Architecture By David Garlan & Mary Shaw 94 IMPORTANT NOTICE TO STUDENTS These slides are NOT to be used as a replacement for student notes. These slides are sometimes vague and incomplete on purpose to spark a class discussion An Introduction to

More information

9.1 OO Methodology OO Design Object

9.1 OO Methodology OO Design Object 1 9.1 OO Methodology OO Design A problem-solving methodology that produces a solution to a problem in terms of self-contained entities called objects Object A thing or entity that makes sense within the

More information

More OO Fundamentals. CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 4 09/11/2012

More OO Fundamentals. CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 4 09/11/2012 More OO Fundamentals CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 4 09/11/2012 1 Goals of the Lecture Continue a review of fundamental object-oriented concepts 2 Overview of OO Fundamentals

More information

Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page:

Lecturer: Sebastian Coope Ashton Building, Room G.18   COMP 201 web-page: Lecturer: Sebastian Coope Ashton Building, Room G.18 E-mail: coopes@liverpool.ac.uk COMP 201 web-page: http://www.csc.liv.ac.uk/~coopes/comp201 Lecture 19 Essentials of Class Models 1 On Naming classes

More information

Part 7 - Object Oriented Concepts Classes, Objects, Properties and Methods

Part 7 - Object Oriented Concepts Classes, Objects, Properties and Methods Part 7 - Object Oriented Concepts Classes, Objects, Properties and Methods Object Orientated Paradigm... 2 Abstract Data Types (ADT) & Encapsulation... 3 Encapsulation... 5 Classes and Objects... 6 Methods

More information

CAS 703 Software Design

CAS 703 Software Design Dr. Ridha Khedri Department of Computing and Software, McMaster University Canada L8S 4L7, Hamilton, Ontario Other 1 2 3 4 Other Principle of Least Privilege Principle of Fail-Safe Defaults Principle of

More information

C++ & Object Oriented Programming Concepts The procedural programming is the standard approach used in many traditional computer languages such as BASIC, C, FORTRAN and PASCAL. The procedural programming

More information

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 2: Review of Object Orientation

Object-Oriented Software Engineering Practical Software Development using UML and Java. Chapter 2: Review of Object Orientation Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 2: Review of Object Orientation 2.1 What is Object Orientation? Procedural paradigm: Software is organized

More information

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe OBJECT ORIENTED PROGRAMMING USING C++ CSCI 5448- Object Oriented Analysis and Design By Manali Torpe Fundamentals of OOP Class Object Encapsulation Abstraction Inheritance Polymorphism Reusability C++

More information

Software Design and Analysis for Engineers

Software Design and Analysis for Engineers Software Design and Analysis for Engineers by Dr. Lesley Shannon Email: lshannon@ensc.sfu.ca Course Website: http://www.ensc.sfu.ca/~lshannon/courses/ensc251 Simon Fraser University Slide Set: 2 Date:

More information

Object Oriented Software Design

Object Oriented Software Design Object Oriented Software Design Introduction to Object Oriented Programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa September 23, 2010 G. Lipari (Scuola Superiore

More information

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University Day 4 COMP1006/1406 Summer 2016 M. Jason Hinek Carleton University today s agenda assignments questions about assignment 2 a quick look back constructors signatures and overloading encapsulation / information

More information

Classes, Objects, and OOP in Java. June 16, 2017

Classes, Objects, and OOP in Java. June 16, 2017 Classes, Objects, and OOP in Java June 16, 2017 Which is a Class in the below code? Mario itsame = new Mario( Red Hat? ); A. Mario B. itsame C. new D. Red Hat? Whats the difference? int vs. Integer A.

More information

Object-Oriented Programming in LotusScript Bill Buchan HADSL

Object-Oriented Programming in LotusScript Bill Buchan HADSL Object-Oriented Programming in LotusScript Bill Buchan HADSL 2006 Wellesley Information Services. All rights reserved. What We'll Cover Introduction Why use Object-Oriented (OO) methodologies? OO Basics

More information

What is Object-Oriented Programming

What is Object-Oriented Programming www.eazynotes.com Nikhil Tibdewal Page No. 1 What is Object-Oriented Programming Object-Oriented Programming (OOP) is different from procedural programming languages (C, Pascal etc.) in several ways. Everything

More information

Object Oriented Programming

Object Oriented Programming Object Oriented Programming Ray John Pamillo 1/27/2016 1 Nokia Solutions and Networks 2014 Outline: Brief History of OOP Why use OOP? OOP vs Procedural Programming What is OOP? Objects and Classes 4 Pillars

More information

Information Hiding and Aspect-Oriented Modeling

Information Hiding and Aspect-Oriented Modeling Information Hiding and Aspect-Oriented Modeling Wisam Al Abed and Jörg Kienzle School of Computer Science, McGill University Montreal, QC H3A2A7, Canada Wisam.Alabed@mail.mcgill.ca, Joerg.Kienzle@mcgill.ca

More information

CS504-Softwere Engineering -1 Solved Objective Midterm Papers For Preparation of Midterm Exam

CS504-Softwere Engineering -1 Solved Objective Midterm Papers For Preparation of Midterm Exam CS504-Softwere Engineering -1 Solved Objective Midterm Papers For Preparation of Midterm Exam MIDTERM EXAMINATION 2010 Question No: 1 ( Marks: 1 ) - Please choose one By following modern system engineering

More information

CGS 2405 Advanced Programming with C++ Course Justification

CGS 2405 Advanced Programming with C++ Course Justification Course Justification This course is the second C++ computer programming course in the Computer Science Associate in Arts degree program. This course is required for an Associate in Arts Computer Science

More information

Inheritance CSC 123 Fall 2018 Howard Rosenthal

Inheritance CSC 123 Fall 2018 Howard Rosenthal Inheritance CSC 123 Fall 2018 Howard Rosenthal Lesson Goals Defining what inheritance is and how it works Single Inheritance Is-a Relationship Class Hierarchies Syntax of Java Inheritance The super Reference

More information

Inheritance and Substitution גרא וייס המחלקה למדעי המחשב אוניברסיטת בן-גוריון

Inheritance and Substitution גרא וייס המחלקה למדעי המחשב אוניברסיטת בן-גוריון Inheritance and Substitution גרא וייס המחלקה למדעי המחשב אוניברסיטת בן-גוריון 2 Roadmap In this chapter we will start to investigate the concepts of inheritance and substitution: The intuitive and practical

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecturer: Raman Ramsin Lecture 9: Generalization/Specialization 1 Analysis Workflow: Analyze a Use Case The analysis workflow consists of the following activities: Architectural

More information

Example: Fibonacci Numbers

Example: Fibonacci Numbers Example: Fibonacci Numbers Write a program which determines F n, the (n + 1)-th Fibonacci number. The first 10 Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, and 34. The sequence of Fibonacci numbers

More information

Programming in C# Inheritance and Polymorphism

Programming in C# Inheritance and Polymorphism Programming in C# Inheritance and Polymorphism C# Classes Classes are used to accomplish: Modularity: Scope for global (static) methods Blueprints for generating objects or instances: Per instance data

More information

A STUDY OF OBJECT ORIENTED ANALYSIS AND DESIGN

A STUDY OF OBJECT ORIENTED ANALYSIS AND DESIGN A STUDY OF OBJECT ORIENTED ANALYSIS AND DESIGN GARJE RAKESH RAMESHRAO RESEARCH SCHOLAR, DEPT. OF COMPUTER SCIENCE CMJ UNIVERSITY, SHILLONG, MEGHALAYA INTRODUCTION Object-oriented Analysis and Design is

More information

Department of Computer science and Engineering Sub. Name: Object oriented programming and data structures Sub. Code: EC6301 Sem/Class: III/II-ECE Staff name: M.Kavipriya Two Mark Questions UNIT-1 1. List

More information

C++ Important Questions with Answers

C++ Important Questions with Answers 1. Name the operators that cannot be overloaded. sizeof,.,.*,.->, ::,? 2. What is inheritance? Inheritance is property such that a parent (or super) class passes the characteristics of itself to children

More information

An Overview of Visual Basic.NET: A History and a Demonstration

An Overview of Visual Basic.NET: A History and a Demonstration OVERVIEW o b j e c t i v e s This overview contains basic definitions and background information, including: A brief history of programming languages An introduction to the terminology used in object-oriented

More information

Introduction. Object-Oriented Programming Spring 2015

Introduction. Object-Oriented Programming Spring 2015 Introduction Object-Oriented Programming 236703 Spring 2015 1 Course Staff Lecturer in charge: Prof. Eran Yahav Lecturer: Eran Gilad TA in charge: Nurit Moscovici TAs: Helal Assi, Eliran Weiss 3 Course

More information

Programming II. Modularity 2017/18

Programming II. Modularity 2017/18 Programming II Modularity 2017/18 Module? Lecture Outline Evolution and history of programming languages Modularity Example History of Programming Programming Paradigms How and why languages develop? How

More information

Technical Metrics for OO Systems

Technical Metrics for OO Systems Technical Metrics for OO Systems 1 Last time: Metrics Non-technical: about process Technical: about product Size, complexity (cyclomatic, function points) How to use metrics Prioritize work Measure programmer

More information

Inheritance and Polymorphism

Inheritance and Polymorphism Object Oriented Programming Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. Al-Azhar University Website: eaymanelshenawy.wordpress.com Email : eaymanelshenawy@azhar.edu.eg

More information

Object-Oriented Technology. Rick Mercer

Object-Oriented Technology. Rick Mercer Object-Oriented Technology Rick Mercer 1 Object-Oriented Technology: Outline Consider a few ways in which data is protected from careless modification Mention the key features object-oriented style of

More information

JAVA: A Primer. By: Amrita Rajagopal

JAVA: A Primer. By: Amrita Rajagopal JAVA: A Primer By: Amrita Rajagopal 1 Some facts about JAVA JAVA is an Object Oriented Programming language (OOP) Everything in Java is an object application-- a Java program that executes independently

More information

1: Introduction to Object (1)

1: Introduction to Object (1) 1: Introduction to Object (1) 김동원 2003.01.20 Overview (1) The progress of abstraction Smalltalk Class & Object Interface The hidden implementation Reusing the implementation Inheritance: Reusing the interface

More information

Object Oriented Programming

Object Oriented Programming Object Oriented Programming Primary object-oriented language concepts dynamic lookup encapsulation inheritance subtyping Program organization Organize concepts into objects and relationships between them

More information

UML & OO Fundamentals. CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 3 09/04/2012

UML & OO Fundamentals. CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 3 09/04/2012 UML & OO Fundamentals CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 3 09/04/2012 1 Goals of the Lecture Review the material in Chapter 2 of the Textbook Cover key parts of the UML notation

More information

Object Oriented Paradigm

Object Oriented Paradigm Object Oriented Paradigm Ming-Hwa Wang, Ph.D. Department of Computer Engineering Santa Clara University Object Oriented Paradigm/Programming (OOP) similar to Lego, which kids build new toys from assembling

More information

Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page:

Lecturer: Sebastian Coope Ashton Building, Room G.18   COMP 201 web-page: Lecturer: Sebastian Coope Ashton Building, Room G.18 E-mail: coopes@liverpool.ac.uk COMP 201 web-page: http://www.csc.liv.ac.uk/~coopes/comp201 Lecture 17 Concepts of Object Oriented Design Object-Oriented

More information

C++ Programming: Introduction to C++ and OOP (Object Oriented Programming)

C++ Programming: Introduction to C++ and OOP (Object Oriented Programming) C++ Programming: Introduction to C++ and OOP (Object Oriented Programming) 2018 년도 2 학기 Instructor: Young-guk Ha Dept. of Computer Science & Engineering Contents Brief introduction to C++ OOP vs. Procedural

More information

OBJECT ORIENTED PROGRAMMING

OBJECT ORIENTED PROGRAMMING 1. Programming Paradigms OBJECT ORIENTED PROGRAMMING A programming methodology defines the methodology of designing and implementing programs using the key features and other building blocks (such as key

More information

Paytm Programming Sample paper: 1) A copy constructor is called. a. when an object is returned by value

Paytm Programming Sample paper: 1) A copy constructor is called. a. when an object is returned by value Paytm Programming Sample paper: 1) A copy constructor is called a. when an object is returned by value b. when an object is passed by value as an argument c. when compiler generates a temporary object

More information

Java OOP (SE Tutorials: Learning the Java Language Trail : Object-Oriented Programming Concepts Lesson )

Java OOP (SE Tutorials: Learning the Java Language Trail : Object-Oriented Programming Concepts Lesson ) Java OOP (SE Tutorials: Learning the Java Language Trail : Object-Oriented Programming Concepts Lesson ) Dongwon Jeong djeong@kunsan.ac.kr; http://ist.kunsan.ac.kr/ Information Sciences and Technology

More information

Appendix A - Glossary(of OO software term s)

Appendix A - Glossary(of OO software term s) Appendix A - Glossary(of OO software term s) Abstract Class A class that does not supply an implementation for its entire interface, and so consequently, cannot be instantiated. ActiveX Microsoft s component

More information

CS6301 PROGRAMMING AND DATA STRUCTURES II QUESTION BANK UNIT-I 2-marks ) Give some characteristics of procedure-oriented language. Emphasis is on doing things (algorithms). Larger programs are divided

More information