Uml Practicum

  • View
    405

  • Download
    5

Embed Size (px)

Transcript

1. UML , .

1.1. UML UML (Unified Modeling Language) , 80- 90- . UML 1994 ., Booch [-1999] OMT (Object Modeling Technique) Rational Software. 1995 . , Unified Method, 0.8. 1995 . OOSE (Object-Oriented Software Engineering) . , UML , , . UML , OMG (Object Management Group), . UML (Microsoft, IBM, Hewlett-Packard, Oracle, Sybase .). , CASE-, Rational Software (Rational Rose), UML (Paradigm Plus (CA), System Architect (Popkin Software), Microsoft Visual Modeler .). UML http://www.omg.org http://www.rational.com. UML [-1999], . , [-2000], [-2000] [-2001].

3

1.2. UML UML , , , - , . UML . UML 1.1, OMG 1997 ., : (use case diagrams) - ); (class diagrams) ; (behavior diagrams): (interaction diagrams): (sequence diagrams) (collaboration diagrams) ; (statechart diagrams) ; (activity diagrams) , ; (component diagrams) () ; (deployment diagrams) .

(implementation diagrams):

1.3. 4 (use case)

, . (), , ( ). . , . (actor) , . , . , , , . , . , , , . , - . () . . 1.1 (Automated Teller Machine, ATM). , , . : . , : , , 5

, , .

. 1.1. . . , , , (stakeholders) . , . , . , , . , . , : 6

, , , . . , . , , . . , , . , . . . , . (, ), ( ) . , : . . , . ( ) . , , . 7

. . , , . . , , - . - , , , , . , , . , . , , . , (flow of events). , . , , . , . , , . : ; (pre-conditions); ; ( ); (post-conditions). . , . , 8

: . , , . , , . . , . , , . , , . . , . , , , . : ; ; , , ; ( ); ; .

9

, : 1. , . 2. . 3. . 4. . , 1. 5. : ; ; . 6. . 7. , . 8. . 9. , . , 2. , 1. 10. . 11. . 12. . 13. . 14. . 1. . 1. , . 2. . 3. .

10

2. . 1. , . 2. . 3. . 1. . 1. , . 2. . , , . 3. . 4. . , . , - . . , . , , , . . UML . (communication), (include), (extend) (generalization). . UML ( ). , . 11

, - , . . () , . , . . . UML , . 1.2.

. 1.2. , . , : . , . 1.3. 12

. 1.3. . , , , . , . . , , .

1.4. (interaction diagrams) . , . , . (message) , - . (informative) , - . 13

- (interrogative) , -. (imperative) , - . : (sequence diagrams) (collaboration diagrams). 1.4.1. , . , , , , , . ( , ) . 1.4. . ; . , , . , . , . (lifeline) . .

14

:

1:

ATM

2: 3: 4: PIN- 5: PIN- (1234) 6: 7: 8: PIN- 9:

10: ( )

11:

12: (20 ) 13: (20 .) 14: (20 .) 15: (20 .) 16: (20 ) 17: (20 .) 18:

. 1.4. 15

. , . ; , , , - (self-delegation) , , . . , . . , . . , , , , . , , (control objects). . 1.4.2. . , (collaborations) . , . . 1.5 , , . , , , - . , , . 16

2:

1: : 5: PIN- (1234) 10: ( ) 12: (20 .) 3: 4: PIN- 9: 11: ATM 18: 17: (20 .) ATM 7: 8: PIN- 14: (20 .)

6: 13: (20 .) 15: (20 .) 16: (20 .)

. 1.5. , - . , . , , , . , , .

1.5. 1.5.1. , . , , . 17

. 1.6. Card Reader - Card Number : integer + Accept Card() : integer + Eject Card() : integer + Read Card() : integer 0..1 0..1 Account - Account Number : integer - PIN : integer - Balance : long 1 + Open() : integer + Withdraw Funds(Amount : long) : integer - Deduct Funds(Amount : long) : integer - Verify Funds() : integer ATM Screen + Prompt() : integer + AcceptInput(Input : Integer) : integer 0..1

0..n

Cash Dispenser - Cash Balance : long 0..1 + Provide Cash() : integer + Provide Receipt() : integer

. 1.6.

, . : Card Reader1 ( ), Account (), ATM Screen ( ) Cash Dispenser ( ). , . , . , (, ). , . , , . . , CASE- .1

18

. , Account ATM Screen ( ), . Card Reader ( ) Cash Dispenser ( ), . 1.5.2 , . UML : Boundary (), Entity () Control (). (boundary classes) , . , , ( ) . , . , , . . - - (entity classes) . , . - . (control classes) . , . , , . . 19

, -. , . , SecurityManager ( ), , . TransactionManager ( ) , . , , . . 1.5.3. , , . . -, . , , .. , . . , Security () , . Employee Maintenance ( ), Reporting ( ) Error Handling ( ). . , . , . , UML, . 20

, . , (. 1.7) , . , , .

Entities Boundaries

Control

. 1.7. , . , : ; ; . , , , . , , , , , . 21

. . , , 4, . 1.5.4. , . , Company () Name (), Address () NumberOfEmployees ( ). , . , . (attribute visibility). . (. 1.8). Employee Address Company: Public (, ). , . . Company Address Employee. UML + . Private (, ). . Employee Address , Company , . , Employee , . UML. Protected (). . , 22

. , HourlyEmp SalariedEmp, Employee. Address Employee, HourlyEmp SalariedEmp, Company. UML # . Package or Implementation (). , , . , Address . Company, . .

Employee -Employee ID : Integer = 0 #SSN : String #Salary : float +Address : String +City : String +State : String +Zip Code : long +Departament : String +Hire() +Fire() +Promote() +Demote() +Transfer()

. 1.8. , . . , . , . . 23

1.5.5. . , . , . . , . , , . UML : (1 : 1, 2 : 2, ...) : . (implementor operations) -. , . , , , . . . , , , . , , - . (manager operations) . . 24

. , . (access operations). , , Salary Employee. , . Employee GetSalary SetSalary. , , . Salary . SetSalary , Salary. , , . , , . Get Set ( ) . (helper operations) , , . . , : 1. . . . 2. . . 3. . , , Get Set. 25

1.5.6. . , . , , . , : , , . (association) . .

NewClass

NewClass2

. 1.9. , , . UML . , . , . , , . , . . , . 26

(dependency) , , , . , .

NewClass

NewClass2

. 1.10. . , , . , ++ #include. (aggregations) . . , , , . , . . , :

Whole

Part

. 1.11. UML , . 27

, - , , , , : . . , , 1..1; , , (, , ). (generalization) . . , . UML - :Student(from Design Model)

- name - address - studentID + // get tuition() + // add schedule() + // delete schedule()

FulltimeStudent(from Design Model)

ParttimeStudent(from Design Model)

- gradDate

- maxNumCourses

. 1.12.

28

, , . (multiplicity) , . , Course () Student (). : , . , : ? ? , . , , 10 20 . , . 1.13.

Course 0..4. 1.13.

Student 10..20

UML : 0..* 1..* 0..1 1..1 ( : 1) 29