Object-oriented perspective

Similar documents
Underlying computer system = hardware + software

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

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

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

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

Goals of the Lecture OO Programming Principles

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction

Introduction. Object-Oriented Programming Spring 2015

Software Development. Modular Design and Algorithm Analysis

Object Oriented Programming with c++ Question Bank

Lecture 1. Abstraction

CPS 506 Comparative Programming Languages. Programming Language

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

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language

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

Software Architectures. Lecture 6 (part 1)

Concepts of Programming Languages

Object-Oriented Design

Introduction and Review of Java: Part 2

Inheritance and Encapsulation. Amit Gupta

Chapter 13 Object Oriented Programming. Copyright 2006 The McGraw-Hill Companies, Inc.

CHAPTER 5 GENERAL OOP CONCEPTS

Object-Oriented Design

Object Oriented Programming

5. (a) What is secondary storage? How does it differ from a primary storage? (b) Explain the functions of (i) cache memory (ii) Register

On to OO design ideas. Really just an introduction (much more in CS 48) About programming in the large

Topic 3 Unified Modeling Language UML. Objective: Student will use UML to represent relationshiops between objects, its structure and dynamics.

Chapter3: Introduction to Classes and Objects

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

CGS 2405 Advanced Programming with C++ Course Justification

SDC Design patterns GoF

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

Expanding Our Horizons. CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 9 09/25/2011

C++ Important Questions with Answers

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

Elementary Concepts of Object Class

Software Architecture. Lecture 5

JAVA: A Primer. By: Amrita Rajagopal

Software Architecture

Principles of Programming Languages, 2

Objectives. Architectural Design. Software architecture. Topics covered. Architectural design. Advantages of explicit architecture

5/9/2014. Recall the design process. Lecture 1. Establishing the overall structureof a software system. Topics covered

Chapter 1: Principles of Programming and Software Engineering

B.C.A 2017 OBJECT ORIENTED PROGRAMMING USING C++ BCA303T MODULE SPECIFICATION SHEET

Java Object Oriented Design. CSC207 Fall 2014

Oops known as object-oriented programming language system is the main feature of C# which further support the major features of oops including:

CS200: Advanced OO in Java

(Team Name) (Project Title) Software Design Document. Student Name (s):

Objects as Session-Typed Processes

Objects and Classes Lecture 1

Lecture 2: Software Engineering (a review)

The Road to Object Orientation Operating Systems Object Planes. Object Planes. David Chisnall. March 25, 2010

OO-Design. Steven R. Bagley

Object-Oriented Programming

Object Model. Object Orientated Analysis and Design. Benjamin Kenwright

What is an algorithm?

Lecturer: William W.Y. Hsu. Programming Languages

Architectural Design

1005ICT Object Oriented Programming Lecture Notes

2.4 Structuring programs

CHAPTER 9 DESIGN ENGINEERING. Overview

Object-Oriented Introduction

CS-XXX: Graduate Programming Languages. Lecture 22 Class-Based Object-Oriented Programming. Dan Grossman 2012

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

Programming II. Modularity 2017/18

Object-Oriented Programming Fall Robert Grimm, New York University

Programmazione. Prof. Marco Bertini

Classes and Objects. Object Orientated Analysis and Design. Benjamin Kenwright

What are the characteristics of Object Oriented programming language?

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D.

Multi-Paradigm Approach for Teaching Programming

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING

COLLEGE OF THE DESERT

STUDENT LESSON A20 Inheritance, Polymorphism, and Abstract Classes

INHERITANCE: EXTENDING CLASSES

Object-Oriented Technology. Rick Mercer

An Introduction to Object-Oriented Programming

Chapter 1: Programming Principles

REVIEW AND OUTLOOKS OF THE MEANS FOR VISUALIZATION OF SYNTAX SEMANTICS AND SOURCE CODE. PROCEDURAL AND OBJECT ORIENTED PARADIGM DIFFERENCES

Introduction to Object Oriented Analysis and Design

A Guide to CMS Functions

EPL 603 TOPICS IN SOFTWARE ENGINEERING. Lab 6: Design Patterns

OOPS Viva Questions. Object is termed as an instance of a class, and it has its own state, behavior and identity.

Component-based Architecture Buy, don t build Fred Broks

ICS 52: Introduction to Software Engineering

Introduction to OOP. Procedural Programming sequence of statements to solve a problem.

ICS 52: Introduction to Software Engineering

Programming Methods. Simple things should be simple, complex things should be possible.

Cheng, CSE870. More Frameworks. Overview. Recap on OOP. Acknowledgements:

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

In this Lecture you will Learn: Design Patterns. Patterns vs. Frameworks. Patterns vs. Frameworks

WELCOME! (download slides and.py files and follow along!) LECTURE 1

Patterns and Testing

Seth Jai Parkash Polytechnic, Damla

CMPT Data and Program Organization

Accessibility. EEC 521: Software Engineering. Classes and Objects. Inheritance. Classes and Objects (OO Analysis)

Chapter 9 :: Data Abstraction and Object Orientation

IT101. Inheritance, Encapsulation, Polymorphism and Constructors

Data Structures (INE2011)

Object-oriented Compiler Construction

Transcription:

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 Include things Stack, queue, list, Window, spaceship, recipe, l Also include concepts Power, trajectory, mood, l Can represent people, places, roles, l In programming: an object is a software entity encapsulating data and/or methods

Imperative programming (not OOP) l Data, and the operations that manage the data are separate entities (physically and logically) l What are implications of this programming style?

Kay s Description of OOP 1. Everything is an object. 2. Objects perform computations by making requests of each other through the passing of messages. 3. Every object has its own memory, which consists of other objects. 4. Every object is an instance of a class. A class groups similar objects. 5. The class is the repository for behavior associated with an object. 6. Classes are organized into a singly-rooted tree structure, called an inheritance hierarchy. Alan Kay: Simple things should be simple, complex things should be possible.

Solving problems with objects l First decide what objects are needed Instead of what functions are required And instead of how specifically to handle data l Then give each object responsibilities Which probably include storing some data and performing some functions l Finally, have objects interact by sending messages (usually method calls) to one another i.e., they collaborate to fulfill responsibilities

T. Budd s real life example l Chris decides to send flowers to his friend Robin l First he selects an agent: Fred, a capable florist Then he sends a message to Fred not unlike: fred.sendbouquet(1, &robin); l The next step is Fred s responsibility Chris does not participate in this part of the process Likely that many other agents do participate though! l Finally Fred probably sends a message to Chris: chris.pay(bouquetprice, this);

Elements of OOP - Objects l 1. Everything is an object Actions in OOP are performed by agents, called instances or objects. l Several agents in the example scenario, including Chris, Robin, Fred, the florist in Robin s city, driver, flower arranger, grower Each agent has a part to play, and the result is produced when all work together in the solution of a problem.

Elements of OOP - Messages l 2. Objects perform computations by making requests of each other through the passing of messages. Actions in OOP are produced in response to requests for actions, called messages. An instance may accept a message, and in return will perform an action and return a value. l To begin the process of sending the flowers, Chris gives a message to Fred. She in turn gives a message to the florist in Robin s city, who gives another message to the driver, and so on.

Information hiding l Notice how a user of a service being provided by an object, need only know the name of the messages that the object will accept. They need not have any idea how the actions performed in response to these requests will be carried out. l Having accepted a message, an object is responsible for carrying it out.

Receivers and behavior l l Messages differ from traditional function calls in two very important respects: a) A designated receiver accepts the message b) The interpretation of the message may be different, depending upon the receiver Although different objects may accept the same message, the actions (behavior) the object will perform will likely be different Might not even know what behavior to perform until run-time a form of late binding

Elements of OOP Recursive Design l 3. Every object has its own memory, which consists of other objects. The structure of the part mirrors the structure of the larger unit. l Principle of non-interference: Ask not what you can do to your data structures, but ask what your data structures can do for you. (Timothy Budd)

Elements of OOP - Classes l 4. Every object is an instance of a class. A class groups similar objects. Fred is an instance of the class Florist l 5. The class is the repository for behavior associated with an object. All objects that are instances of a class use the same method in response to similar messages.

Elements of OOP - Inheritance l 6. Classes are organized into a singly-rooted tree structure, called an inheritance hierarchy l Data and general behavior at one abstraction level extend to lower levels But can override behavior (a later topic)

Levels of abstraction 1 l Communities of interacting objects Internally: within the program system And externally: team of programmers, each responsible for different parts of the system l Focus here is on communication at the highest level of abstraction i.e., lines of communication between the agents

Packages and Namespaces l Used to surround a collection of objects (a small community in itself) with a layer l To control visibility from outside the module A form of information hiding promotes low coupling, and thus modifiability, reuse potential, and so on

Levels of abstraction 2 l Clients and servers abstraction about the relationship between two individual objects Typically one is providing a service, and the other is using the service l Note: not specifically web servers/clients a more general idea about interacting objects

Levels of abstraction 3, 4, l 3. Describing services Focus is on a server Independent of clients i.e., defining the interface l 4. Implementing the interface from point of serving the client(s) l Implementing individual functions, and other background features about which the clients have no need to know

Finding the right abstraction level l A critical problem to solve in early stages of development not easy, and no right way Must determine what details are appropriate at each level of abstraction And (often more importantly) must decide what details should be omitted to be considered later l Don t want to ignore important information But don t want to manage too much information, or have excessive information hide critical details