State-Space and Behavior

Slides:



Advertisements
Similar presentations
Object-Oriented Programming Basics Prof. Ankur Teredesai, Computer Science Department, RIT.
Advertisements

© Colin Potts C6-1 Some future trends in requirements engineering Colin Potts Georgia Tech.
Verification of Graph Transformation Systems Arman Sheikholeslami
Stereotypes Stereotypes provide the capability to create a new kind of modeling element. –They can be used to classify or mark modeling elements. –A type.
Inheritance Java permits you to use your user defined classes to create programs using inheritance.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
Object-Oriented Analysis
1 Inheritance. 2 One class inherits from another if it describes a specialized subset of objects Terminology: inheritschild class subclass –the class.
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
Software Testing and Quality Assurance
Object-Oriented Analysis and Design Lecture 8 State Space, Behavior, and Type Conformance.
Chapter 10 Classes Continued
Object-Oriented Design 2 Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Slide 1 Chapter 10 Class and Method Design. Slide 2 REVISITING THE BASIC CHARACTERISTICS OF OBJECT-ORIENTATION.
Subclasses and Subtypes CMPS Subclasses and Subtypes A class is a subclass if it has been built using inheritance. ▫ It says nothing about the meaning.
The Unified Modeling Language (UML) Class Diagrams.
Enhanced Entity Relationship Modeling © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Enhanced Entity Relationship Modeling Susan D. Urban and.
Inheritance using Java
CISC6795: Spring Object-Oriented Programming: Polymorphism.
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.
Database Management System Prepared by Dr. Ahmed El-Ragal Reviewed & Presented By Mr. Mahmoud Rafeek Alfarra College Of Science & Technology Khan younis.
Specialization and Inheritance Chapter 8. 8 Specialization Specialized classes inherit the properties and methods of the parent or base class. A dog is.
Contract based programming Using pre- and post-conditions, and object invariants Contract based programming1.
Type Conformance Contravariance, Covariance & Closed behavior CSC 422 Dr. Spiegel.
© 2011 Pearson Education 1 Chapter 13 (Online): Object-Oriented Databases Modern Database Management 10 th Edition, International Edition Jeffrey A. Hoffer,
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
E.Bertino, L.Matino Object-Oriented Database Systems 1 Chapter 5. Evolution Seoul National University Department of Computer Engineering OOPSLA Lab.
CSC 480 Software Engineering Design by Contract. Detail Design Road Map Begin with architectural models  Class model: domain classes  Overall state.
CSE 341, S. Tanimoto Java brief review - 1 Java Brief Review Java’s strengths Object-oriented terminology Inheritance Interfaces An example with inheritance.
Protocols Software Engineering II Wirfs Brock et al, Designing Object-Oriented Software, Prentice Hall, Mitchell, R., and McKim, Design by Contract,
© 2007 Lawrenceville Press Slide 1 Chapter 9 Inheritance  One class is an extension of another.  Allows a class to define a specialized type of an existing.
CSSE501 Object-Oriented Development. Chapter 10: Subclasses and Subtypes  In this chapter we will explore the relationships between the two concepts.
Object-Oriented Design Concepts University of Sunderland.
FEN 2014UCN Teknologi/act2learn1 Object-Oriented Programming “ The Three Pillars of OOP”: Encapsulation Inheritance Polymorphism The Substitution Principle.
6-1 Type Conformance and Closed Behavior Constructing class hierarchiesConstructing class hierarchies –need to be careful –two helpful principles: type.
April 20022/CS/3X EER 1 Database Design Enhanced entity-relationship modelling John Wordsworth Department of Computer Science The University of Reading.
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.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
Enhanced Entity-Relationship (EER) Model
The Enhanced Entity- Relationship (EER) Model
Appendix 3 Object-Oriented Analysis and Design
Web Design & Development Lecture 9
Sections Inheritance and Abstract Classes
Object-Oriented Modeling
Use Case Modeling - II Lecture # 27.
The Movement To Objects
The Enhanced Entity- Relationship (EER) Model
Object-Oriented Programming Basics
EKT472: Object Oriented Programming
Component Based Software Engineering
One class is an extension of another.
Design by Contract in Python: Present and Future Aaron Bingham
State Machine Diagrams
Section 11.1 Class Variables and Methods
TIM 58 Chapter 8: Class and Method Design
Type Abstraction SWE Spring 2009.
One class is an extension of another.
Introduction to Components and Specifications Using RESOLVE
Week 6 Object-Oriented Programming (2): Polymorphism
Advanced Programming Behnam Hatami Fall 2017.
Chapter 20 Object-Oriented Analysis and Design
Type Abstraction Liskov, Chapter 7.
Object Oriented Analysis and Design
Enhanced Entity-Relationship (EER) Modeling
Assertions References: internet notes; Bertrand Meyer, Object-Oriented Software Construction; 4/25/2019.
Appendix A Object-Oriented Analysis and Design
Enhanced Entity-Relationship (EER) Modeling
Type Abstraction SWE Spring 2013.
Presentation transcript:

State-Space and Behavior State-Space and Behavior of a Class State-Space of a Subclass Behavior of a Subclass Class Invariant as a Restriction on a State-Space Preconditions and Postconditions

Abstraction by Class A class should represent a uniform abstraction of the properties of the individual objects that belong to that class abstraction: not necessarily every property in the real world uniform: apply to all objects in the class Two properties of a class state-space allowed behavior

State-Space of a Class The ensemble of all the permitted states of any object of the class state: the ordered set of object attribute values at a given time Dimensions of a state-space the coordinates needed to specify the state of a given object basic attributes defined on the class attributes derived from others are not considered as dimensions

Behavior of a Class The set of transitions that an object of the class is permitted to make between states in the state-space transition: change of object state when one or more of the attributes change values usually hop along the dimensions Not all paths in the state-space are allowed in a class

Example: Chess Knight vs. Queen Both have the same state-space chessboard The two classes are different in behavior different moving rules Special Knight (Fig. 10.2 in P. 261) has different state-space from the original knight class

State-Space of a Subclass The state-space of a subclass must be entirely contained within the state-space of its superclass the state-space of a subclass is confined by the state-space of its superclass a subclass usually has narrower ranges of values for the dimensions defined in the superclass The state-space of a subclass may have more dimensions the state-space extends from superclass

Behavior of a Subclass The behaviors of subclass and superclass have the similar relationship as the state-spaces Behavior Confinement closed behavior Behavior Extension extended behavior due to the extended state-space

Class Invariant A class invariant is a condition that every object of that class must satisfy at all times when the object is in equilibrium not in the middle of changing states special rules for attribute values Invariant Checking Points when the object is initialized at instantiation before any operation is executed after any operation is executed A subclass must obey the invariant of its superclass

Preconditions and Postconditions To govern individual operations Every operation has a precondition and a postcondition Precondition a condition that must be true when the operation begins to execute, otherwise, refuse to execute Postcondition a condition that must be true when the operation ends its execution, otherwise, recover and fix

Design by Contract Use preconditions and postconditions as a contract between an operation and the message senders Message senders guarantee that the precondition is true before execution The operations guarantee that the postcondition is true after execution Basic Object-Oriented Design Approach formed by class invariant, preconditions, and postconditions