Stéphane Ducasse2.1 OOP? What is OOP? Why? OOP in a nutshell.

Slides:



Advertisements
Similar presentations
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Advertisements

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.
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.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall A.1.
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
Object-Oriented Analysis and Design
Chapter 1 Object-Oriented System Development
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
7M701 1 Software Engineering Object-oriented Design Sommerville, Ian (2001) Software Engineering, 6 th edition: Chapter 12 )
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
OBJECT ORIENTED ANALYSIS & DESIGN Vassilka Kirova Department of Computer & Information Science NJIT.
Stéphane Ducasse6.1 Essential Concepts Why OO? What is OO? What are the benefits? What are the KEY concepts? Basis for all the lectures.
Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 1 Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 Object-oriented concepts.
Object-oriented Programming Concepts
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix.
Software Lifecycle A series of steps through which a software product progresses Lifetimes vary from days to months to years Consists of –people –overall.
1 Introduction to C++ Programming Concept Basic C++ C++ Extension from C.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 1 Introduction to Object-Oriented Programming.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
BACS 287 Basics of Object-Oriented Programming 1.
CPT 140 Programming Constructs1 OBJECT ORIENTED TECHNOLOGY Terminology and Basic Concepts.
Introduction To System Analysis and design
UFCEUS-20-2 : Web Programming Lecture 5 : Object Oriented PHP (1)
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 1: Introduction to Object-Oriented Programming.
BCS 2143 Introduction to Object Oriented and Software Development.
Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing.
Object Oriented Concepts & Principles Ingrid Kirschning & Gerardo Ayala.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.
Introduction to Objects Adapted from “TEN STEPS TO OBJECT-SPEAK” a CPT Tech Talk by Joy Starks September 17, 1999.
© S. Demeyer, S. Ducasse, O. Nierstrasz Intro.1 1. Introduction Goals Why Reengineering ?  Lehman's Laws  Object-Oriented Legacy Typical Problems  common.
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix A Object-Oriented.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
1 Object-Oriented Systems Development Bahrami © Irwin/ McGraw-Hill Chapter 2: Object Basics Object-Oriented Systems Development Using the Unified Modeling.
CSC480 Software Engineering Lecture 11 September 30, 2002.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
S.Ducasse Stéphane Ducasse 1 Object-Oriented Programming.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
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”
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (1/2)
Object Oriented Modeling David Li CTO, DigitalSesame.
Basic Concepts of Object Orientation Object-Oriented Analysis CIM2566 Bavy LI.
Salman Marvasti Sharif University of Technology Winter 2015.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
S.Ducasse Stéphane Ducasse 1 Essential OO Concepts Stéphane Ducasse.
OOP (Object Oriented Programming) Lecture 1. Why a new paradigm is needed? Complexity Five attributes of complex systems –Frequently, complexity takes.
Business Applications with Object-Oriented Paradigm (Modeling Concepts) Professor Chen School of Business Gonzaga University Spokane, WA
OO in Context Lecture 13: Dolores Zage. Confused about OO Not alone, there is much confusion about OO many programs are claimed to be OO but are not really.
Copyright 2006 Oxford Consulting, Ltd1 January Introduction to C++ Programming is taking A problem Find the area of a rectangle A set of data.
Lecture 2: Review of Object Orientation. © Lethbridge/La ganière 2005 Chapter 2: Review of Object Orientation What is Object Orientation? Procedural.
Next Back MAP MAP F-1 Management Information Systems for the Information Age Second Canadian Edition Copyright 2004 The McGraw-Hill Companies, Inc. All.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix A Object-Oriented Analysis and Design A.1.
COP 4331 – OOD&P Lecture 7 Object Concepts. What is an Object Programming language definition: An instance of a class Design perspective is different.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (1/2)
Sadegh Aliakbary Sharif University of Technology Fall 2010.
16 April 2011 Alan, Edison, etc, Saturday.. Knowledge, Planning and Robotics 1.Knowledge 2.Types of knowledge 3.Representation of knowledge 4.Planning.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
Object Oriented Programming
Roberta Roth, Alan Dennis, and Barbara Haley Wixom
Chapter 20 Object-Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
Workshop for Programming And Systems Management Teachers
Handout-2(b) Dr. R. Z. Khan AMU. Aligarh (INDIA).
What Is Good Software(Program)?
Object-Oriented PHP (1)
Presentation transcript:

Stéphane Ducasse2.1 OOP? What is OOP? Why? OOP in a nutshell

Stéphane Ducasse2.2 Reality on Software Development What is important? maintainability extensibility understandability

Stéphane Ducasse2.3 Maintenance = Evolution 17.4% Corrective (fixing reported errors) 18.2% Adaptive (new platforms or OS) 60.3% Perfective (new functionality) The bulk of the maintenance cost is due to new functionality => even with better requirements, it is hard to predict new functions data from [Lien78a] 4.1% Other

Stéphane Ducasse2.4 The Waterfall Model is dead

Stéphane Ducasse2.5 Iterative Development

Stéphane Ducasse2.6 Lehman’s Laws of Software Evolution Continous Change: “A program that is used in a real- world environment must change, or become progressively less useful in that environment.” Software Entropy: “As a program evolves, it becomes more complex, and extra resources are needed to preserve and simplify its structure.”

Stéphane Ducasse2.7 The Old Way Computer system consists of data and programs. Programs manipulate data. Programs organized by –functional decomposition –dataflow –modules

Stéphane Ducasse2.8 New Paradigm Computer system consists of a set of objects. Objects are responsible for knowing and doing certain things. Objects collaborate to carry out their responsibilities. Programs organized by classes, inheritance hierarchies and subsystems

Stéphane Ducasse2.9 Accidental vs. Essential Complexity Assembly is perfect to write 8k programs! But we need abstraction tools to model the complexity of the world Object-oriented programming in only one way –Reactive languages, –Relational languages, –Logic Languages, … are others OOP helps reducing the accidental complexity not the essential Bad OO programs are also difficult to understand, extend, and maintain

Stéphane Ducasse2.10 What is an object, anyway? Mystical view Computing systems are made up of objects that communicate only by sending messages between each other. All computation is message sending.

Stéphane Ducasse2.11 What is an object, anyway? Scandinavian view A program is a simulation. Each entity in the system being simulated is represented by an entity in the program.

Stéphane Ducasse2.12 What is an object, anyway? Programming language view An object-oriented system is characterized by data abstraction inheritance polymorphism by late-binding of procedure calls

Stéphane Ducasse2.13 Modeling All phases of software life-cycle are modeling analysis - modeling of problem design - modeling of solution implementation - making model run on a computer maintenance - fixing/extending your model

Stéphane Ducasse2.14 Modeling Claim: people model the world with "objects" objects classes relationships between objects relationships between classes

Stéphane Ducasse2.15 Modeling Advantages of object-oriented software development more natural - matches the way people think single notation - makes it easy to move between software phases

Stéphane Ducasse2.16 Objects and Relationships John is Mary's father. Mary is John's daughter. Bob is Mary's dog. Mary is Bob's owner. Ann is John's employer. John is Ann's employee.

Stéphane Ducasse2.17 Objects and Attributes John's name is "John Patrick O'Brian". John's age is 27. John's address is 987 N. Oak St, Champaign IL What about John's employer? John's wife? What is an attribute, and what is a relationship?

Stéphane Ducasse2.18 Objects and Behavior John goes on a trip. John makes reservations. John buys tickets. John travels by airplane. John checks into hotel.

Stéphane Ducasse2.19 What is really an object? Anything we can talk about can be an object, including relationships ("the husband of the first party", "first-born son"). What are we trying to model? Models should be as simple as possible, but no simpler. Models are dictacted by domains

Stéphane Ducasse2.20 Object Data Messages Methods

Stéphane Ducasse2.21 Object: Behavior + State + Control What: Messages –Specify what behavior objects are to perform –Details of how are left up to the receiver –State information only accessed via messages How: Methods –Specify how operation is to be performed –Must have access to (contain or be passed) data –Need detailed knowledge of data –Can manipulate data directly Data Methods Messages

Stéphane Ducasse2.22 Classification We naturally put objects into classes that have similar characteristics. John is a man. Mary is a woman. Bob is a dog. All women are people. All people are mammals.

Stéphane Ducasse2.23 Classes: Factory of Objects Reuse behavior => Factor into class Class: “Factory” object for creating new objects of the same kind Template for objects that share common characteristics

Stéphane Ducasse2.24 Class: Mold of Objects **Describe** state but not value of all the instances of the class –Position, width and height for rectangles **Define** behavior of all instances of the class area ^ width * height Rectangle position width height area translatedBy: aPoint

Stéphane Ducasse2.25 Instances A particular occurrence of an object defined by a class Each instance has its own value for the instance variables All instances of a class share the same methods Rectangle position width height area translatedBy: aPoint

Stéphane Ducasse2.26 How to Share Specification? Do not want to rewrite everything! Often times want small changes Class hierarchies for sharing of definitions Each class defines or refines the definition of its ancestors => inheritance

Stéphane Ducasse2.27 Inheritance New classes –Can add state and behavior – Can specialize ancestor behavior –Can use ancestor’s behavior and state –Can hide ancestor’s behavior To existing ones Direct ancestor = superclass Direct descendant = subclass

Stéphane Ducasse2.28 Comparable Quantity Hierarchy

Stéphane Ducasse2.29 Summary Objects have identity have attributes have behavior have relationships with other objects

Stéphane Ducasse2.30 Summary Classes **Describes** the attributes, and relationships of a set of objects Define the behavior of a set of objects Reuse, extend, specialize behavior from other classes Subclasses/superclasses form graph of generalizations