Class Diagrams in Analysis

Similar documents
From Analysis to Design. LTOOD/OOAD Verified Software Systems

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

XV. The Entity-Relationship Model

Lecture 5 STRUCTURED ANALYSIS. PB007 So(ware Engineering I Faculty of Informa:cs, Masaryk University Fall Bühnová, Sochor, Ráček

Äriprotsesside modelleerimine ja automatiseerimine Loeng 7 Valdkonna mudel

2004 John Mylopoulos. The Entity-Relationship Model John Mylopoulos. The Entity-Relationship Model John Mylopoulos

IS 263 Database Concepts

The Unified Modeling Language (UML)

SOFTWARE ENGINEERING Prof.N.L.Sarda Computer Science & Engineering IIT Bombay. Lecture #10 Process Modelling DFD, Function Decomp (Part 2)

Data Modeling During System Analysis. Logical Data Model Stages. What is Conceptual Database Design? Gathering Information for Conceptual

SE 1: Software Requirements Specification and Analysis

Using High-Level Conceptual Data Models for Database Design A Sample Database Application Entity Types, Entity Sets, Attributes, and Keys

Database Systems. Overview - important points. Lecture 5. Some introductory information ERD diagrams Normalization Other stuff 08/03/2015

Information Technology Audit & Cyber Security

Database Systems. A Practical Approach to Design, Implementation, and Management. Database Systems. Thomas Connolly Carolyn Begg

Lecture 09. Spring 2018 Borough of Manhattan Community College

Unified Modeling Language (UML)

Database Design with Entity Relationship Model

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

Conceptual and Logical Design

Chapter 2: Entity-Relationship Model

Object-Oriented Analysis and Design

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

Related download: Instructor Manual for Modern Database Management 12th Edition by Hoffer Venkataraman Topi (Case studies included)

Ch t 8 Chapter 8. System Models

Software Engineering I (02161)

Chapter 6: Entity-Relationship Model. The Next Step: Designing DB Schema. Identifying Entities and their Attributes. The E-R Model.

OO System Models Static Views

Conceptual Database Design (ER modeling) Chapter Three

Entity Relationship Modelling

The Next Step: Designing DB Schema. Chapter 6: Entity-Relationship Model. The E-R Model. Identifying Entities and their Attributes.

Basic Structural Modeling. Copyright Joey Paquet,

Database Applications (15-415)

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

Software Specification 2IX20

Software Life-Cycle Models

Domain Modeling. CSSE 574: Week 1, Part 3. Steve Chenoweth Phone: Office (812) Cell (937)

Represent entities and relations with diagrams

Conceptual Database Design

Class modelling (part 2)

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Domain Model and Domain Modeling

Lecture 8: Use Case -Driven Design. Where UML fits in

Software Modeling & Analysis

Data Analysis 1. Chapter 2.1 V3.1. Napier University Dr Gordon Russell

Software Engineering - I

Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition. Chapter 7 Data Modeling with Entity Relationship Diagrams

A l Ain University Of Science and Technology

Class modelling (part 2)

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

Chapter 2 Conceptual Modeling. Objectives

Logical E/R Modeling: the Definition of Truth for Data

The Unified Modeling Language. Asst.Prof.Dr. Supakit Nootyaskool IT-KMITL

Introduction to Software Engineering (2+1 SWS) Winter Term 2009 / 2010 Dr. Michael Eichberg Vertretungsprofessur Software Engineering Department of

A l Ain University Of Science and Technology

Objectives Definition iti of terms Importance of data modeling Write good names and definitions for entities, relationships, and attributes Distinguis

Chapter 6: Entity-Relationship Model

Conceptual Database Design. COSC 304 Introduction to Database Systems. Entity-Relationship Modeling. Entity-Relationship Modeling

Goal: build an object-oriented model of the realworld system (or imaginary world) Slicing the soup: OOA vs. OOD

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

Computer Science for Engineers

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

Modern Systems Analysis and Design Seventh Edition

Enhanced Entity-Relationship (EER) Modeling

Database Design Process

Conceptual Modeling in ER and UML

Credit where Credit is Due. Lecture 4: Fundamentals of Object Technology. Goals for this Lecture. Real-World Objects

LECTURE 3: ENTITY-RELATIONSHIP MODELING

DATABASE SYSTEMS. Chapter 5 Entity Relationship (ER) Modelling DESIGN IMPLEMENTATION AND MANAGEMENT INTERNATIONAL EDITION ROB CORONEL CROCKETT

Essentials of Database Management (Hoffer et al.) Chapter 2 Modeling Data in the Organization

Course "UML and Design Patterns" of module "Software Engineering and Design", version February 2011 (X)

1/24/2012. Chapter 7 Outline. Chapter 7 Outline (cont d.) CS 440: Database Management Systems

Chapter (4) Enhanced Entity-Relationship and Object Modeling

Conceptual Data Modeling by David Haertzen

Chapter 2: The Object-Oriented Design Process

MIS2502: Data Analytics Relational Data Modeling - 1. JaeHwuen Jung

Entity-Relationship Modelling. Entities Attributes Relationships Mapping Cardinality Keys Reduction of an E-R Diagram to Tables

Introduction to Software Engineering. 6. Modeling Behaviour

Problem. Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications

UML Modeling I. Instructor: Yongjie Zheng September 3, CS 490MT/5555 Software Methods and Tools

Chapter 4. Enhanced Entity- Relationship Modeling. Enhanced-ER (EER) Model Concepts. Subclasses and Superclasses (1)

COMP 354: INTRODUCTION TO SOFTWARE ENGINEERING

Introduction to Software Engineering. 5. Modeling Objects and Classes

Intro to DB CHAPTER 6


Software Service Engineering

Chapter 6: Entity-Relationship Model

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

Chapter 4. In this chapter, you will learn:

Object Oriented Design. Program Design. Analysis Phase. Part 2. Analysis Design Implementation. Functional Specification

Full file at

Chapter 6: Entity-Relationship Model

Carnegie Mellon Univ. Dept. of Computer Science /615 - DB Applications. Problem. Faloutsos - Pavlo CMU SCS /615

course 3 Levels of Database Design CSCI 403 Database Management Mines Courses ERD Attributes Entities title 9/26/2018

Today s Topic. Lecture 5. What is UML? Why Use UML. UML Diagrams. Introduction to UML. What is UML Why use UML? UML Diagrams

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

The Entity-Relationship Model. The Entity-Relationship model. The ER model. The Entity-Relationship model. E-R Model Constructs. E-R Model Constructs

Software Engineering Fall 2015 (CSC 4350/6350) TR. 5:30 pm 7:15 pm. Rao Casturi 09/29/2015

Object Design II: Design Patterns

MSc programme (induction week) Department of Informatics INTRODUCTION TO UML

Transcription:

3.2 Subject/Topic/Focus: Introduction to Classes Summary: Conceptual Modeling Notation: Classes Associations: Multiplicity, Roles, Aggregation, Composition Generalization Objects Analysis Process Literature: [Fowler99] [Booch98] 3.2.1 Role of Class Diagrams Use Case Diagrams Activity Diagrams structures are refined by Interaction Diagrams inter-class behavior: describe control flow between classes structuring Package Diagrams Class Diagrams intra-class behavior: describe states and state transitions in classes scenarios: describe typical interaction sequences between classes State Diagrams Class diagrams are central for analysis, design and implementation. Class diagrams are the richest notation in UML. 3.2.2 3.2.1

Conceptual Modeling of Classes Goal: Conceptual perspective represents the concepts belonging to the classes provides language independence Resources class diagram class relationship object diagram object (as an instance of a class) reference 3.2.3 Class Diagram A class diagram is a graphical representation of a static view on declarative, static elements. Class diagrams contain: packages classes relationships Sales & Distribution Relationship Package Class 3.2.4 3.2.2

Class in the Conceptual Class Diagram A class is the description of a set of objects having similar attributes, operations, methods, relationships and behavior. A class has name description (responsibility, job) attributes name description, optional: type (methods) Alternative, compact representation without details customerno :Int name :String Name Attribute Type 3.2.5 Association An association is a semantic relationship between classes which concerns the connection (e.g., references) between its instances. Notation: name multiplicity description (extracted from use cases) Multiplicity 1 gives Name An order is done by exactly one customer. Each customer can give no or several orders. 3.2.6 3.2.3

Multiplicity The multiplicity of an association defines the valid range of values for the number of objects taking part in the association. Notation: Example: number 1 3,4 number..number 0..1 1..2 0..1,4 number.. 1.. 2.. no number Equivalent to 0.. 3.2.7 Role A role in an association is a name describing the participation of the class in the association more exactly. Notation: Lecture Teaching field Available lecturer can read Professor reads Teaching offer Lecturer Role name 3.2.8 3.2.4

Aggregation / Composition An aggregation resp. composition is a semantic relationship between an aggregate A and a component B. B is a part of A. Possible properties of the aggregation: dependent existence of the component (component may not exist without aggregate and dies with it) exclusive aggregation (component can only be component of a single aggregate) transitivity of the component relationship Notation: Aggregation 0..1 Position Aggregate Component Aggregation Decomposition 3.2.9 Generalization Generalization is a semantic relationship between a general concept A (super class) and a more special concept B (sub class). B specializes A, each B is an A For classes: Inheritance builds a taxonomy. [Possible properties of generalization follow later] Notation(s): Super class Freelancer Employee Staff Freelancer Employee Staff Specialization Generalization Sub class 3.2.10 3.2.5

Constraint and Note Constraints and notes annotate among other things associations, attributes and classes. Constraints are semantic restrictions noted as an expression. customerno:integer {value > 0} 1 {Σ orders >= $50} may be canceled Constraint Constraint Note Notes may contain constraints also. 3.2.11 Object Diagram An object diagram shows objects (instances of classes), optional their states and relationships, at a certain point in time. Parts: objects references Notation: a2: Article name= teacup a1: Article name= teapot hw: customerno=14 name= Holm b: date=18.5.1999 Object (directed) Reference 3.2.12 3.2.6

Analysis Algorithm Method Create conceptual class diagram Input: Specification.UseCaseModel, Specification.Glossary Output: Specification.ConceptualClassDiagram Processing: refine specification Specification.ConceptualClassDiagram:= Ø repeat Find new classes and attributes Find new associations Document classes and relationships Discuss the result with the customer until customer and developer satisfied 3.2.13 Classification of the Analysis Process There are several development processes focussing on the information (data) of the system focussing on the functionality (behavior) of the system synthesis of both processes The development process treated in this lecture, described in Unified Software Development Process [Jacobson et.al. 1999] for object-oriented analysis is a synthesis: Initialization by the functionality (use case diagrams) Refinement by the information (class diagrams) Consolidation by the functionality (collaboration diagrams) 3.2.14 3.2.7

Analysis: Find Classes (1) 1. Method: Identify classes by nouns Relevant documents: specification, use case documentation, glossary, forms, technical system descriptions, interview notes,... Identify nouns (concepts) being relevant for the problem grasp Technique: Underline nouns in the text, better too many nouns than too few Identify synonyms, acronyms and special terms. Two different names are synonyms if they designate the same concept. An acronym is a name built out of the initials of a name. Identify homonyms. A homonym is a name describing two (different) concepts. Note: The class diagram details the part of the glossary that is relevant for the specification. 3.2.15 Analysis: Find Classes (2) 2. Categorize the nouns Concrete objects resp. things, e.g., car Persons and their roles, e.g., customer, employee, lecturer Information about actions, e.g., bank transfer Places, e.g., waiting room Organizations, e.g., branch Interfaces of the system, e.g., list, choice list Relations between classes, e.g., rental agreement between customer and rented object General and subject oriented information, e.g., article, seminar type 3.2.16 3.2.8

Analysis: Find Classes (3) 3. Delete nouns and concepts, which don t represent any independent conceptual classes It s not the goal to identify as many classes as possible or simple classes only. Deleted nouns may be collected in a To-Do-List because they may helpful to identify relevant attributes, operations and relationships. Delete names for roles which relate a class to another class. Indications for nouns to delete: Neither attributes nor operations can be identified. The noun models implementation details. The class contains only operations which can be attached to other classes. 3.2.17 Analysis: Find Classes (4) 4. Choose meaningful and substantial class names PCMCIA Personal People Each class name should Computer Can t be a noun in singular, be chosen as concrete as possible, Memory Card Memorize Computer International Industry be no homonym, Association Acronyms be rarely an acronym, represent the entirety of the attributes and operations. 5. Document each class in short One defining sentence, e.g., A seminar entry is a document representing the registration of a customer to a seminar. List of the synonyms, optional: distinction from other classes Synonyms: registration, reservation 3.2.18 3.2.9

Analysis: Find Attributes 1. Identify attributes following the noun method Identify relevant attributes of each class for the specification. Record artificial key attributes only when they are application-specific, e.g., customer number. 2. Check the attribute name Each attribute name should be a noun in singular or plural, chosen as concrete as possible, no homonym. 3. Define the type of the attributes In the conceptual class diagram the type can stay unspecified or specified lazily. Complex structured types should be replaced by independent classes. 3.2.19 Example: Point of Sale Terminal (1) A Point of Sale Terminal (POST) is a computer-assisted system to support sales, payments and payoffs in a commercial transaction. It contains hardware components (computer, display, bar code scanner,...) and software components. Buy items Log in Refund purchased items Cashier 3.2.20 3.2.10

Example: Point of Sale Terminal (2) Use case description Use Case: Buy item 1. This use case begins when a customer arrives at a POST checkout with items to purchase. 2. The cashier records the universal product code (UPC) from each item. 3. The System determines the item price and adds the item to the running sales transaction. 4. If there is more than one of the same item, the cashier can enter the quantity as well. 5. The description and the price of the current item are displayed. 6.... 3.2.21 Example: Point of Sale Terminal (3) POST Sale Manager Item Cashier Payment Product Catalog Product Specification Sales LineItem Store Primary identified classes Classes identified iteratively 3.2.22 3.2.11

Analysis: Find Associations (1) 1. Identify possible associations between objects Find in the relevant documents verbs and nouns identifying actions or processes in the problem description. Identify the concerned classes for each association. Prefer binary associations (i.e., with two concerned classes). 2. Categorize these associations spatial distance (is close to) action (drives, books) communication (talks with) property (has) general relation (depends on, is married with) 3.2.23 Analysis: Find Associations (2) 3. Delete non-conceptual associations Delete non-permanent relations Delete associations that are irrelevant for the specification Delete implementation-oriented associations 4. Define association and role names if necessary In most cases associations are defined unambiguously by the participating classes. In this case association and role names are not needed. Otherwise (e.g., for recursive associations) define a name (a verb or a verbal phrase) for the association a role name for each class taking part in the association a sentence describing the semantics of the association. 3.2.24 3.2.12

Analysis: Find Associations (3) 5. Determine the multiplicity of each role of each association Is it a must-relation? Cardinality 1.. Once the object is created, the relation to the other object must be synthesized, too. Is it a can-relation? Cardinality 0.. The relation can be created at any point in time after the creation of the object. Is the ceiling fixed or variable? Is a ceiling mandatory regarding the application? Cardinality..k In case of doubt always work with the variable ceiling! Do special conditions apply? Even number, lower limit,... Note: In case of a fixed multiplicity k (e.g., 2 as lower limit and ceiling) you should consider k separate associations, if appropriate. 3.2.25 Analysis: Find Associations (4) 6. Distinguish associations and aggregations by the following rules of thumb: May the relation described by consists of or is part of? (Collection, container, whole & parts, group & members,...) Is the multiplicity on one side of the association 1 or 0..1? Is the association transitive and asymmetric? Do the components belong to a subsystem? Are the part objects accessed exclusively by the aggregate object? Is the lifetime of the component restricted by the lifetime of the aggregate? Note: Attributes are aggregated by their classes, but they don t have any independent existence and so they can t take part in relations independent from their classes. 3.2.26 3.2.13

Example (more details than in the lecture): - Associations 1 Association Multiplicity : We have customers who may order several products. We distinguish corporate customers from personal customers, since corporate customers are billed monthly whereas personal customers need to prepay their orders with a credit card. We want our orders to be lined up product by product. Each line should contain the amount and the price of each product. 3.2.27 Example: - Generalization Generalization 1 Corporate Personal : We have customers who order our products. We distinguish corporate customers from personal customers, since corporate customers are billed monthly whereas personal customers need to prepay their orders with a credit card. We want our orders to be lined up product by product. Each line should contain the amount and the price of each product. 3.2.28 3.2.14

Example: - More Associations Role name 1 1 Line item Line 1 Product Corporate Personal : We have customers who order our products. We distinguish corporate customers from personal customers, since corporate customers are billed monthly whereas personal customers need to prepay their orders with a credit card. We want our orders to be lined up product by product. Each line should contain the amount and the price of each product. 3.2.29 Example: - Attributes & Operations datereceived isprepaid number:string price:money dispatch() close() Attributes Operations name address creditrating() : We have customers who order our products. We distinguish corporate customers from personal customers, since corporate customers are billed monthly whereas personal customers need to prepay their orders with a credit card. We want our orders to be lined up product by product. Each line should contain the amount and the price of each product. 3.2.30 3.2.15

Example: - Full Class Diagram datereceived isprepaid number:string price:money dispatch() close() Multiplicity: mandatory 1 Association Generalization Constraint name address creditrating() Role name Line item Line quantity:integer price:money issatisfied:bool 1 {If.customer.creditRating is poor, then.isprepaid must be true} 1 Attributes Operations Product Corporate contactname creditrating creditlimit Remind() billformonth(int) Personal creditcard# Multiplicity: optional 0..1 Multiplicity: many-valued Employee 3.2.31 Next lab course - Literature Monday, 8 January 2001 No lab course on Monday, 1 January Exercises for the preparation of the next lab course are made available on the homepage of this lecture We try to cover the latest version 1.3 of UML in this lecture. If you use UML distilled by Martin Fowler for further reading, either use UML Distilled, Second Edition, 1999 [Fowler99] or The older UML Distilled, 1997 [Fowler97] in combination with the extensions available via http://www.sts.tu-harburg.de/intranet/uml/umldistilledchanges.pdf Some elements of former UML versions (e.g. <<uses>> stereotype in use case diagrams) were removed, replaced or extended in UML 1.3 3.2.32 3.2.16