1 / 26

UML - Part 3

UML - Part 3. Modeling Element Structural things Behavioral things Grouping things Annotational things Relationships Dependency Association Generalization Realization. 3. Diagram Class diagram Object diagram Use case diagram Sequence diagram Collaboration diagram

kyra-cline
Download Presentation

UML - Part 3

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. UML - Part 3

  2. Modeling Element Structural things Behavioral things Grouping things Annotational things Relationships Dependency Association Generalization Realization 3. Diagram Class diagram Object diagram Use case diagram Sequence diagram Collaboration diagram Statechart diagram Activity diagram Component diagram Deployment diagram Building Blocks of the UML

  3. 3 Diagrams • A diagram is typically a view of a part of the model, showing modeling elements and some of the relationships between them. • A diagram do not have to be complete, some elements may be missing or presented in a simplified fashion. • UML: ”Awell-formed modelis one that is semantically self-consistent and in harmony with all related models.”

  4. There are 9 types of diagrams inUML Dynamic views Static views Use CaseDiagrams SequenceDiagrams Some part ofthe model might not be visible onany diagram ClassDiagrams CollaborationDiagrams ObjectDiagrams Model ActivityDiagrams ComponentDiagrams StatechartDiagrams DeploymentDiagrams

  5. actor register a person edit a registration/delete a registration include relationship view nextperson ”include” ”include” navigate/viewthe register view previousperson association ”include” User use case system boundary 3.1 Use case diagram

  6. Use Case Diagram - One More Example ”A use case is a specific way of using the system by performing some part of the functionality. Each use case constitutes a complete course of events initiated by an actor, and it specifies the interaction that takes place between an actor and the system....” I. Jacobson

  7. 3.2 Class Diagram responsible for * 1 Course Person CourseModule name : String description : String name : String email : String homePage : String tech. responsible for name : String description : String * 1..* * 1 1 1 * 1 * * Student StudentCourseProfile finished : boolean When a student register for course a StudentCourseProfile object will be made!

  8. A Class DiagramWith Navigation responsible for * 1 Course Person CourseModule name : String description : String name : String imail : String homePage : String tech. responsible for name : String description : String 1 1..* * * 1 1 * * * StudentCourseProfile 1 Student finished : boolean

  9. A Class Diagram - Mapping to Java responsible for * 1 Course Person name : String description : String name : String imail : String homePage : String tech. responsible for 1 * 1 * * StudentCourseProfile 1 Student finished : boolean publicclass Person { protected String name; protected String imail; protected String homePage; // // Navigation protected Course[] responsibleFor; protected Course[] techResponsibleFor; public Person() { } } publicclass Student extends Person { // // Navigation publicStudentCourseProfile[] studentCourseProfile; public Student() { } }

  10. A Class Diagram - Example With Interface <<Interface>> IStorable Register -reg edit() 0..* 0..* write() relization read() public void read(){ Person terminal.print("Name: "); name = terminal.readLine(); edit() ... write() } read() relization/implements Two different representation of nearly the same dependency

  11. A Class Diagram -One More Example With Interface

  12. 3.3 Object Diagram -Capture Instances and Links Class Object Company HiA: Company noOfEmploees=600 noOfEmploees : int Possible object name object class attributewith value

  13. Company 1 1..* LocatedAt Department Office * 1..* Object Diagram with Links Class Diagram Object Diagram Language:Department Gimlemoen: Office :LocatedAt HiA: Company Possibleobject diagram :LocatedAt Grooseveien: Office Engineering :Department Link - A link is an instance of an association,analogous to an object being an instance of a class.

  14. Object diagram and Rational Rose 2000 Rational Rose 2000 does not have object diagrams, but you can achieve much the same with a collobartion diagram You can not specify attributes inside object;One solution to this short-coming is to use a comment!

  15. user controllerViewer register <command r> <name,e-mail,..> ”create” person setData(name, ..) insert(person) 3.4 Sequence diagram

  16. 1.2: ”create” 1: register() 1.1: data := getData() 1.4: insert(person) 3.5 Collaboration diagram 1.3: setDate(data) user controllerViewer person register

  17. 3.6 Statechart diagram StateChart for microwaveoven "control unit"

  18. NotLoaded Running Loaded destroy/destroy() Stopped Statechart for Applet init/init() stop/stop() start/start() start/start()

  19. 3.7 Activity diagram -Capture Dynamic Behaviour (Activity-oriented)

  20. Activity diagram -One More Example activity product of activity

  21. Activity diagram - One More Example controller register user person request registration create person (object) supply person-data forward person-data process person-data insert person

  22. applet1.class Demo.html applet2.class logo.gif applet1.java applet2.java 3.8 Component diagram -Captures the Physical Structure of the Implementation

  23. Person.class Register.class Component diagram -One More Example ISortable

  24. ”PC” ”PC” ”Server” 3.9 Deployment diagram Extended VLAN ”network” LAN

  25. :html j1:Jsp :html j2:Jsp s1:Servlet browser: :WebServer :ServletContainer s2:Servlet :DB b1:BusinessObject b2:BusinessObject b4:BusinessObject b3:BusinessObject client: Internet Multi-tier Architecture- MVC -view:browser/jsp/servletcontroller:jsp/servletmodel:businessObjects server1: Intranet server2:

  26. References • [1] Grady Booch, James Rumbaugh and Ivar Jacobson:The Unified Modeling Language User Guide.Addison-Wesley, 1999 • James Rumbaugh, Michael Blaha, William Premerlani, Frederick Eddy and William Lorenzen: Object-Oriented Modeling and Design. Prentice Hall, 1991 • Martin Fowler with Kendall Scott: UML Distilled.Addison-Wesley, 1997 • Terry Quatrani: Visual Modeling with Rational Rose and UML.Addison-Wesley, 1998 • Ari Jaaksi: A Method for Your First Object-Oriented Project. JOOP - The Journal of Object-Oriented Programming, Januar 1998 • Rational software: http://www.rational.com/uml/documentation.html

More Related