Top Banner
Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich
28

Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

Dec 16, 2015

Download

Documents

Abel Singleton
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

Chapter 8 AppendixObject-Oriented Analysis and Design:

Object Modeling – Class Diagrams

Modern Systems Analysisand Design

Seventh Edition

Jeffrey A. Hoffer Joey F. George

Joseph S. Valacich

Page 2: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall 2Chapter 8 Appendix

Learning Objectives Concisely define each of the following key data

modeling terms: object, state, behavior, object class, class diagram, operation, encapsulation, association role, abstract class, polymorphism, aggregation, and composition.

Draw a class diagram to represent common business situations.

Explain the unique capabilities of class diagrams compared with E-R diagrams for modeling data.

Page 3: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall 3Chapter 8 Appendix

Representing Objects and Classes

Object: an entity with a well-defined role in an application domain; has state, behavior, and identity characteristics

State: encompasses an object’s properties (attributes and relationships) and the values of those properties

Page 4: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall 4Chapter 8 Appendix

Representing Objects and Classes (Cont.)

Behavior: represents how an object acts and reacts

Identity: uniqueness—no two objects are the same

Object class (class): a logical grouping of objects that have the same (or similar) attributes, relationships, and behaviors (methods)

Page 5: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall 5Chapter 8 Appendix

Representing Objects and Classes (Cont.)

Class diagram: a diagram that shows the static structure of object classes, their internal structure, and the relationships in which they participate

UML classes are analogous to E-R entities.

Page 6: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall

Representing Objects and Classes (Cont.)

6Chapter 8 Appendix

Figure 8-26 UML class diagram showing two classes

Page 7: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall 7Chapter 8 Appendix

Representing Objects and Classes (Cont.)

Operation: a function or a service that is provided by all the instances of a class to invoke behavior in an object by passing a message

Encapsulation: the technique of hiding the internal implementation details of an object from its external view

Page 8: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall 8Chapter 8 Appendix

Types of Operations Constructor: an operation that creates a

new instance of a class Query: an operation that accesses the state

of an object but does not alter the state Update Operation: an operation that alters

the state of an object Class Scope Operation: an operation that

applies to a class rather than an object instance

Page 9: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall 9Chapter 8 Appendix

Representing Associations

Association: a relationship among instances of object classes

Association role: the name given to the end of an association where it connects to a class

Page 10: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall 10Chapter 8 Appendix

Representing Associations (Cont.)

Multiplicity: indicates how many objects participate in a given relationship: 0..10 means minimum of 0 and maximum of 10 1, 2 means can be either 1 or 2 * means any number

UML associations are analogous to E-R relationships and UML multiplicities are analogous to E-R cardinalities.

Page 11: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall 11Chapter 8 Appendix

Representing Associations (Cont.)

Figure 8-27 Examples of association relationships of different degrees

Page 12: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall 12Chapter 8 Appendix

Representing Associations (Cont.)

Figure 8-28 Examples of binary associations

Page 13: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall

Representing Associative Classes Associative class: an association that has

attributes or operations of its own or that participates in relationships with other classes

UML association classes are analogous to E-R associative entities.

Generalization and inheritance are implemented via superclass/subclasses in UML and via supertypes/subtypes in E-R.

13Chapter 8 Appendix

Page 14: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall

Representing Associative Classes (Cont.)

14Chapter 8 Appendix

Figure 8-29 Class diagram showing associative classes

Page 15: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall

Representing Stereotypes for Attributes

15Chapter 8 Appendix

Figure 8-31 Stereotypes

Page 16: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall 16Chapter 8 Appendix

Representing Generalization

Abstract class: a class that has no direct instances but whose descendants may have direct instances

Concrete class: a class that can have direct instances

Page 17: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall

Representing Generalization (Cont.)

17Chapter 8 Appendix

Figure 8-32 Example of generalizations, inheritance, and constraints

Page 18: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall 18Chapter 8 Appendix

Representing Generalization (Cont.)

UML keywords:Overlapping: a descendant may be

descended from more than one of the subclasses

Disjoint: a descendant may not be descended from more than one of the subclasses

Complete: all subclasses have been specified Incomplete: some subclasses have been

specified, but the list is known to be incomplete

Page 19: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall 19Chapter 8 Appendix

Representing Generalization (Cont.)

Class-scope attribute: an attribute of a class that specifies a value common to an entity class, rather than a specific value for an instance

Page 20: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall

Representing Generalization (Cont.)

20Chapter 8 Appendix

Figure 8-33 Polymorphism, abstract operation, class-scope attribute, and ordering

Page 21: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall 21Chapter 8 Appendix

Representing Generalization (Cont.)

Abstract operation: defines the form or protocol of the operation, but not its implementation

Method: the implementation of an operation Polymorphism: the same operation may apply

to two or more classes in different ways

Page 22: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall

Representing Aggregation Aggregation: a part-of relationship

between a component object and an aggregate objectRepresented with open diamonds

Composition: a part object that belongs to only one whole object and that lives and dies with the wholeRepresented with filled diamonds

22Chapter 8 Appendix

Page 23: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall

Aggregation and Composition

23Chapter 8 Appendix

Figure 8-34 Aggregation and composition

Page 24: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall

An Example of Conceptual Data Modeling at Hoosier Burger

24Chapter 8 Appendix

Figure 8-35 Level-0 data flow diagram for Hoosier Burger’s new logical inventory control system

Page 25: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall

An Example of Conceptual Data Modeling at Hoosier Burger (Cont.)

25Chapter 8 Appendix

Figure 8-36 Reduced decision table for Hoosier Burger’s inventory reordering

Page 26: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall

An Example of Conceptual Data Modeling at Hoosier Burger (Cont.)

26Chapter 8 Appendix

Figure 8-38 Final class diagram for Hoosier Burger’s inventory control system

Page 27: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

© 2014 Pearson Education, Inc. Publishing as Prentice Hall

Summary In this appendix you learned how to: Concisely define each of the following key data

modeling terms: object, state, behavior, object class, class diagram, operation, encapsulation, association role, abstract class, polymorphism, aggregation, and composition.

Draw a class diagram to represent common business situations.

Explain the unique capabilities of class diagrams compared with E-R diagrams for modeling data.

27Chapter 8 Appendix

Page 28: Chapter 8 Appendix Object-Oriented Analysis and Design: Object Modeling – Class Diagrams Modern Systems Analysis and Design Seventh Edition Jeffrey A.

Copyright © 2014 Pearson Education, Inc.  Copyright © 2014 Pearson Education, Inc.  Publishing as Prentice HallPublishing as Prentice Hall