II. / ( )
II - 1.
II - 2.
II - 3.
II - 4.
II - 5
II-1.
...
,,,,
( ), (Who) ( )? (What)? (Interface)? (Verification)
( )
-
( ) (Active Actor) (Passive Actor) :,
Actors are external!! ( ) (Thing; ) (Role) / ( ),,
( ). :.
( ) 6 (main functionality)? ( ) (daily task)?? ( )???
( ) (Role) [ ]??? (3~4 Line ) ),,
( ) (Generalization)
( ) Use Case
( ), Parameter (X); (O) (X); (O),, [ ]
( ) 4?,,,,?, (functionality)? (daily work)?
( ) : (Include) <<Include>>
( ) : (Include). <<Include>> <<Include>>. <<Include>>..
( ) : (Extend) <<extend>>
( ) : (Extend) <<extend>>. <<extend>>..
( ) : (Generalization) (Child Use Case) (Parent Use Case),,....
[ ]?,? Basic flow of events(normal Case) Alternative flow of events(abnormal Case) (,, )
( ) (Main Flow) (Alternative Flow)
( ) ( ),,,,? (Interaction)??
( ) ( ) Happy path
( ) /
( ) <.> 1. Brief Description Use Case Use Case < /.>. Use Case,,. 2. Main Flow of Events Use Case Use Case < /.>.,,,. : 3-1 flow. : 3-2 flow. : 3-2 flow. : Use Case.
( ) <.> 3. Alternative Flow of Events 3-1. Display. Display. (E-1). Check (E-2), (E-1) Display. Use Case. 3-2. Display., Display. Use Case. 3-3. Display. Display (E-1), Display. Use Case.
( ) <.> 3-E Exception E-1 DB Error: Error #( ) Display, Use Case. E-2. Display, Use Case Use Case. 4. Special Requirements 5. Preconditions 6. Postconditions 7. Pictures of the User Interface
.,. Activity State : Transition : Activity State Activity State Decision : Synchronization bar : Concurrent Thread
( ) Start point Decision Action States Guard Condition Transition End point
Glossary ( ) : : : 1 1 : 1 : :.. : :.
( ) ( )
( ) ( ) 1) MS DCOM. 2) Oracle8 (Object Type) (Stored Procedure). 3) NT-Server 4.0 Windows 95. 4).
II.
, (1 )
?
( ) <<realizes>> (from Use Case View). <<Realization>>.
( ) - - - - - <<realizes>> Use Case Collaboration <<implements>> <<boundary>> <<control>> Manager <<entity>> -
( ) <<boundary>> <<boundary>> <<entity>> <<control>> <<entity>> <<entity>>
Object (Business Domain),, (State) (Behavior) (Identity).
(State) Object ( ) (Condition) : 9500343 : : 640302-2211321 : Attribute Attribute Value
Object ( ) (Behavior) (Object) (Message)
Object ( ) (Identity) (State) : 9300402 : 9320402 : 9400422
Object ( ) : :
Object Interaction : Interaction Diagram Interaction Diagram Sequence Diagram Collaboration Diagram
Object Interaction ( ) Sequence Diagram (Life Line) (Focus of Control)
Object Interaction ( ) Sequence Diagram
Object Interaction ( ) Collaboration Diagram Use Case \ (Link) (Optional)
Object Interaction ( ) Collaboration Diagram
Object Interaction ( ) Sequence Diagram vs Collaboration Diagram Sequence Diagram Collaboration Diagram (Sequence) Collaboration
Use Case Analysis Use Case Report Object Interaction Class Package A Class Diagram Package B Package C Package Diagram
( ) CRC(Class Responsibility Collaboration) Cards Ward Cunningham & Kent Beck, OOPSLA, 1989 3 * 5, (responsibility) Class Service Class (Collaborative Class)
( ) CRC Cards ( ) ( )
( ) CRC Cards ( ) Scenario (Collaboration) (Pattern) Class Generalization/Specialization/Aggregation (Hierarchies) Class (meaningful), (domain-specific) Class Class(Collaborator) (indispensable) Class Class Class responsibility Class (Collaboration)
( ) Actor Scenario <<boundary>> System-to-System Communication H/W, S/W
( ) <<entity>>
( ) Scenario ( ), Filtering (Structure)/ (Behavior) Grouping
( ) Logic Control(events ) Controller Sequencing Information <<control>> Controller Entity/Boundary Class responsibility (Flow of Event) responsibility Use Case, Scenario,,
( ),.
III.
Package Mechanism Java global
Package ( ) Package Relationships <<import>>, <<access>> stereotype User Service GUI Framework Business Service <<import>> <<import>> Windows GUI MacGUI Data Service
Package ( ) Package Visibility B Private Visibility A +CourseInfo Form +StudentInfo Form Public Visibility -Course -Student PackageB Element StudentInfoForm, CourseInfoForm Access But, Course, Student Access
Subsystem Subsystem <<subsystem>> <<subsystem>>
Subsystem ( ) Subsystem Interface <<Interface>> <<subsystem>> Operation1( ) :Type1
Subsystem ( ) Subsystem Actor. <<Interface>> <<Subsystem>> classa classb
Subsystem ( ) Subsystem Component <<Interface>> <<Subsystem>> <<ActiveX>> Employee Com IEmployee
Subsystem ( ) Package Subsystem <<subsystem>> A C <<subsystem>> B
Design Pattern Design Pattern
Design Pattern ( ) Design Pattern ( )
Design Pattern ( ) Design Pattern catalog Purpose Creational Structural Behavioral Scope Class Factory Method Adapter Interpreter Template Method Object Abstract Factory Builder Prototype Singleton Adapter Bridge Composite Decorator Façade Proxy Chain of Responsibility Command Iterator Mediator Memento Flyweight Observer State Strategy Visitor Source : Design Pattern by Eric Gammar
Design Pattern ( ) Proxy 1:doIt() :ServiceProxy 1.1:doIt() :Service
Design Pattern ( ) Proxy pattern Class Diagram AbstractService doit() <<interface>> ServiceIF doit() ServiceProxy Service ServiceProxy Service doit() doit() doit() doit()
Observer Design Pattern ( )
Design Pattern ( ) Observer Registers-to-receive-notifications 0..* <<interface>> ObserverIF notify 0..* Notifies 1 <<interface>> ObservableIF addobserver(:observerif) removeobserver(:observerif) Observable Observer 1 1 Register-observers 1 1 Multicaster Notifies addobserver(:observerif) removeobserver(:observerif)
Design Pattern ( ) Pluggable Reuse Mechanisms
Design Pattern ( ) Inheritance vs Composition Class Inheritance Object Composition Visibility Advantage Disadvantage - White-box Reuse - Black-box Reuse - Interface - - don t break Encapsulation - - Inheritance breaks Encapsulation - - : Domain. Favor object composition over class inheritance
Design Pattern ( ) Polymorphism and Delegation A Hotel Check-in allocator a EvenSoaceAllocator a LeastUsedAllocator Component Based and pure Object-Oriented approaches Interface Delegation based Approach
Layered Architecture Layered Architecture,,
Layered Architecture Package stereotypelayer
Object Model vs Relational Tables RDB Data Model Data Entity Relationship Object Model (behavior) Class Relationship
Object Model vs Relational Tables Object to Relational Mapping Graphical User Interface Business Object Model Relational Database
Reverse Engineering Relational Tables Table Class Mapping Employee Table Employee empid :string name :string Create table Employee ( empid varchar2(8), name varchar2(30), street varchar2(20), city varchar2(20), state char(2), zipcode varchar2(10) ); Employee Class Employee empid :string name :string street :string city :string state :string zipcode : string 1..1 Address street :string city :string state :string zipcode : string
Reverse Engineering Relational Tables Many-to-Many Relationships Create table product ( product_id varchar2(8), name varchar2(30), description varchar2(20), price number ); Create table supplier ( supplier_id varchar2(8), name varchar2(30), street varchar2(20), city varchar2(20), state char(2), zipcode varchar2(10), country varchar2(20) ); Create table product-supplier ( product_id varchar2(8), supplier_id varchar2(8) ); Product product_id :string name : string description :string price : double 1..* 1..* Supplier supplier_id :string name :string 1..1 Address street :string city :string state :string zipcode : string country : string
Mapping Object to Relational Tables Mapping attributes to columns Mapping several classes tables Mapping Many-to-many relationships
Mapping Object to Relational Tables ( ) Mapping attributes to columns Supplier supplier_id :string name :string 1..1 Address street :string city :string state :string zipcode : string country : string supplier supplier_id name street city state zipcode country
Mapping Object to Relational Tables ( ) Mapping several classes tables (concrete) Person age name {abstract} Customer customerid preferences Employee salary grade
Mapping Object to Relational Tables ( ) Person OID age name salary grade customerid preferences objecttype One table Per Hierarchy
Mapping Object to Relational Tables ( ) Customer OID age name customerid preferences Employee OID age name salary grade One table Per Concrete Class
Mapping Object to Relational Tables ( ) Person Customer OID(FK) customerid preferences One table per Class OID age name Employee OID(FK) salary grade
Mapping Object to Relational Tables ( ) Mapping several classes tables Address Address streetno : string street :string city :string state :string 1..1 ZipCode zipcodeno : string OID streetno street city state zipcode
Mapping Object to Relational Tables ( ) Mapping relationships Customer Account customerid preferences 1..n 1..n accountno balance Customer customeroid customerid preferences CustomerAcct OID customeroid(fk) accountoid(fk) Account accountoid accountno balance
Object in Jasmine OODB ( ) Class Person thumbnail photo tag video audio animation name mydef DefineClass MyStore::Person Description: person abstract class { Instance: mediacf::bitmap thumbbail; mediacf::bitmap photo; mediacf::bitmap tag; mediacf::video video; mediacf::audio audio; mediacf::animation animation; String name; String mydef; }
Object in Jasmine OODB ( ) Inheritance Relationships Person thumbnail photo tag video audio animation name mydef defineclass MyStore::Designer super:person description: Designer class { } ; defineclass MyStore::Model super:person description: Model class { } ; Designer Model
Object in Jasmine OODB ( ) One-to-One Relationships Customer customerno House Address City State zip owner homeaddr defineclass MyStore::Customer super:person description: { Instance String customerno; House homeaddr; } ; defineclass MyStore::House description: { Instance Customer owner; String address ; String city; String state ; String zip; } ;
Object in Jasmine OODB ( ) One-to-many Relationships Order thecustomer orderdate orderitems 1 thepiece Quantity price 1..* OrderItem defineclass MyStore::Order description: { Instance Customer thecustomer; String orderdate; OrderItem set orderitems; } ; defineclass MyStore::OrderItem description: { Instance Piece thepiece; Integer quantity ; Currenct price; } ;
Object in Jasmine OODB ( ) One-to-many Relationships Organization orgname Members website * * Person Name Mydef organizations defineclass MyStore::Organization description: { Instance String orgname; Person set members; String website; } ; defineclass MyStore::Person description: { Instance String Name; String mydef ; Organization organizations; } ;
IV.
(Description),,, (Concepts),
( ) Employee {abstract} insertemployee() {abstract} queryemployee() RegularEmployee insertemployee() PromiseEmployee insertemployee()
( ) (Encapsulation), Encapsulation [Information hiding] (Internal state) Corruption
( ) Visibility
( ) (Boundary class) (Control class) (Entity class) (Exception class) (Meta class) (Utility class)
( ) Stereotype ( ) <<boundary>> Form Form Form JobManager <call> Scheduler
( ) <<Utility>> <<Utility>> sql +bind() +execsql() +starttrans() +commit()
( ) Class Utility <<Utility>> UnitUtil Import java.lang.math; + inchtocentimeter(float inch) : float + centimetertoinch(float centimeter) :float class UnitUtil { public static float inchtocentimeter(float inch); public static float centimetertoinch(float centimeter); }
,, (Responsibility) [<<stereotype>>] [visibility] name [(parameter_list, )] [: return_type] 1:1 : : getinformation(), get
( ) (Business Domain)... () () () () ()...
( ) (Naming Rules) Poorly named calculatebalance() Balance Well named getbalance() Balance( ) Operation (Supplier) Good names dispense(), giveoil() Bad names receiveoil()
( ) Interaction Diagram Interaction Diagram : Form //get Salary : Employee EmployeeID EmployeeName SocialSecurityNo Salary Grade //delete Employee //insert Employee getsalary deleteemployee insertemployee
(Data Definition) Attribute (Attribute) (Attribute) (Relationship). 1..n 1
( ) Attribute values Attribute Attribute 930044 994432 5000 2000...
( ) Attribute (Business Domain) Attribute...
( ) Derived Attribute Attribute Attribute (Attribute / ) Attribute / = *
( ) & Attribute Data type Initial value [visibility] AttributeName [multiplicity] [: Type] [ = Default] Attribute Attribute Flow of Event [ ] Attribute Attribute
(Class Scope Operation) StudentInfo - numstudents - maxnumstudents +add(thestudent : Student) +delete(thestudent : Student) +getnumstudents() +getmaxnumstudents() Class scope Attributes Class scope Operations getmaxnumstudents() maxnumstudents
( ) ( )
Independent link Whole-part Relationships Is-A Relationships
(Role) ( ) Association ( ) / Association,
( ) ( ) class Department{ private String deptid ; private String deptname ; private Employee themanager ; } Employee empid : String empname : String getsalary() : Money themanager Department deptid : String deptname : String
Multiplicity ( ), Association Association Multiplicity Many (*) Exactly five (5) Zero or more (0..*) One or more (1..*) One to ten (1..10) Exactly two, three or five (2,3,5) A A A A A A * 5 0..* 1..* 1..10 2, 3, 5
( ) Multiplicity ( ) Multiplicity Association Mandatory / Optional Minimum / Maximum Instance 1 1..* 1 0..*
( ) Multiplicity ( ) Sale SalesLineItem makelineitem() 1 1..* Import java.util.*; class Sale{ private Vector lineitems ;. public makelineitem(productspecification spec, int quantity) { lineitems = addelement(new SalesLineItem(spec, quantity)); } }
Navigation ( ) 1 1 0..* 0..*
( ) Navigation ( ) 1..* 1..*
( ) Navigation ( )
( ) Navigation ( ) 1..* 1..*
( ) Navigation ( ) 1..*
(bi-directional) Notation Association link ( )
( ) Multiple Associations Association Association Association Name Multiple Association,
( ) (Reflexive Association). 0..* 0..*
( ) Qualified One-to-many, many-to-many Association Qualifier Attribute Attribute, Association Association Association Key Qualifier 0..1
( ) Qualified 1 1. 1 1..*.
( ) (Association Class) Many-to-many relationship Attribute, Operation * * Attribute? * *
( ) (Constraints) (condition) ({ }) {Ordered by employee id} 1..* 1 1 {Subset} 1
Part-of ( Containment ) Relationship whole part Multiplicity Association
( ) By Value Relationship 1 1
( ) By-Reference Relationship 1..*
( ) (Reflexive Aggregation) Recursive Relationship 1 0..*
<SubClass> Is a[kind of] <SuperClass> Attribute/Operation
( ) (Inheritance relationship) Relationship Name Multiplicity Attributes, Operations, Relationship (Overriding)
( ) Payment amount paiddate authorize() CreditPayment amount paiddate expirydate CashPayment CreditPayment CheckPayment authorize() checkusage() expirydate checkusage()
( ) Car vs. Owner : Truck vs. Owner : Truck vs. Trailer : GroundVehicle weight licensenumber register() Owner 0..* 1 Person Car Truck tonage gettax() Trailer
( ) / (Generalization/Specialization) Increase abstraction Increase Specialization
( ) (Multiple Inheritance) (side effect) Naming Conflict Repeated Inheritance
( ) InterestBearingItem InsurableItem Asset Multiple Inheritance BankAccount RealEstate Security SavingAccount CheckingAccount Stock Bond
( ) Inheritance Constraint Asset {disjoint} BankAccount RealEstate Security {complete, disjoint} SavingAccount CheckingAccount Stock Bond
vs. Is a [ Kind of ] Relationship Has a Relationship Inheritance Aggregation is a has a
Client Supplier
Object Visibility Options Relationship Design
( ) Local visibility enteritem(upc, qty) :POST 3:makeLineItem(spec, qty) :Sale 2:spec := specification(upc) prodcatalog : ProductCatalog POST enterlineitem(upc, qty) { ProductSpecification spec = prodcatalog.specification(upc); }
( ) Local visibility enteritem(upc, qty) :POST 3:makeLineItem(spec, qty) :Sale 2:spec := specification(upc) prodcatalog : ProductCatalog POST ProductSpecification makelineitem(upc,qty)
( ) Parameter visibility enteritem(upc, qty) :POST 1:[new sale] create() 3:makeLineItem(spec, qty) :Sale 2:spec := specification(upc) 3.1:create(spec, qty) prodcatalog : ProductCatalog sl : saleslineitem Sale makelineitem(productspecification spec, int qty) { sl = new SalesLineItem(spec, qty); }
( ) Parameter visibility enteritem(upc, qty) :POST 1:[new sale] create() 3:makeLineItem(spec, qty) :Sale 2:spec := specification(upc) 3.1:create(spec, qty) prodcatalog : ProductCatalog sl : saleslineitem Sale ProductSpecification makelineitem(upc,qty)
( ) Attribute visibility enteritem(upc, qty) :POST class POST { private ProductCatalog prodcatalog; } 2:spec := specification(upc) prodcatalog : ProductCatalog POST enteritem(upc, qty) { spec = prodcatalog.specification(upc) }
( ) Attribute visibility enteritem(upc, qty) :POST POST enteritem(upc,qty) 2:spec := specification(upc) prodcatalog : ProductCatalog ProductCatalog specification(upc)
( ) POST Sale SalesLineItem enteritem() makelineitem() makepayment subtotal() ProductCatalog ProductSpecification specification(upc)
( ) Stereotypes Visibility 1:msg() :A :B <<attribute>> 3:msg() 4:msg() 2:msg() <<parameter>> <<local>> <<global>> :C :D :E
Statechart Diagram Behavior Modeling (System s Behavior) (Object Behavior) Life history (State) (Events) : (Transition) (Action) :
Statechart Diagram Statechart Diagram Action Event State Name statevar:type=value entry : action name do : : action name exit : action name Event [guard condition] ^target.sendevent /Action Transition State
Statechart Diagram ( ) Special States Initial State (Mandatory) Only one Initial state Final State (Optional) More than one Final state
Statechart Diagram ( ) Attribute Attribute Employee workduration : Employee workduration < 30 workduration >= 30 Probation Regular Attribute workduration State - workduration < 30( ) : - workduration >= 30 ( ) :
Statechart Diagram ( ) (Events) (Transition) : (hired), (request leave) (Transitions) (originating State) (successor State) Apply hired Probation
Statechart Diagram ( ) Guard Conditions Attribute Boolean expression Regular [age >= 65] Retired
Statechart Diagram ( ) Sending Events Trigger Event Format ^Class Name. Event Name Apply hired Probation [workduration >= 30] ^Order.announce() Regular
Activities Statechart Diagram ( ) Operation (Entered) (Complete) (outgoing transition) Retired entry : do : calculate pension exit :
Statechart Diagram ( ) : StateChart with Nested States Receiving idle ringing Connected headerok Hang up Processing Transmitting Error /printreport CleaningUp checksumok entry/pickup exit/disconnect
Statechart Diagram ( ) : Statechart with History Apply Hired[regular] Probation Hired[promise] Promise Reguar H change [workduration >=30] Return Leave Request leave [age = 65] Retired
II-5. Component
Logical vs Physical Architecture Logical Architecture Diagram
Logical vs Physical Architecture Physical Architecture Diagram
Component and Interface (Component)
Component and Interface ( ) (Interface) Passenger Guest Check Baggage Board Check In Check Out
Component and Interface ( ) (Interface) Guest Interface Guest { checkin(); checkout(); } Interface Passenger { checkbaggage(); board(); } Passenger Person Class Person implements Guest, Passenger { } //implementation
Component and Interface ( )
Component Diagram( ) Software Component Stereotypes Component Notation: <<stereotype>> Component Name
Component Diagram( ) Component Name Client.exe Common.dll Whnd.cpp Main.cpp classa.h
Component Diagram( ) Component Relationships <<ActiveX>> EmployeeMgr.dll <<EXE>> MyProj.exe
Process Modeling Process <<process>>, <<thread>> Active Class Object Component <<Process>> ProcessA :ProcessA <<Process>> ProcessB
Process Modeling ( ) Process Relationship <<Process>> ProcessA <<Process>> ProcessB <<Process>> ProcessB <<Thread>> ThreadA <<Process>> ProcessA <<Thred>> ThreadA
Process Modeling ( ) Process Model
Deployment Diagram ClientA PC: Hyundai 586 ClientB PC: Hyundai 586 <<TCP/IP>> <<TCP/IP>> Application Server: HP Database Server : HP
Deployment Diagram( ) PC: Hyundai 586 node <<TCP/IP>> connection
Deployment Diagram( ) Components and Nodes PC: Hyundai Multi CAV power <<library>> Transaction Client Library <<EXE>> Client Program
Deployment Diagram( ) Node Component