CS48710-1/36 Illinois Institute of Technology CS487 - Software Engineering Object -Oriented Concepts & Principle - Chapt 19 David A. Lash.

Slides:



Advertisements
Similar presentations
Understand and appreciate Object Oriented Programming (OOP) Objects are self-contained modules or subroutines that contain data as well as the functions.
Advertisements

Object-Oriented Programming Basics Prof. Ankur Teredesai, Computer Science Department, RIT.
When is Orientated Programming NOT? Mike Fitzpatrick.
Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
OBJECT ORIENTED PROGRAMMING M Taimoor Khan
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Software Requirements Engineering Elaboration Process Lecture-13.
Chapter 10 Introduction to Objects and Classess 1.
Department of Computing
Introduction To System Analysis and Design
Object-Oriented Databases v OO systems associated with – graphical user interface (GUI) – powerful modeling techniques – advanced data management capabilities.
1 Lecture 4 Behaviour Modelling Requirement Specification Object-Oriented Paradigm.
Chapter Object-Oriented Practices. Agenda Object-Oriented Concepts Terminology Object-Oriented Modeling Tips Object-Oriented Data Models and DBMSs.
Object Oriented System Development with VB .NET
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
Basic OOP Concepts and Terms
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.
C++ fundamentals.
1 INTRODUCTION TO OOP Objective: Know the difference between functional programming and OOP Know basic terminology in OOP Know the importance of OOP Know.
1 Object-Oriented Software Engineering CIS 375 Bruce R. Maxim UM-Dearborn.
BACS 287 Basics of Object-Oriented Programming 1.
Building The Analysis Model. Object-Oriented Analysis The object oriented analysis define all classes, the relationships and behavior associated with.
CPT 140 Programming Constructs1 OBJECT ORIENTED TECHNOLOGY Terminology and Basic Concepts.
1 INTRODUCTION TO OOP Objective: Know the difference between functional programming and OOP Know basic terminology in OOP Know the importance of OOP Know.
Chapter 5: Modeling Systems Requirements: Events and Things
Introduction To System Analysis and design
1 CSc 131 Computer Software Engineering Fall 2012 Lecture # 7 Object-Oriented Design & UML Class Models.
Introduction to Object-oriented programming and software development Lecture 1.
Data Flow Diagrams.
Unified Modeling Language, Version 2.0
5 Systems Analysis and Design in a Changing World, Fourth Edition.
Introduction To System Analysis and Design
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Chapter 8 Analysis & Modeling. Data Modeling examines data objects independently of processing focuses attention on the data domain creates a model at.
Class-based Modeling.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 24. Review ANALYSIS Level Class Diagram – Identifying Entities – Identifying Attributes – Identifying Operations.
Object Oriented Analysis
Basic OOP Concepts and Terms. In this class, we will cover: Objects and examples of different object types Classes and how they relate to objects Object.
Design.ppt1 Top-down designs: 1. Define the Problem IPO 2. Identify tasks, Modularize 3. Use structure chart 4. Pseudocode for Mainline 5. Construct pseudocode.
Introduction To OOP 1.0 Fundamentals Of Java Programming Language 2.0 Exception Handling 3.0 Classes, Inheritance And Polymorphism © 2011 | PN AZRINA.
BCS 2143 Object Oriented Design Using UML. Objectives Objects Interactions Finding Classes Relationship Between Classes Attribute and Operation Class.
ITEC 3220A Using and Designing Database Systems Instructor: Prof Z. Yang Course Website: 3220a.htm
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
 Week08.  Review Schedule Weeks 8-14  This week o Review last class o Introduce Class Diagrams o ICE-03 Sheridan SYST Engineering Quality Systems.
Learners Support Publications Object Oriented Programming.
Summing Up Object Oriented Design. Four Major Components: Abstraction modeling real-life entities by essential information only Encapsulation clustering.
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”
9-Dec Dec-15  INTRODUCTION.  FEATURES OF OOP.  ORGANIZATION OF DATA & FUNCTION IN OOP.  OOP’S DESIGN.
S.Ducasse Stéphane Ducasse 1 Essential OO Concepts Stéphane Ducasse.
OOP Review CS 124.
Chapter 4 Basic Object-Oriented Concepts. Chapter 4 Objectives Class vs. Object Attributes of a class Object relationships Class Methods (Operations)
1 Software Engineering Lecture 15 Object Oriented Software Design in Java.
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
Lecture 2: Review of Object Orientation. © Lethbridge/La ganière 2005 Chapter 2: Review of Object Orientation What is Object Orientation? Procedural.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
Elements Of Modeling. 1.Data Modeling  Data modeling answers a set of specific questions that are relevant to any data processing application. e.g. ◦
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
Chapter 8 Analysis Engineering
Object Oriented Programming
Cmpe 589 Spring 2006.
Object-Oriented Programming Basics
INTRODUCTION TO OOP Objective:
ITEC 3220A Using and Designing Database Systems
Basic OOP Concepts and Terms
Chapter 20 Object-Oriented Concepts and Principles
Presentation transcript:

CS /36 Illinois Institute of Technology CS487 - Software Engineering Object -Oriented Concepts & Principle - Chapt 19 David A. Lash

CS /36 Object Oriented Concepts & Principles u Object-Oriented Viewpoint - Characterize the problem domain as a set of objects with specific attributes and behaviors – Functions and methods manipulate the objects – Further characterize the objects into classes and subclasses u Leads to libraries of reusable classes and objects. – Reduces time to develop & higher quality programs – Easier to change

CS /36 Object Approach u Was software development only but now encompasses a complete SE view – More than OOP (OO programming), should consider OORA (OO Req Analysis) OO D (design) & OO CASE. – Engineering paradigm is more evolutionary since reuse of classes to emphasize

CS /36 Object Approach u The OO development process starts with requirements. – Would define requirement classes u During engineering and construction & release would follow the path below: Identify candidate classes Search class library Build classes unavailable Save new classes On to customer evaluation From Requirements, then planning & Risk Analysis

CS /36 What is an object? u A tangible and/or visible thing – Customer, Part, etc. u Something that may be apprehended intellectually – Appointment, Task, etc. u Something toward which thought or action is directed – Order, Process, etc.

CS /36 Object Definition An object is characterized by a number of operations and a state which remembers the effect of operations.

CS /36 What are an object’s characteristics? u Identity. – A way to distinguish between occurrences u Behavior. – How the object acts and reacts in terms of state changes and messages (methods) u State. – The state of an object encompasses all of the (usually static) properties of the object plus the current (usually dynamic) values of each of these properties

CS /36 Example OO Concepts - Classes, Objects & Inheritance u Assume have defined a class called Furniture and – within that class there is an object called chair Object: Chair Attributes: - Cost - Dimension - Location - Color Class: Furniture Attributes: - Cost - Dimension - Location - Color Inheritance

CS /36 Example OO Concepts - Operations & more Inheritance u Operations modify 1 or more attributes – E.g., location might be a function of building, floor & room. Then move might modify 1 or more of building, floor & room to effect location. Object: Chair Attributes: - Cost - Dimension - Location - Color Operations - Buy - Sell - Weigh - Move Class: Furniture Attributes: - Cost - Dimension - Location - Color Operations - Buy - Sell - Weigh - Move Inheritance

CS /36 Principles of Object Orientation u Major Elements – Classes & Objects – Abstraction – Encapsulation – Hierarchy/Inheritance – Polymorphism

CS /36 What is a class? u 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 for their information structures. u A.K.A an object type

CS /36 What is the instance of a class? u An instance is an object created from a class. The class describes the (behavior and information) structure of the instance, while the current state of the instance is defined by the operations performed on the instance.

CS /36 Instance of Tom from Persons Class of persons

CS /36 Classes & Objects u An OO concept that encapsulates the data and procedures needed to describe the content and behavior of some real work entity u Attributes that describe the class are walled off by methods that manipulate the data some way – the class encapsulates the data – the processing use methods to manipulate data – achieves information hiding & minimizes ripple effect.

CS /36 More On Classes & Objects u Classes also are generalized description that describe a category of objects (AKA template) – All objects within a class inherent its attributes, and operations u A superclass is a collection of classes and subclass is a specialize instance of the class Furniture Table Chair Desk Chair Instances

CS /36 Messages & Classes u OO = objects + classification + inheritance = communication u Messages are means by which objects interact – Provide stimulators to some behavior between objects – message[dest, operation, parms] Object: XXX Attributes: - X1 - Y1 Operations - Z1 - A1 Object: AAA Attributes: - A2 - B2 Operations - X2 - Y2 Msg(dest, oper, parm)

CS /36 Encapsulation u Grouping related information together and protecting it from the outside world. (e.g., its structure and behavior) – E.g., grouping data (variables) and actions (methods) to form objects. Advantages: – Internal details of data & procedures hidden (reduces side effects of errors) – Classes contain templates of data structures & operations factilitating reuse – Interfaces are encapsulated via messages with details. (tends to reduce coupling).

CS /36 Hierarchy & Inheritance u Inheritance - A key difference between OO systems and conventional programming – Subclass Y inherits all attributes & operations. – All algorithms & data structures immediately available for reuse. – All changes and additions of the superclass are immediately available to the subclasses. (change propagation) Class: Kitchen_furniture Attributes: - Cost - Dimension - Location - Color Operations - Buy - Sell - Weigh - Move Class: Furniture Attributes: - Cost - Dimension - Location - Color Operations - Buy - Sell - Weigh - Move Inheritance

CS /36 More On Hierarchy & Inheritance u New attributes and operations can be added at each level of the hierarchy u When adding a class have several options – Class can be designed from scratch – Search class hierarchy to find one similar to inherit from – Can restructure the class hierarchy to enable inheritance by the new class – Can override characteristics of a superclass and rewrite them for current class use.

CS /36 Hierarchy & Multiple Inheritance Class: X Attributes: - Char1 - Char2 - Char3 +char4 +char5 Class: X Attributes: - Char1 - Char2 - Char3 - Char4 - Char5 Class: X Attributes: - Char1 - Char2 - Char3 - Char4 - Char5 - Char6 Class: X Attributes: - Char1 - Char2 - Char3 - Char4 - Char5 +char6+Char7 Suppose wanted X1 to inherit Chart1, 2, 3, 4, 8

CS /36 Hierarchy & Inheritance Class: X Attributes: - Char1 - Char2 - Char3 +char4 +char5 Class: X Attributes: - Char1 - Char2 - Char3 - Char4 - Char5 Class: X Attributes: - Char1 - Char2 - Char3 - Char4 - Char5 - Char6 Class: X Attributes: - Char1 - Char2 - Char3 - Char4 - Char5 +char6+Char7 Suppose wanted X1 to inherit Chart1, 2, 3, 4, 8 Class: X Attributes: - Char1 - Char2 - Char3 +char4 Class: X Attributes: - Char1 - Char2 - Char3 - Char4 Class: X2a Attributes: - Char1 - Char2 - Char3 - Char4 - Char5 +char5 Class: X2b Attributes: - Char1 - Char2 - Char3 - Char4 - Char8

CS /36 Hierarchy & Inheritance Suppose added classes benglishcar & englishmotorcycle Class: Vehicle Class: EnginePoweredVehicle Class: PersonPoweredVehicle Class: 2wheeledVehicle Class: 4wheeledVehicle Class: car Class: Motorcycle Both need operations leakOil() & eltronicFailure() EnglishCarEnglishMotorcyle Different parts of hierarchy? Restructure hierarchy? Copy code method in each? enginlishthing Multi- inheritence generally not allowed

CS /36 Single Inheritance w/ Java u Java handles single inheritance problem by: – creating a separate hierarchy with mixed behavior classes called an interface hierarchy. – When you create a new class you can pick from the superclass also from the other hierarchy. – The interface hierarchy is a collection of methods (or behaviors), definitions and constants. (E.g., mathematical functions)

CS /36 Polymorphism u A facility for the same method name to be used with different objects. u Suppose had 4 graphical shapes and wanted to enable them to grow in size on the screen. u Set all shapes to be subclasses of a general class called shape. u Each object provides a grow method u Therefore can call shape.grow(size); u The run-time system invokes the version of grow from the object being used at the time. Circle circle; Oval oval; Rectangle rectangle; Triangle t; Circle.grow(change); oval.grow(change); rectangle(change); t.change(change);

CS /36 More On Objects u Objects tend to be – external entities - other systems, devices, people, – things - letters, reports, displays, – Events - sensor alert, robot movement – Roles - manager, engineer, salesperson – Organization unit - division, group, team – Places - loading dock, manufacturing floor – Structure - sensors, 4-wheeled vehicles that define categories of objects

CS /36 More On Objects - II u From the homesafe example – extract nouns from system description and create a list of potential objects Potential object/class General Class homeowner role or external entity sensor external entity control panel external entity installation occurrence system (AKA security sys) thing number, type attributes of sensor master password thing telephone number thing sensor event occurrence audible alarm external entity monitoring service external entity

CS /36 More On Objects - III u Six characteristics that should be used on each potential object: – Retained Information - information about it must be remembered – Needed services - have a set of identifiable operations that can change attribute’s value – Multiple Attributes - Are the attributes “major” and useful? – Common Attributes - can define a set that apply to all occurrences of object – Essential requirements - External entity in problem and produces information essential to solution

CS /36 More On Objects - IV u Apply criteria to potential objects Potential object/class General Class homeowner Fail 1,2, fail 6 OK sensor OK: All OK control panel OK: all OK installation Rejected system (AKA security sys) OK: all OK number, type Fail: 3 fails master password Fail: 3 fails telephone number Fail: 3 fails sensor event OK: All OK audible alarm Ok 2-6 OK monitoring service Fail: 1-2 fail 6 OK

CS /36 More On Attributes u They describe the object and define & clarify it. – E.g., player - couple have u name, position, batting aver, games played u name, average salary, peak salary, years left on contract u Study narrative and identify & select things reasonably belong to object – Data items needed to define object in problem – Security system has set of attributes allow to configure u sensor_info = sensor_type + sensor_numb + alarm_threshold u Alarm_response_info = delay_time + phone_numb _ alarm_type u activation/deact_info = master_passwd + number_of_tries + temp_passwd

CS /36 More On Operations u Define define the behavior of an object & change the attributes some way – manipulate data in some way (add, delete, change) – performance computation – monitor occurrence of an event

CS /36 More On Operations - II u Study narrative and identify reasonably belong to object – study the “verbs” of narrative u “Sensor is assigned a number & type” u “Master passwd is programmed for arming & disarming...” – Tells us, – assign operation for sensor object – program operation for system object – arm/disarm -> system (maybe system_status = armed | disarmed)

CS /36 More On Operations - III u Would also consider the communication between objects: u What know activities occur during the life of the object? – Communication between objects -> clues u sensor event - message -> sensor to display location and number u cntl panel -> send -> system a reset message to update system status u audible alarm sent query message

CS /36 More On Operations Object: System Attributes: -SystemID - phone number - system status - sensor table sensor type sensor number alarm threshold - alarm display time - telephone number - alarm threshold - master passwor - temporary password - number of tries Operations: program - display - Reset - query - modify - call

CS /36 Object-Oriented Programming Object-oriented programming is a method of implementation in which - programs are organized as cooperative collections of objects, - each of which represents an instance of some class, - and whose classes are all members of a hierarchy of classes united via inheritance relationships.

CS /36 Object-Oriented Analysis Object-oriented analysis is a method of analysis that – examines requirements form the perspective of the classes and objects found in the vocabulary of the problem domain.

CS /36 Object-Oriented Design Object-oriented design is a method of design – encompassing the process of object-oriented decomposition and – a notation for depicting both logical and physical as well as – static and dynamic models of the system under design.