Class Diagrams. CSC 440/540: Software Engineering Slide #1

Similar documents
c. What is the average rate of change of f on the interval [, ]? Answer: d. What is a local minimum value of f? Answer: 5 e. On what interval(s) is f

gender mains treaming in Polis h practice

600 Billy Smith Road, Athens, VT

LU N C H IN C LU D E D

Grain Reserves, Volatility and the WTO

STEEL PIPE NIPPLE BLACK AND GALVANIZED

MOLINA HEALTHCARE, INC. (Exact name of registrant as specified in its charter)

AGRICULTURE SYLLABUS

M a n a g e m e n t o f H y d ra u lic F ra c tu rin g D a ta

TTM TECHNOLOGIES, INC. (Exact Name of Registrant as Specified in Charter)

THE BANK OF NEW YORK MELLON CORPORATION (Exact name of registrant as specified in its charter)

B ooks Expans ion on S ciencedirect: 2007:

UNITED STATES SECURITIES AND EXCHANGE COMMISSION Washington, D.C Form 8-K/A (Amendment No. 2)

ANNUAL MONITORING REPORT 2000

TECHNICAL MANUAL OPTIMA PT/ST/VS

NORWEGIAN MARITIME DIRECTORATE

Report Documentation Page

Form and content. Iowa Research Online. University of Iowa. Ann A Rahim Khan University of Iowa. Theses and Dissertations

Functional pottery [slide]

Information System Desig

Software Architecture. CSC 440: Software Engineering Slide #1

UNITED STATES SECURITIES AND EXCHANGE COMMISSION Washington, D.C FORM 8-K

1980 Annual Report / FEDERAL R ESER V E BA N K OF RICHMOND. Digitized for FRASER Federal Reserve Bank of St.

UNITED STATES SECURITIES AND EXCHANGE COMMISSION FORM 8-K. Farmer Bros. Co.

UNITED STATES SECURITIES AND EXCHANGE COMMISSION WASHINGTON, D.C FORM 8-K

University Microfilms

EKOLOGIE EN SYSTEMATIEK. T h is p a p e r n o t to be c i t e d w ith o u t p r i o r r e f e r e n c e to th e a u th o r. PRIMARY PRODUCTIVITY.

A new ThermicSol product

LSU Historical Dissertations and Theses

Distributive Justice, Injustice and Beyond Justice: The Difference from Principle to Reality between Karl Marx and John Rawls

The Ability C ongress held at the Shoreham Hotel Decem ber 29 to 31, was a reco rd breaker for winter C ongresses.

McCormick & Company, Incorporated (Exact name of registrant as specified in its charter)

Texas Student Assessment Program. Student Data File Format for Student Registration and Precoding

S o b re o T e rm o. Am b ie n te s d e Mid d le w a re , % - n s c in.u fp e.b r ! " " # $ % & ' " #

UNITED STATES SECURITIES AND EXCHANGE COMMISSION Washington, DC FORM 8-K. Current Report

Operation Manual for Automatic Leveling Systems

A L A BA M A L A W R E V IE W

CHAPTER 6 SUMMARV, m a in FINDIN6S AND C0NCUL5I0NS

The Effects of Apprehension, Conviction and Incarceration on Crime in New York State

BIRLA ERICSSON OPTICAL LIMITED

TECH DATA CORPORATION (Exact name of registrant as specified in its charter)

WSFS Financial Corporation (Exact name of registrant as specified in its charter)

MySQL 5.1. Past, Present and Future. Jan Kneschke MySQL AB

MONTHLY REVIEW. f C r e d i t a n d B u s i n e s s C o n d i t i o n s F E D E R A L R E S E R V E B A N K O F N E W Y O R K MONEY MARKET IN JUNE

Joh n L a w r e n c e, w ho is on sta ff at S ain t H ill, w r ite s :

C o r p o r a t e l i f e i n A n c i e n t I n d i a e x p r e s s e d i t s e l f

INCOME TAXES IN ALONG-TERMMACROECONOMETRIC FORECASTING MODEL. Stephen H. Pollock

Form 8-K. Piedmont Office Realty Trust, Inc. (Exact name of registrant as specified in its charter)

NATO and Canada, : The Tight-Lipped Ally

Computer Games as a Pedagogical Tool in Education. Ken Maher B.Sc. School of Computer Applications, Dublin City University, Glasnevin, Dublin 9.

Vlaamse Overheid Departement Mobiliteit en Openbare Werken

Country Report Government (Part I) Due: November 14, 2017

THE EFFECT Of SUSPENSION CASTING ON THE HOT WORKABILITY AND MECHANICAL PROPERTIES OF A IS I TYPE STAINLESS STEEL

heliozoan Zoo flagellated holotrichs peritrichs hypotrichs Euplots, Aspidisca Amoeba Thecamoeba Pleuromonas Bodo, Monosiga

Transaction Cost Economics of Port Performance: A Composite Frontier Analysis

SCHOOLS DIVISION OFFICE OF KABANKALAN CITY

Beechwood Music Department Staff

REFUGEE AND FORCED MIGRATION STUDIES

Breakup of weakly bound nuclei and its influence on fusion. Paulo R. S. Gomes Univ. Fed. Fluminense (UFF), Niteroi, Brazil

O p e r a t in g R a t i o s o f S i x t h D i s t r i c t M e m b e r B a n k s f o r

Sodium-Initiated Polymerization of Alpha- Methylstyrene in the Vicinity of Its Reported Ceiling Temperature

Dentists incomes, fees, practice costs, and the Economic Stabilization Act: to 1976

Matador Resources Company (Exact name of registrant as specified in its charter)

7.2 P rodu c t L oad/u nload Sy stem s

SINTERING AND CHARACTERISATION OF NANO SIZED YTTRIA-STABILISED ZIRCONIA. P r e p a r e d b y. Muhammad Hasanuzzaman, B.Sc. (Eng)

Sub: Filing of Reconciliation of share capital for the quarter ended September 30, 2018

Capacitor Discharge called CD welding

Woolley Retires as Township Official Honored in Resolution for Service Querns Likely Successor,

S U E K E AY S S H A R O N T IM B E R W IN D M A R T Z -PA U L L IN. Carlisle Franklin Springboro. Clearcreek TWP. Middletown. Turtlecreek TWP.

Model Checking. Automated Verification of Computational Systems

O In Chapter 2, you graphed and analyzed power, polynomial, and rational functions.

THE FOURTH AMENDMENT ASPECTS OF COMPUTER SEARCHES AND SEIZURES: A PERSPECTIVE AND A PRIMER

UNITED STATES SECURITIES AND EXCHANGE COMMISSION WASHINGTON, DC FORM 8-K CURRENT REPORT

VERITAS L1 trigger Constant Fraction Discriminator. Vladimir Vassiliev Jeremy Smith David Kieda

C o v. R o c k e f e l l e r W i l l S e e k S o m e S t a t e A g e n c y R e o r g a n i z a t i o n

A Study of Attitude Changes of Selected Student- Teachers During the Student-Teaching Experience.

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

R e p u b lic o f th e P h ilip p in e s. R e g io n V II, C e n tra l V isa y a s. C ity o f T a g b ila ran

Chemical Treatment of a Dispersive Clay Reservoir

Certificate Sound reduction of building elements

STUDIA ORIGIN ALIA 2 UNISA 1988

High Capacity Double Pillar Fully Automatic Bandsaw. p h a r o s 2 8 0

NUMERICAL SIMULATION OF MHD-PROBLEMS ON THE BASIS OF VARIATIONAL APPROACH

Rule-Governed Behavior in Preschool Children

DATA SHEET FOR COMPOUND TEV

The Construction and Testing of a New Empathy Rating Scale

Photo. EPRI s Power System and Railroad Electromagnetic Compatibility Handbook

The fulfillment or non-fulfillment of the predictions in the federal convention of 1787

A Comparison of Two Methods of Teaching Computer Programming to Secondary Mathematics Students.

T H E ' B R I T M E f f B 'l T A R Y D O C U M E N T S U P P l Y C E N T R E

Comparative Analyses of Teacher Verbal and Nonverbal Behavior in a Traditional and an Openspace

Imitative Aggression as a Function of Race of Model, Race of Target and Socioeconomic Status of Observer.

An Improved Fission Product Pressure Model for Use in the Venus-II Disassembly Code

Product Data Sheet KyoRack 2

Dangote Flour Mills Plc

March rort. Bulletin U.S. DEPARTMENT OF LABOR BUREAU OF LABOR STATISTICS

Memorial to William Taylor Thom, Jr.

Section 1: 8 K (AMJ Q4 FY15 POWERPOINT)

GAOMEI AUTO FLOOR SLUBBER SERIES ^ CREATIVE FOR YOU

S ca le M o d e l o f th e S o la r Sy ste m

Transcription:

Class Diagrams CSC 440/540: Software Engineering Slide #

Topics. Design class diagrams (DCDs) 2. DCD development process 3. Associations and Attributes 4. Dependencies 5. Composition and Constraints 6. Object modeling advice CSC 440/540: Software Engineering Slide #2

Design Class Diagrams DCDs are class diagrams for static object modeling. Domain models use a subset of class diagram notation for business modeling. Builds on previous artifacts Domain Model (conceptual classes) Interaction Diagrams (software classes + methods) Feedback loop with interaction diagrams Typically develop in parallel CSC 440/540: Software Engineering Slide #3

DCDs illustrate Classes Associations between classes Attributes of objects with types Interfaces Methods Dependencies Navigability CSC 440/540: Software Engineering Slide #4

Class Diagram UML Notation 3 c o m m o n c o m p a rtm e n ts. c la s s ifie r n a m e 2. a ttrib u te s 3. o p e ra tio n s a n in te rfa c e s h o w n w ith a k e y w o rd «in te rfa c e» R u n n a b le ru n () S u p e rc la s s F o o or S u p e rc la s s F o o { a b s tra c t } - c la s s O rs ta tic A ttrib u te : In t + p u b lic A ttrib u te : S trin g - p riv a te A ttrib u te a s s u m e d P riv a te A ttrib u te is In itia liz e d A ttrib u te : B o o l = tru e a C o lle c tio n : V e g g ie B u rg e r [ * ] a ttrib u te M a y L e g a lly B e N u ll : S trin g [0.. ] fin a lc o n s ta n ta ttrib u te : In t = 5 { re a d O n ly } /d e riv e d A ttrib u te + c la s s O rs ta tic M e th o d () + p u b lic M e th o d () a s s u m e d P u b lic M e th o d () - p riv a te M e th o d () # p ro te c te d M e th o d () ~ p a c k a g e V is ib le M e th o d () «c o n s tru c to r» S u p e rc la s s F o o ( Long ) m e th o d W ith P a rm s (p a rm : S trin g, p a rm 2 : F lo a t) m e th o d R e tu rn s S o m e th in g () : V e g g ie B u rg e r m e th o d T h ro w s E x c e p tio n () {e x c e p tio n IO E x c e p tio n } a b s tra c tm e th o d () a b s tra c tm e th o d 2 () { a b s tra c t } // a lte rn a te fin a lm e th o d () { le a f } // n o o v e rrid e in s u b c la s s s y n c h ro n iz e d M e th o d () { g u a rd e d } o ffic ia lly in U M L, th e to p fo rm a t is u s e d to d is tin g u is h th e p a c k a g e n a m e fro m th e c la s s n a m e u n o ffic ia lly, th e s e c o n d a lte rn a tiv e is c o m m o n ja v a.a w t::f o n t or ja v a.a w t.f o n t p la in : In t = 0 { re a d O n ly } b o ld : In t = { re a d O n ly } n a m e : S trin g s ty le : In t = 0 g e tf o n t(n a m e : S trin g ) : F o n t g e tn a m e () : S trin g F ru it dependency in te rfa c e im p le m e n ta tio n and s u b c la s s in g S u b c la s s F o o ru n () - e llip s is m e a n s th e re m a y b e e le m e n ts, b u t n o t s h o w n - a b la n k c o m p a rtm e n t o ffic ia lly m e a n s u n k n o w n b u t a s a c o n v e n tio n w ill b e u s e d to m e a n n o m e m b e rs o rd e r a s s o c ia tio n w ith m u ltip lic itie s P u rc h a s e O rd e r

DCD development process. Identify all classes involved in software by analyzing interaction diagrams. 2. Draw classes in a class diagram. 3. Copy attributes from the related concepts in the domain model. 4. Add method names based on messages exchanged between classes in interaction diagrams. 5. Add type information. 6. Add associations necessary for attribute visibility. 7. Add navigability arrows to associates to indicate direction of visibility. 8. Add dependency relationship lines to indicate nonattribute visibility. CSC 440/540: Software Engineering Slide #6

From Domain to Design Model D o m a in M o d e l c o n c e p tu a l p e rs p e c tiv e R e g is te r C a p tu re s S a le tim e is C o m p le te : B o o le a n /to ta l R e g is te r S a le D e s ig n M o d e l DCD; s o ftw a re p e rs p e c tiv e e n d S a le () e n te rite m () m a k e P a y m e n t() c u rre n ts a le tim e is C o m p le te : B o o le a n /to ta l m a k e L in e Ite m ()

Prefer associations to attributes u s in g th e a ttrib u te te x t n o ta tio n to in d ic a te R e g is te r h a s a re fe re n c e to o n e S a le in s ta n c e R e g is te r c u rre n ts a le : S a le S a le O B S E R V E : th is s ty le v is u a lly e m p h a s iz e s th e c o n n e c tio n b e tw e e n th e s e c la s s e s R e g is te r c u rre n ts a le S a le u s in g th e a s s o c ia tio n n o ta tio n to in d ic a te R e g is te r h a s a re fe re n c e to o n e S a le in s ta n c e th o ro u g h a n d u n a m b ig u o u s, b u t s o m e p e o p le d is lik e th e p o s s ib le re d u n d a n c y R e g is te r c u rre n ts a le : S a le c u rre n ts a le S a le

Association vs Attribute Decisions a p p ly in g th e g u id e lin e to s h o w a ttrib u te s a s a ttrib u te te x t v e rs u s a s a s s o c ia tio n lin e s id: In t R e g is te r c u rre n ts a le S a le tim e : D a te T im e R e g is te r h a s T H R E E a ttrib u te s :. id 2. c u rre n ts a le 3. lo c a tio n lo c a tio n S to re a d d re s s : A d d re s s phone: P h o n e N u m b e r

Representing Collections S a le S a le s L in e Ite m tim e : D a te T im e lin e Ite m s : S a le s L in e Ite m [..* ] or lin e Ite m s : S a le s L in e Ite m [..* ] {o rd e re d } T w o w a y s to s h o w a c o lle c tio n a ttrib u te S a le S a le s L in e Ite m tim e : D a te T im e..* lin e Ite m s {o rd e re d, L is t} n o tic e th a t a n a s s o c ia tio n e n d c a n o p tio n a lly a ls o h a v e a p ro p e rty s trin g s u c h a s {o rd e re d, L is t}

Generalization CSC 440/540: Software Engineering Slide #

Dependencies Common dependencies include Target is an attribute of the source. Source sends a message to the target. Source receives a parameter of target type. Target is a superclass or interface. Indicating dependencies helps you Know which classes to implement or mock first. Know which classes will be impacted by a change. CSC 440/540: Software Engineering Slide #2

Dependencies and Attributes th e S a le h a s p a ra m e te r v is ib ility to a P ro d u c td e s c rip tio n, a n d th u s s o m e k in d o f dependency P ro d u c td e s c rip tio n S a le u p d a te P ric e F o r( P ro d u c td e s c rip tio n ) S a le s L in e Ite m..* lin e Ite m s

Interfaces and Implementations a c tiv e c la s s «in te rfa c e» ru n () R u n n a b le ru n () C lo c k

DCD Keywords Keyword Meaning Example «interface» Class is an interface «interface»listener «create» «call» {abstract} {ordered} Source creates instances of target of dependency. Source calls an operation in target of dependency. Abstract classes cannot be instantiated. Collection of objects has a defined order. Class {abstract} list: class{ordered} CSC 440/540: Software Engineering Slide #5

Dependency Example th e d o X m e th o d in v o k e s th e ru n F in a liz a tio n s ta tic m e th o d, a n d th u s h a s a d e p e n d e n c y o n th e S y s te m c la s s S y s te m F o o ru n F in a liz a tio n () dox() Static method

More dependency examples W in d o w «c a ll» C lo c k g e tt im e () A «c re a te» B a d e p e n d e n c y o n c a llin g o n o p e ra tio n s o f th e o p e ra tio n s o f a C lo c k a d e p e n d e n c y th a t A o b je c ts c re a te B o b je c ts

Object Composition H a n d 0..7 F in g e r c o m p o s itio n m e a n s -a p a rt in s ta n c e (S q u a re ) c a n o n ly b e p a rt o f o n e c o m p o s ite (B o a rd ) a t a tim e c o m p o s itio n -th e c o m p o s ite h a s s o le re s p o n s ib ility fo r m a n a g e m e n t o f its p a rts, e s p e c ia lly c re a tio n a n d d e le tio n B o a rd 40 S q u a re S a le..* S a le s L in e Ite m

UML Constraints th re e w a y s to s h o w U M L c o n s tra in ts S ta c k s iz e : In te g e r { s iz e > = 0 } p u s h ( e le m e n t ) pop() : O b je c t { p o s t c o n d itio n : n e w s iz e = o ld s iz e + } { p o s t c o n d itio n : n e w s iz e = o ld s iz e }

Object Modeling Advice Model dynamic and static behavior concurrently One whiteboard for interaction diagrams (dynamic) Adjacent whiteboard for class diagrams (static) When dynamic modeling Use communication diagrams for sketching. Document with sequence diagrams. CSC 440/540: Software Engineering Slide #20