Chapter 12 Object-oriented design for more than one class.

Slides:



Advertisements
Similar presentations
UML (cont.) “The Unified Modeling Language User Guide” by G. Booch, J. Rumbaugh and I. Jacobson ● Classes ● Relationships ● Class diagrams ● Examples.
Advertisements

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
Chapter 7 Testing Class Hierarchies. SWE 415 Chapter 7 2 Reading Assignment  John McGregor and David A. Sykes, A Practical Guide to Testing Object-Oriented.
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
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)
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
Fall 2007ACS-1805 Ron McFadyen1 Programming Concepts Chapter 4 introduces more advanced OO programming techniques. Construction of a programs usually requires:
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
7M822 UML Class Diagrams advanced concepts 15 September 2008.
6. 2Object-Oriented Analysis and Design with the Unified Process Objectives  Explain how events can be used to identify use cases that define requirements.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra,
The Unified Modeling Language (UML) Class Diagrams.
UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software.
Systems Analysis and Design in a Changing World, Tuesday, Feb 27
Chapter 12: Adding Functionality to Your Classes.
Chapter 8 More Object Concepts
OBJECT AND CLASES: THE BASIC CONCEPTS Pertemuan 8 Matakuliah: Konsep object-oriented Tahun: 2009.
An Object-Oriented Approach to Programming Logic and Design
OBJECT ORIENTED PROGRAMMING CONCEPTS ISC 560. Object-oriented Concepts  Objects – things names with nouns  Classes – classifications (groups) of similar.
1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.
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.
Unified Modeling Language, Version 2.0
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part V: Design The Design Workflow Design Classes Refining Analysis Relationships.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
7-1 © Prentice Hall, 2004 Chapter 7: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
7-1 © Prentice Hall, 2007 Chapter 7: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 15: Object-Oriented Data Modeling Modern Database Management 9 h Edition Jeffrey A.
7-1 © Prentice Hall, 2007 Week 5: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Systems Analysis & Design 7 th Edition Chapter 5.
CSC480 Software Engineering Lecture 11 September 30, 2002.
Object-Oriented Design Simple Program Design Third Edition A Step-by-Step Approach 11.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
CS212: Object Oriented Analysis and Design Lecture 13: Relationship between Classes.
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2 nd Edition Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
CIS 112 Exam Review. Exam Content 100 questions valued at 1 point each 100 questions valued at 1 point each 100 points total 100 points total 10 each.
Object-Oriented Data Modeling
Object-Oriented Programming © 2013 Goodrich, Tamassia, Goldwasser1Object-Oriented Programming.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Chapter 4 Basic Object-Oriented Concepts. Chapter 4 Objectives Class vs. Object Attributes of a class Object relationships Class Methods (Operations)
 Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and.
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
Object orientation and Packaging in Java Object Orientation and Packaging Introduction: After completing this chapter, you will be able to identify.
 To explain why the context of a system should be modelled as part of the RE process  To describe behavioural modelling, data modelling and object modelling.
Basic Characteristics of Object-Oriented Systems
Chapter 11 An introduction to object-oriented design.
Chapter 11 Inheritance © 2008 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. Marilyn Bohl/Maria Rynn Tools for Structured and Object-Oriented.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 8 Slide 1 System models.
Software Modelling Class Diagram. Class Diagrams The main building block in object oriented modeling They are used both for general conceptual modeling.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Object-Orientated Analysis, Design and Programming
Object Oriented Programming
DATA REQIREMENT ANALYSIS
The Movement To Objects
OBJECT ORIENTED CONCEPT
Interface, Subclass, and Abstract Class Review
UML Class Diagrams: Basic Concepts
Object-oriented design for multiple classes
Chapter 20 Object-Oriented Analysis and Design
Understand and Use Object Oriented Methods
Chapter 2 Underpinnings of Requirements Analysis
Java Programming, Second Edition
The Object Paradigm Classes – Templates for creating objects
Presentation transcript:

Chapter 12 Object-oriented design for more than one class

Objectives To describe relationships between classes To introduce a simplified unified modelling language To introduce polymorphism and operation overriding in object-oriented design To develop object-oriented design solutions to problems using more than one class

12.1 Further object-oriented design

Major advantage of object-oriented programming language is their usefulness in constructing large programs In designing programs that use multiple classes, need to consider the relationship between the classes and therefore between the objects that are instantiated from those classes

Further object-oriented design Notations – Notation called standing for united modelling language (UML) – UML allows a designer to represent the relationship between classes as well as between objects

Further object-oriented design Relationship between classes – Three types of relationship between classes: 1.Relationship between two classes that are independent of each other but one class might use the services the other provides – Association 2.Class may be made up of other classes or contain other classes that are part of itself – Aggregation or Composition 3.Class may inherit all the attributes and operations of a parent class but is given a unique name - Generalisation

Further object-oriented design Association – Association between two classes is required when the classes need to interact or communicate for the program to achieve its purpose – Association are also called links

Further object-oriented design Aggregation and composition – Special forms of association where objects of one class, the container class, are made up or consist of other objects from other classes, the components classes – There are whole-part associations: one class is the whole that is made up of parts

Further object-oriented design – Mildest form called aggregation, the part or component classes that make up the whole are able to exist without necessarily being part of the aggregation – Strongest form called composition, the component classes can only exist during the lifetime of the container object and cannot exist outside the composition

Further object-oriented design Generalisation – Class hierarchy that lets us group the shared attributes and operations into a top-level class, and then to define one or more lower-level classes with extra or different attributes and operations – The top-level class, also called the parent class or superclass, has shared attributes and operations, and the child classes or subclasses, inherit these, adding their own attributes and operations to make them distinct

Further object-oriented design Polymorphism – Describes the use of operations of the same name for variety of purposes – Operating overrides occurs when a parent class provides an operation, but the inheriting child class defines its own version of that operation – In another type of polymorphism, overloading, several operations in a single class can have the same name

Operation overriding – Occurs when a parent class provides an operation but the inheriting child class defines its own version of that operation – The operation in a subclass will override the operation in the superclass Further object-oriented design

Object-oriented design with multiple classes Operation overloading – Occurs when several operations in a single class have the same name but will act differently according to the number of parameters that are passed to the operation when it is called

Scope of data – As soon as a project is created, the data that an object needs is brought within its scope – Attributes values are available to all the operations within the class and are visible to each operation Object-oriented design with multiple classes

12.2 Steps in creating an object- oriented solution using more than one class

Four steps to follow to create an object-oriented solution: 1.Identify the classes and their attributes, responsibilities and operations 2.Determine the relationship between the objects and those classes 3.Design the algorithm for the operation, using structured design 4.Develop a test or driver algorithm to test the solution

Summary It is important to understand the relationships between classes. An association relationship occurs when two classes are independent of each other, but one class uses the services that the other provides. The relationship between a parent class and a child class is called generalisation.

Summary Polymorphism refers to the same method name being used in different classes to perform a variety of purposes. Operation overriding occurs when a parent class provides an operation, but the inheriting class defines its own version of the operation. Operation overloading occurs when several operations in a single class have the same name, but will act differently according to the number of parameters that are passed to the operation when it is called.

Summary There are four steps for designing a solution to a simple multiple-class problem: 1.Identify the classes and their attributes, responsibilities and operations. 2.Determine the relationship between the objects of those classes. 3.Design the algorithms for the operations using structured design. 4.Develop a test or driver algorithm to test the solution.