Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

MELJUN CORTES Java Lecture UML

1,100 views

Published on

MELJUN CORTES Java Lecture UML

Published in: Technology, Education
  • Be the first to comment

MELJUN CORTES Java Lecture UML

  1. 1. Introduction to the Unified Modeling Langua ge MELJUN CORTES Java Fundamentals and Object-Oriented Programming The Complete Java Boot Camp MELJUN CORTES
  2. 2. Contents I. What is UML? II. Class Diagrams III.Sequence Diagrams IV.Others
  3. 3. Reference  UML Distilled Martin Fowler  practical, no-frills approach to UML 
  4. 4. Reference  Agile Modeling Hope Page “Effective Practices for Modeling and Documentation”  Scott Ambler  http://www.agilemod eling.com 
  5. 5. What is UML?  Consolidation of the various graphical- modeling methods existent during the late '80's and early '90's (around 5000)  Created by Booch, Rumbaugh, Jacobson (“the three amigos”)  Open standard managed by the Open Management Group (OMG)  Currently at version 2.0, describing about 20 types of diagrams
  6. 6. What is UML?  Three ways of using UML: for sketching  for blue printing     forward engineering reverse engineering as programming language  “model-driven architecture” / “executable UML”
  7. 7. Class Diagram
  8. 8. Class Diagram  primary means of describing classes and the static relationships between them
  9. 9. Class Diagram  Describing a class  compartments    class name attributes operations
  10. 10. Class Diagram  Describing a class  access levels   protected:  public: - private: # +
  11. 11. Class Diagram  Describing an interface different tools / books will render an interface differently  most texts will render it same as class but without attribute compartment 
  12. 12. Class Diagram  Relationships Navigability  Multiplicity / Cardinality  Association     Aggregation Composition Dependency Inheritance / Generalization  Realization   Others replacing attributes with named associations  stereotypes 
  13. 13. Class Diagram  Navigability  arrowhead   one-way navigability, the side with the arrowhead cannot see the other no arrowhead  two-way navigability, both sides can see each other
  14. 14. Class Diagram  Multiplicity / Cardinality number of possible occurrences of an element  0..*, *, 1, 1..* 
  15. 15. Class Diagram  Aggregation  the contained element can exist even if the containing object no longer exists
  16. 16. Class Diagram  Composition  the enclosed element cannot exist without the containing element
  17. 17. Class Diagram  Dependency  when an element is needed by a class but the element is not and aggregate of the class (such as a parameter)
  18. 18. Class Diagram  Inheritance / Generalization  empty-triangle arrowhead with solid line
  19. 19. Class Diagram  Realization when a class implements an interface  empty triangle arrowhead with dashed line 
  20. 20. Class Diagram  replacing attributes with named associations both can represent a property  to avoid clutter, if you use one don't use the other 
  21. 21. Class Diagram  Stereotype  used to create your own special kinds of classes
  22. 22. Sequence Diagram
  23. 23. Sequence Diagram  used to describe how objects interact with each other and the sequencing of these interactions
  24. 24. Sequence Diagram  Top boxes represent objects, not classes. You may optionally add “:class” to the name if desired.  Vertical lines represent the objects “life line”, or existence.  Broken lifeline indicates the object is inactive, a rectangle indicates the object is active.
  25. 25. Sequence Diagram  arrows with solid lines represent messages being sent.  arrows with dashed lines (optional if synchronous) represent method return. (May label arrow with name/type of returned object).
  26. 26. Sequence Diagram Sending object’s class must have:  An association of some sort with the receiving objects class.  The receiver-side class’s “role” must be the same as the name of the receiving object.
  27. 27. Sequence Diagram  Object creation  The new instance appears at end of creation message arrow
  28. 28. Sequence Diagram  Object Destruction  accomplished by terminating the lifeline with a large X
  29. 29. Sequence Diagram  Sequence diagrams can begin with a user
  30. 30. Sequence Diagram  System Sequence Diagram  sequence diagram describing interaction between user and system as a blackbox
  31. 31. Other UML Diagrams  Use Case  Collaboration  Activity  Component  Deployment
  32. 32. Use Case Diagram  Used to provide overview of the usecases of the system
  33. 33. Collaboration Diagram  Similar to sequence diagram but does not plot messages against time
  34. 34. Activity Diagram  typically used for business process modeling, for modeling the logic captured by a single use case or usage scenario, or for modeling the detailed logic of a business rule
  35. 35. State Machine Diagram  Depicting the move from one state to another of a complex object
  36. 36. Component Diagram  High-level representation of system components
  37. 37. Deployment Diagram  Similar to component diagram but includes hardware “nodes”

×