Chapter 10 Class and Method Design

Slides:



Advertisements
Similar presentations
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Advertisements

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved. Slide 1.
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:
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)
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 8 Slide 1 System models.
Object-Oriented Databases v OO systems associated with – graphical user interface (GUI) – powerful modeling techniques – advanced data management capabilities.
A Brief Introduction to Software Design and Design Quality By Laura Leventhal.
Slide 1 Systems Analysis & Design CS183 Spring Semester 2008 Dr. Jonathan Y. Clark Course Website:
© 2005 Prentice Hall8-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 8 Slide 1 System models September 29, 2008.
Lecturer: Dr. AJ Bieszczad Chapter 66-1 Object-Oriented analysis and design Special nature of OO development Use cases Design with UML OO system design.
Data and Process Modeling
PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved. Slide 1.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Slide 1 Chapter 10 Class and Method Design. Slide 2 REVISITING THE BASIC CHARACTERISTICS OF OBJECT-ORIENTATION.
Chapter 7 - Generalization/Specialization and Inheritance1 Chapter 7 Generalization/Specialization and Inheritance.
BACS 287 Basics of Object-Oriented Programming 1.
OO Analysis and Design CMPS OOA/OOD Cursory explanation of OOP emphasizes ▫ Syntax  classes, inheritance, message passing, virtual, static Most.
Systems Analysis and Design in a Changing World, Fifth Edition
Prof. Dr. Nizamettin AYDIN
Object-Oriented Software Testing. C-S 5462 Object-Oriented Software Testing Research confirms that testing methods proposed for procedural approach are.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
Chapter 4 System Models A description of the various models that can be used to specify software systems.
1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.
An Introduction to Software Architecture
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 10: Class and Method.
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
Chapter 7 System models.
Sommerville 2004,Mejia-Alvarez 2009Software Engineering, 7th edition. Chapter 8 Slide 1 System models.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 10: Class and Method.
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.
1/26 On-demand Learning Series Software Engineering of Web Application - Object-Oriented Development & UML Hunan University, Software School.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
Part VII: Design Continuous
CSC 480 Software Engineering Design by Contract. Detail Design Road Map Begin with architectural models  Class model: domain classes  Overall state.
Relationships Relationships between objects and between classes.
3-1 Encapsulation and Connascence Encapsulation and connascence are the two fundamental properties of object-oriented systems Encapsulation and connascence.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Dr D. Greer, Queens University Belfast )Chapter Six 1 Software Engineering Chapter Six Software Design Quality Learning Outcomes.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Testing OO software. State Based Testing State machine: implementation-independent specification (model) of the dynamic behaviour of the system State:
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
Slide 1 Classes and Objects. Slide 2 Messages and Methods.
9 - Class & Method Design Model Enhancement Design to Code Proposal Presentation.
1 Unified Modeling Language, Version 2.0 Chapter 2.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 5th Edition Copyright © 2015 John Wiley & Sons, Inc. All rights.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
Basic Characteristics of Object-Oriented Systems
11 Systems Analysis and Design in a Changing World, Fifth Edition.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
Design Concepts ch-8
UNIT-IV Designing Classes – Access Layer ‐ Object Storage ‐ Object Interoperability.
The Movement To Objects
Systems Analysis and Design With UML 2
TIM 58 Chapter 8: Class and Method Design
Class and Method Design
CIS 375 Bruce R. Maxim UM-Dearborn
INFS 6225 – Object-Oriented Systems Analysis & Design
Slides by Steve Armstrong LeTourneau University Longview, TX
Chapter 20 Object-Oriented Analysis and Design
An Introduction to Software Architecture
PHÂN TÍCH THIẾT KẾ HƯỚNG ĐỐI TƯỢNG
Design Yaodong Bi.
Systems Analysis and Design with UML Version 2.0, Second Edition
Presentation transcript:

Chapter 10 Class and Method Design

REVISITING THE BASIC CHARACTERISTICS OF OBJECT-ORIENTATION

Levels of Abstraction Package

Elements Classes Objects Attributes States Methods Messages

Encapsulation Hiding the content of the object from outside view Communication only through object’s methods Key to reusability

Polymorphism Same message triggers different methods in different objects Dynamic binding means specific method is selected at run time Implementation of dynamic binding is language specific Need to be very careful about run time errors Need to ensure semantic consistency

Inheritance Single inheritance -- one parent class Multiple inheritance -- multiple parent classes Redefinition and inheritance conflict Most inheritance conflicts are due to poor classification

Rumbaugh’s Rules Query operations should not be redefined Methods that redefine inherited ones should only restrict the semantics of the inherited ones The underlying semantics of the inherited method should never be changed The signature (argument list) of the inherited method should

Additional Inheritance Conflicts Two inherited attributes or methods have same name and semantics Two inherited attributes or methods have different name, but same semantics Two inherited attributes or methods have same name and different semantics

Inheritance Conflicts with Multiple Inheritance

Design Criteria

Coupling Indicates the interdependence or interrelationships of the modules Interaction coupling Relationships with methods and objects through message passage Inheritance coupling How tightly coupled are the classes in the inheritance hierarchy?

Interaction Coupling

Cohesion Determines how single-minded a module (class, object, or method) is within a system Method Cohesion Methods should do one and only one thing Class Cohesion Level of cohesion between the attributes and methods of a class

Types of Method Cohesion

Ideal Class Cohesion Contain multiple methods that are visible outside the class Have methods that refer to attributes or other methods defined with the class or its superclass Not have any control-flow coupling between its methods

Types of Class Cohesion

Connascence Two modules (classes or methods) are so intertwined, that if you make a change in one, it is likely that a change in the other will be required Generalizes the idea of cohesion and coupling

Connascence and Encapsulation Levels Minimize overall connascence by eliminating any unnecessary connascence throughout the system, Minimize connascence across any encapsulation boundaries, such as method boundaries and class boundaries, Maximize connascence within any encapsulation boundary.

Types of Connascence

Object Design Activities Adding Specification Identifying opportunities for reuse Restructuring the design Optimizing the design Mapping problem classes to Implementation Languages

1. Additional Specification Ensure the classes are both necessary and sufficient for the problem Finalize the visibility of the attributes and methods of each class Determine the signature of every method of each class Define constraints to be preserved by objects

2. Identifying Opportunities for Reuse Analysis patterns Problem domain representations Design patterns Grouping of collaborating classes that provide a solution to a commonly occurring problem Frameworks Set of implemented classes that can be used as a basis for implementing an application. E.g: CORBA, DCOM Libraries Set of class libraries Components Self-contained, encapsulated piece of software that can be plugged-in

Sample Design Pattern (Forwarder-Receiver Pattern)

3. Restructuring the Design Factoring Separate aspects of a method or class into a new method or class Normalization Identifies classes missing from the design Challenge inheritance relationships to ensure they only support a generalization/specialization semantics

4. Optimizing the Design Review access paths between objects Review each attribute of each class Review fan-out of each method Examine execution order of statements Create derived activities

5. Map Problem Domain Classes to Implementation Languages Single-Inheritance Language Convert relationships to association relationships Flatten inheritance hierarchy by copying attributes and methods of additional superclass(es)

Implement in Object-Based Language Factor out all uses of inheritance from the problem domain class design

Implement in a Traditional Language Stay away from traditional languages to implement O-O design But if necessary, factor out all uses of Polymorphism Dynamic binding Encapsulation Information hiding

Constraints and Contracts

Types of Constraints Pre-Conditions Post-condition Invariants A constraint to be met to allow a method to execute Post-condition A constraint to be met after a method executes Invariants Constraints that must be true for all instances of a class

Invariants

Elements of a Contract

Method Specification

Method Specification General information Events Message passing Algorithm specification Structured English Pseudocode UML activity diagram

Applying the Concepts at CD Selections

Revised CD Selections Class Diagram

Back of CD CRC Card

Get Review Method Contract

Revised Package Diagram