Basic Structural Modeling. Copyright Joey Paquet,

Similar documents
Introduction to UML Dr. Rajivkumar S. Mente

Software Design Methodologies and Testing. (Subject Code: ) (Class: BE Computer Engineering) 2012 Pattern

Architecture and the UML

LABORATORY 1 REVISION

user.book Page 45 Friday, April 8, :05 AM Part 2 BASIC STRUCTURAL MODELING

Introduction to UML. Danang Wahyu utomo

Allenhouse Institute of Technology (UPTU Code : 505) OOT Notes By Hammad Lari for B.Tech CSE V th Sem

Advanced Software Engineering

A - 1. CS 494 Object-Oriented Analysis & Design. UML Class Models. Overview. Class Model Perspectives (cont d) Developing Class Models

UNIT 5 - UML STATE DIAGRAMS AND MODELING

Chapter 10. Object-Oriented Analysis and Modeling Using the UML. McGraw-Hill/Irwin

A Conceptual Model of the UML

UNIT V *********************************************************************************************

Object-Oriented Systems Analysis and Design Using UML

UNIT-II I. BASIC STRUCTURAL MODELING

Object-Oriented and Classical Software Engineering

Lesson 11. W.C.Udwela Department of Mathematics & Computer Science

S T R U C T U R A L M O D E L I N G ( M O D E L I N G A S Y S T E M ' S L O G I C A L S T R U C T U R E U S I N G C L A S S E S A N D C L A S S D I A

COSC 3351 Software Design. An Introduction to UML (I)

Interactions A link message

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

UNIT-IV BASIC BEHAVIORAL MODELING-I

IS 0020 Program Design and Software Tools

UML Fundamental. OutLine. NetFusion Tech. Co., Ltd. Jack Lee. Use-case diagram Class diagram Sequence diagram

Unit II. Advanced Structural Modeling

UNIT II. Syllabus. a. An Overview of the UML: Visualizing, Specifying, Constructing, Documenting

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

Unified Modeling Language (UML) Class Diagram

THE UNIFIED MODELING LANGUAGE

Ingegneria del Software Corso di Laurea in Informatica per il Management. Introduction to UML

Introduction to UML CHAPTER 1. Visualizing. Specifying LEARNING OBJECTIVES

Introducing the UML Eng. Mohammed T. Abo Alroos

Pertemuan 8. Object Oriented Modeling and Design

COMN 1.1 Reference. Contents. COMN 1.1 Reference 1. Revision 1.1, by Theodore S. Hills, Copyright

UML Tutorial. Unified Modeling Language UML Tutorial

Modellistica Medica. Maria Grazia Pia, INFN Genova. Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico

Vidyalankar. T.Y. Diploma : Sem. VI [IF/CM] Object Oriented Modeling and Design Prelim Question Paper Solution

What is a Class Diagram? A diagram that shows a set of classes, interfaces, and collaborations and their relationships

What is a Class Diagram? Class Diagram. Why do we need Class Diagram? Class - Notation. Class - Semantic 04/11/51

Class diagrams. Modeling with UML Chapter 2, part 2. Class Diagrams: details. Class diagram for a simple watch

Analysis and Design with UML

Chapter 5: Structural Modeling

A l Ain University Of Science and Technology

Software Service Engineering

OMG Modeling Glossary B

UML UNIFIED MODELLING LANGUAGE EXEMPLIFIED ON BLACKJACK. Object Oriented Programming (Samy Zafrany)

CHAPTER 9 DESIGN ENGINEERING. Overview

UNIT-II Introduction to UML

CHAPTER 5 CO:-Sketch component diagram using basic notations 5.1 Component Diagram (4M) Sample Component Diagram 5.2 Deployment Diagram (8M)

CASE TOOLS LAB VIVA QUESTION

UML Unified Modeling Language

INTRODUCING THE UML. Chapter 2

SOFTWARE ENGINEERING UML FUNDAMENTALS. Saulius Ragaišis.

06. Analysis Modeling

Object-Oriented Design

UNIT-4 Behavioral Diagrams

CS/IT Secure Software Construction

Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques. Fundamentals, Design, and Implementation, 9/e

APPENDIX M INTRODUCTION TO THE UML

Introduction to Software Engineering. 5. Modeling Objects and Classes

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) MODEL ANSWER

UML 2.0 UML 2.0. Scott Uk-Jin Lee. Division of Computer Science, College of Computing Hanyang University ERICA Campus

Class diagrams. Modeling with UML Chapter 2, part 2. Class Diagrams: details. Class diagram for a simple watch

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

Object-Oriented Design

For 100% Result Oriented IGNOU Coaching and Project Training Call CPD TM : ,

A l Ain University Of Science and Technology

Chapter 1: Principles of Programming and Software Engineering

Topics. Overview- The UML Functional Model. Structural Model. Behavioral Models. Use Case Diagram (essential and system)

CSE 403: Software Engineering, Spring courses.cs.washington.edu/courses/cse403/15sp/ UML Class Diagrams. Emina Torlak

University of Calgary Department of Electrical and Computer Engineering. SENG : Object Oriented Analysis and Design Behrouz Homayoun Far

OO Analysis and Design with UML 2 and UP

Practical UML - A Hands-On Introduction for Developers

Unified Modeling Language (UML) and Modeling

Relationships. Association Aggregation/Composition Multiplicity Dependencies

UML REFERENCE SHEETS. 2013, 2014 Michael Marking; all rights reserved, including moral rights. Web site:

Models are used for several purposes. We believe that some of the most important are:

Enterprise Architect. User Guide Series. UML Models. Author: Sparx Systems. Date: 30/06/2017. Version: 1.0 CREATED WITH

Structured and Object Oriented Analysis and Design

UML Views of a System

Introduction to Software Engineering. ECSE-321 Unit 9 Architectural Design Approaches

12 Tutorial on UML. TIMe TIMe Electronic Textbook

Chapter 2: The Object-Oriented Design Process

Chapter 2 Entity-Relationship Data Modeling: Tools and Techniques. Fundamentals, Design, and Implementation, 9/e

Practical UML : A Hands-On Introduction for Developers

What are the characteristics of Object Oriented programming language?

Modeling with UML. (1) Use Case Diagram. (2) Class Diagram. (3) Interaction Diagram. (4) State Diagram

Object-Oriented Software Engineering Practical Software Development using UML and Java

Developing Shlaer-Mellor Models Using UML

Object-Oriented Systems Development: Using the Unified Modeling Language

Lab Manual. Object Oriented Analysis And Design. TE(Computer) VI semester

BPMN Getting Started Guide

Progress Report. Object-Oriented Software Development: Requirements elicitation (ch. 4) and analysis (ch. 5) Object-oriented software development

History of object-oriented approaches

CS 451 Software Engineering

OBJECT ORIENTED ANALYSIS AND DESIGN

The three element types, connected by relations, can form sentences of sorts.

StarUML Documentation

UML Class Diagrams Revisited

CHAPTER 1. Topic: UML Overview. CHAPTER 1: Topic 1. Topic: UML Overview

Transcription:

Basic Structural Modeling Copyright Joey Paquet, 2000 1

Part I Classes Copyright Joey Paquet, 2000 2

Classes Description of a set of objects sharing the same attributes, operations and semantics Abstraction of the things that are part of the application domain vocabulary Can represent software, hardware or conceptual things Copyright Joey Paquet, 2000 3

Names Terms and Concepts nouns drawn from the application domain vocabulary, beginning with a capital letter short but long enough to carry a meaning can include the path of the package(s) it belongs to Copyright Joey Paquet, 2000 4

Attributes Terms and Concepts named properties of a class representing the state of the objects extension of classical data structures can include type and default values Copyright Joey Paquet, 2000 5

Operations Terms and Concepts implementation of a behavior or service messages that can be understood by the class verb or verb phrase describing the intended behavior can define the interface of the functions Copyright Joey Paquet, 2000 6

Terms and Concepts Organizing Attributes and Operations some attributes and operations can be omitted they can be organized using stereotypes Copyright Joey Paquet, 2000 7

Responsibilities Terms and Concepts defines the requirements of classes expressed as form-free text can be used in early stages for abstraction Copyright Joey Paquet, 2000 8

Common Modeling Techniques Modeling the vocabulary of the system identify things that users use to describe the problem identify things that implementers use to describe the solution for each class, identify a set of responsibilities provide the attributes and operations needed to carry out these responsibilities aggregate related clusters into packages Copyright Joey Paquet, 2000 9

Common Modeling Techniques Modeling the distribution of responsibilities in a system identify a set of classes that work together to carry out some behavior identify a set of responsibilities for these classes aggregate classes that have too few responsibilities split classes that have too many responsibilities consider the workload involved by each responsibility and distribute the load evenly Copyright Joey Paquet, 2000 10

Hints and Tips When you model, define classes that are an abstraction of something drawn either from the vocabulary of the problem or the solution embody a small, well-defined set of responsibilities are understandable, simple, extensible and adaptable Copyright Joey Paquet, 2000 11

Hints and Tips When you draw class diagrams show only those properties of the class that important in the current context organize long lists of attributes and operations using stereotypes show related classes in the same diagrams Copyright Joey Paquet, 2000 12

Part II Relationships Copyright Joey Paquet, 2000 13

Relationships Very few classes stand alone Classes collaborate to respond to service requests We must model the interactions between objects and classes Dependencies: uses relationships Generalizations: subclass/superclass relationships Associations: structural relationships Copyright Joey Paquet, 2000 14

Relationships Copyright Joey Paquet, 2000 15

Dependencies Terms and Concepts a change in the state of an object may affect the behavior of the depending object a class uses another in its behavior drawn as a dashed directed line most often used to show that one of the operations uses another class as an argument dependencies can be used at various levels of abstraction Copyright Joey Paquet, 2000 16

Generalizations Terms and Concepts relationship between a general thing (parent) and a more specific thing (child) of the same kind the child inherits the attributes and operations of the parent class operations can be redefined in the child and override the operations of the parent (polymorphism) drawn as a directed line with open arrowhead Copyright Joey Paquet, 2000 17

Terms and Concepts 5-3 Copyright Joey Paquet, 2000 18

Associations Terms and Concepts used to show structural relationships where none of the classes is part of the other drawn as a solid line connecting classes Name of an association describes the nature of the relationship can include the direction of the relationship drawn as a tag on the middle of the association 5-4 Copyright Joey Paquet, 2000 19

Terms and Concepts Roles of an association identifies the role that each class plays in the relationship drawn as a tag on the near end of the association same class can play different roles in different contexts Copyright Joey Paquet, 2000 20

Terms and Concepts Defining multiplicity in an association shows how many objects of the same type are involved in the association similar to multiplicity defined in entity-relationship diagrams Copyright Joey Paquet, 2000 21

Aggregation Terms and Concepts an association where one class is part of the other (has-a relationship) drawn as a solid line with a diamond on the whole side of the relation Copyright Joey Paquet, 2000 22

Common Modeling Techniques Modeling simple dependencies e.g. dependency between a class and a class being a parameter in one of its operations can be omitted if the signature of the operations is provided in the class description Copyright Joey Paquet, 2000 23

Common Modeling Techniques Modeling single inheritance some classes that have common behavior or structure can be have a common superclass given a set of classes, look for responsibilities, attributes and operations common to two or more classes elevate these elements to a more general class without introducing too many levels specify that the children inherit from the parent using a generalization relationship from children to parent multiple inheritance is allowed, cyclic inheritance is not Copyright Joey Paquet, 2000 24

Common Modeling Techniques Modeling structural relationships for each pair of classes, if you need to navigate between the two, define an association between them (datadriven associations) for each pair of classes, if an interaction is needed between the two (other than parameters to an operation) specify an association between the two (behaviordriven associations) for each of these associations, define their multiplicity if one of the classes is a part of the other, make it an aggregation Copyright Joey Paquet, 2000 25

Common Modeling Techniques Copyright Joey Paquet, 2000 26

When you model Hints and Tips use dependencies only when the relationship is not structural use generalizations only when you have a is-kind-of relationship cyclical generalization is not allowed inheritance trees should not be too deep nor too wide Copyright Joey Paquet, 2000 27

When you draw Hints and Tips use rectilinear or oblique lines consistently avoid lines that cross show only relationships that are necessary to the understanding of the diagram in the current context Copyright Joey Paquet, 2000 28

Part III Common Mechanisms Copyright Joey Paquet, 2000 29

Common Mechanisms Some important facts about a design might not be expressible in the basic UML notation notes version number of components constraints on dependencies Copyright Joey Paquet, 2000 30

Notes Terms and Concepts a graphical symbol used to attach comments or constraints to an element drawn as a rectangle with a dog-eared corner containing a textual or graphical comment it does not carry any semantic impact Tagged values extension of the properties of a UML element drawn as a string enclosed in {brackets} Copyright Joey Paquet, 2000 31

Stereotypes Terms and Concepts extension of the vocabulary of the UML used to create new kinds of building blocks drawn as a name enclosed in <<guillemets>> can be represented as a new kind of icon Constraint extension of the semantics of a UML element drawn as a string enclosed in {brackets} can be put in a note Copyright Joey Paquet, 2000 32

Hints and Tips Use notes only for facts that can t be expressed using the UML Use notes to specify work in progress Don t use too many or large notes Standardize the use of stereotypes, tagged values and constraints Don t use too many graphical stereotypes Use only general and simple additions Copyright Joey Paquet, 2000 33

Part IV Diagrams Copyright Joey Paquet, 2000 34

Simplification of reality Diagrams Using a limited set of general-use building blocks Different types of diagrams are used to represent the system in different perspectives Good diagrams make the system more understandable Choosing the right diagrams forces you to ask the right questions and illuminate their implications Copyright Joey Paquet, 2000 35

Terms and Concepts Structural diagrams Used to visualize, specify, construct and document the static aspects of the system Represents the skeleton of the system Copyright Joey Paquet, 2000 36

Terms and Concepts Structural diagrams Class diagram a set of classes interfaces, collaborations and their relationships used to render the static design view of a system Object diagram same as class diagram, but for instances snapshot of the relations between objects in a hypothetical situation Copyright Joey Paquet, 2000 37

Terms and Concepts Structural diagrams Component diagrams shows a set of software components and their relationships used to render a static implementation view of the system Deployment diagrams shows a set of nodes and their relations used to render the static deployment view of the system more abstract version of component diagrams Copyright Joey Paquet, 2000 38

Terms and Concepts Behavioral diagrams Used to visualize, specify, construct and document the dynamic aspects of the system Represents the behavior of the system Copyright Joey Paquet, 2000 39

Terms and Concepts Behavioral diagrams Use case diagrams shows a set of use cases and actors and their relationships shows the different views that are possible on the system defines subsets of classes (and their interactions) that are needed to achieve a certain goal of the system Copyright Joey Paquet, 2000 40

Terms and Concepts Behavioral diagrams Sequence diagrams defines the time ordering of messages exchanged between a set of objects shows a set of objects and the messages sent and received between these objects towards the realization of a certain service Copyright Joey Paquet, 2000 41

Terms and Concepts Behavioral diagrams Collaboration diagrams defines all the dynamic interactions between a set of objects shows a set of objects, links among those objects, and messages sent and received by those objects in the general case (not related to a specific service) Sequence and collaboration diagrams carry the same information but not in the same context Copyright Joey Paquet, 2000 42

Terms and Concepts Behavioral diagrams Statechart diagram defines a behavior that specifies the sequences of states an object goes through during its lifetime in response to events, together with its responses to those events emphasizes the event-ordered behavior of an object used to model the behavior of an interface, class or collaboration between classes Copyright Joey Paquet, 2000 43

Terms and Concepts Behavioral diagrams Activity diagram defines the flow of control among objects shows the flow from activity to activity within the system shows a set of activities, the sequential or branching flow between activities and objects that act or are acted upon in the activity Copyright Joey Paquet, 2000 44

Common Modeling Techniques Modeling different views of a system views are the different dimensions from which the system can be represented different views expose different aspects of the problem or see the same aspect in a different context must find the right set of views must focus on different views separately, and then find a compromise for common parts Copyright Joey Paquet, 2000 45

Common Modeling Techniques Modeling different views of a system decide which views best express the architecture and expose all problems for each of these views, chose which kind of diagrams you will use to capture its details decide which of these will be part of the documentation unused diagrams should not be thrown away Copyright Joey Paquet, 2000 46

Common Modeling Techniques Modeling different levels of abstraction different people involved in the development have different needs the different kinds of diagrams propose a different view on the system some people need abstract information, others need exact information several versions of the same diagram, at various levels of abstraction, might be needed Copyright Joey Paquet, 2000 47

Common Modeling Techniques Modeling different levels of abstraction consider the different needs of the readers create different abstraction levels for diagrams that are read by different readers hide or reveal building blocks and relationships hide or expand messages and transitions that are essential to understanding reveal only adornments that are essential to understanding (e.g. classifying stereotypes) Copyright Joey Paquet, 2000 48

Hints and Tips When you design a diagram diagrams are a tool, they do not need to be cute not all diagrams are meant to be preserved find an goal and an audience for each diagram and show only the information needed to explain the solution to the intended audience give meaningful names to all diagrams group diagrams into packages Copyright Joey Paquet, 2000 49

Hints and Tips A well structured diagram is focused on communicating one aspect of the system contains only those elements that are essential to understanding that aspect provides details consistent with its level of abstraction Copyright Joey Paquet, 2000 50

Hints and Tips When you draw a diagram give it a name that communicates its purpose lay out elements to minimize lines that cross lay out related elements close to one another use colors and notes to draw attention on important features Copyright Joey Paquet, 2000 51

Part V Class Diagrams Copyright Joey Paquet, 2000 52

Class Diagrams Most common diagram used to model object-oriented systems Shows a set of classes, interfaces, and collaborations and their relationships Models the static design view of the system Involves modeling the vocabulary of the system requirements specifications Copyright Joey Paquet, 2000 53

Terms and Concepts Class diagrams commonly contain classes interfaces collaborations relationships notes and constraints packages or subsystems Copyright Joey Paquet, 2000 54

Terms and Concepts Common uses model the static design view to support the functional requirements of the system model the vocabulary of the system: first define classes and their responsibilities, and then refine towards attributes, operations model simple collaborations: define the interactions between classes towards the definition of a common behavior model a database schema: data elements are attributes, tables are classes, and relationships are relationships Copyright Joey Paquet, 2000 55

Common Modeling Techniques Modeling simple collaborations identify the mechanism to model. for each mechanism, identify the classes, interfaces, and other collaborations that participate in this collaboration; as well as their relationships use scenarios to walk through these things populate these elements with their required contents (attributes and operations) first starting with responsibilities Copyright Joey Paquet, 2000 56

Example Copyright Joey Paquet, 2000 57

Common Modeling Techniques Modeling a logical database schema identify the classes whose state must transcend the lifetime of their application create a class diagram for these and mark them as <<persistent>> with a tagged value define their attributes and associations (and their cardinalities) define data-specific operations on these classes Copyright Joey Paquet, 2000 58

Example of Database Schema Copyright Joey Paquet, 2000 59

Hints and Tips A well-structured class diagram is focused on communicating only one aspect of the system s static design provides only the details that are consistent with its associated level of abstraction is not minimalist Copyright Joey Paquet, 2000 60

Hints and Tips When you draw a class diagram give it a name that communicates its purpose minimize line crossing use colors and notes to emphasize important aspects lay out related elements close to one another Copyright Joey Paquet, 2000 61