1 / 5

UML class diagrams: What are they?

UML class diagrams: What are they?. Unified Modeling Language ( UML ) “A family of graphical notations … that help in describing and designing [object-oriented] software systems” – Martin Fowler Developed in 1997 to unify the previous object-oriented graphical modeling languages

glassf
Download Presentation

UML class diagrams: What are they?

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 class diagrams: What are they? • Unified Modeling Language (UML) • “A family of graphical notations … that help in describing and designing [object-oriented] software systems” – Martin Fowler • Developed in 1997 to unify the previous object-oriented graphical modeling languages • Now the world-wide standard • We focus on UML class diagrams • These show: • Relationships between classes in the software system • Details of the classes

  2. 1 means one * means 0 or more 1 .. * means 1 or more 0 .. 1 means 0 or 1 A relationships-onlyUML class diagram • is-a (by extending a class) • is-a (by implementing an interface) • has-a Person * * Man Woman Daughter Son 1 1 This diagram might also show which objects are to construct which other objects Father Mother PersonAbleToProcreate <<interface>>

  3. A relationships-onlyUML class diagram Instructor: give each student a paper copy of this slide. The example is taken from Martin Fowler’s UML Distilled, 3rd Edition. Exercise: draw arrows to indicate the relationships between these classes in an order-processing system. For example, think of the company as Amazon and the system as Amazon’s system for processing orders from customers. After drawing the arrows, indicate the multiplicities. Order Customer lineItem Order Line Corporate Customer Personal Customer Product 1 means one * means 0 or more 1 .. * means 1 or more 0 .. 1 means 0 or 1 is-a (by extending a class) is-a (by implementing an interface) has-a salesRep Employee

  4. One answer to the exercise on the previous slide Exercise: draw arrows to indicate the relationships between these classes in an order-processing system. For example, think of the company as Amazon and the system as Amazon’s system for processing orders from customers. Here is one answer, but not the only possible one! Depends on exactly what you want to model… Order Customer * 1 1 lineItem * Order Line * Corporate Customer Personal Customer 1 Product * 1 means one * means 0 or more 1 .. * means 1 or more 0 .. 1 means 0 or 1 is-a (by extending a class) is-a (by implementing an interface) has-a 0..1 salesRep Employee

  5. UML class diagrams • What they are • A notation to assist object-oriented design (not just Java) • Why use UML? • UML as sketch • To figure out a design • To communicate ideas and alternatives • UML as blueprint • To convey the design to the coder • UML as programming language • To generate code automatically from the design This is how we (and most people) use UML class diagrams – as a tool to help our thinking

More Related