`
ihuashao
  • 浏览: 4664177 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

What is a UML Class Diagram?

阅读更多

What is a UML Class Diagram?

Class diagrams are the backbone of almost every object-oriented method including UML. They describe the static structure of a system.

Basic Class Diagram Symbols and Notations

Classes represent an abstraction of entities with common characteristics. Associations represent the relationships between classes.

Illustrate classes with rectangles divided into compartments. Place the name of the class in the first partition (centered, bolded, and capitalized), list the attributes in the second partition, and write operations into the third.
Learn how to create this symbol.

Classes

Active Class

Active classes initiate and control the flow of activity, while passive classes store data and serve other classes. Illustrate active classes with a thicker border.

Active Class

Visibility

Use visibility markers to signify who can access the information contained within a class. Private visibility hides information from anything outside the class partition. Public visibility allows all other classes to view the marked information. Protected visibility allows child classes to access information they inherited from a parent class. Learn how to edit text.

Visibility

Associations

Associations represent static relationships between classes. Place association names above, on, or below the association line. Use a filled arrow to indicate the direction of the relationship. Place roles near the end of an association. Roles represent the way the two classes see each other.
Note: It's uncommon to name both the association and the class roles.
Learn how to edit text.

Associations

Multiplicity (Cardinality)

Place multiplicity notations near the ends of an association. These symbols indicate the number of instances of one class linked to one instance of the other class. For example, one company will have one or more employees, but each employee works for one company only.

Multiplicity (Cardinality)

Constraint

Place constraints inside curly braces {}.

Simple Constraint Constraint

Composition and Aggregation

Composition is a special type of aggregation that denotes a strong ownership between Class A, the whole, and Class B, its part. Illustrate composition with a filled diamond. Use a hollow diamond to represent a simple aggregation relationship, in which the "whole" class plays a more important role than the "part" class, but the two classes are not dependent on each other. The diamond end in both a composition and aggregation relationship points toward the "whole" class or the aggregate.

Composition and Aggregation

Generalization

Generalization is another name for inheritance or an "is a" relationship. It refers to a relationship between two classes where one class is a specialized version of another. For example, Honda is a type of car. So the class Honda would have a generalization relationship with the class car.

Generalization In real life coding examples, the difference between inheritance and aggregation can be confusing. If you have an aggregation relationship, the aggregate (the whole) can access only the PUBLIC functions of the part class. On the other hand, inheritance allows the inheriting class to access both the PUBLIC and PROTECTED functions of the superclass.

分享到:
评论

相关推荐

    UML class diagram

    UML class diagram

    C# and UML class diagram

    泛化关系,也称为继承,表示“is-a”的逻辑关系,如`public class DerivedClass : BaseClass`,表明DerivedClass是BaseClass的一种特殊情况。在UML中,继承用带空箭头的直线表示。 依赖关系是一种临时性的关联,...

    UML class diagram tutorial

    统一建模语言(UML)类图教程涵盖了如何使用UML来构建和可视化面向对象系统。UML类图是由一组类和类之间的关系集合构成的图形化表示方法。在面向对象系统中,一个类提供了一个明确定义责任集合的清晰抽象。类由三个...

    Python库 | protobuf-uml-diagram-0.7.tar.gz

    资源分类:Python库 所属语言:Python 资源全名:protobuf-uml-diagram-0.7.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    UML 2 Class Diagram Guidelines

    《UML 2 类图设计指南》 UML(统一建模语言)是软件工程领域中用于系统建模的一种标准语言,它通过图形化的方式帮助我们理解和表达软件系统的结构和行为。类图是UML中的一种核心图表,主要用于描绘系统的静态结构,...

    Voodoo UML Class Diagram Editor-开源

    Voodoo UML Class Diagram Editor是一款基于C++开发的开源UML类图编辑工具,它利用Tcl/Tk作为图形用户界面(GUI)的部分。这款编辑器的目的是提供一个直观且功能丰富的平台,使得软件开发者和设计者能够方便地创建、...

    Edrawsoft.Edraw.UML.Diagram.v5.1.0.1214-Cracked-RedT

    Edraw UML Diagram is a new software diagram design tool which works in the following drawing fields: UML Model Diagram, COM and OLE, Data Flow Model Diagram, Jacobson Use Case, SSADM, Program ...

    UML簡介_Class Diagram.pdf

    其中,类图(Class Diagram)是UML中最常用的一种图表类型,用于展示系统中类的静态结构及其相互关系。本文将详细介绍类图的基本概念、组成元素以及如何使用类图来描述系统。 #### 二、类图目的与作用 类图的主要...

    Edrawsoft.Edraw.UML.Diagram.v5.1.0.1214-Cracked-RedT2

    Edraw UML Diagram is a new software diagram design tool which works in the following drawing fields: UML Model Diagram, COM and OLE, Data Flow Model Diagram, Jacobson Use Case, SSADM, Program ...

    Draw2D UML Diagram

    《Draw2D UML Diagram——源码与工具的深度解析》 在软件开发过程中,UML(统一建模语言)图是一种重要的可视化工具,它帮助我们理解和表达系统的设计。Draw2D UML Diagram是一个用于创建UML类图的工具,通过源码...

    Overview NClass is a free tool to easily create UML class diagra

    NClass is a free tool to easily create UML class diagrams with full C# and Java language support. The user interface is designed to be simple and user-friendly for easy and fast development. ...

    PowerDesigner UML 建模简介(第一部分).pdf

    ### PowerDesigner UML 建模简介 #### 面向对象分析 在现代软件开发过程中,面向对象分析(OOA)是一种非常重要的方法论,它帮助开发人员更好地理解问题域,进而设计出更加灵活、可扩展且易于维护的软件系统。...

    EXT JS 3.0 Core Class Diagram

    EXT JS 3.0 Core Class Diagram 是一个关于EXT JS库核心类结构的图表,它展示了EXT JS 3.0版本中的主要组件和它们之间的关系。EXT JS是一个强大的JavaScript库,主要用于构建富客户端Web应用程序,其核心功能包括...

    UML建模之时序图(SequenceDiagram)

    时序图(SequenceDiagram)是显示对象之间交互的图,这些对象是按时间顺序排列的。顺序图中显示的是参与交互的对象及其对象之间消息交互的顺序。时序图中包括的建模元素主要有:对象(Actor)、生命线(Lifeline)、...

    ClassDiagram.cd

    程序设计大作业的类图描述,用于展示各个类之间的关系。方便阅读相关的代码。通过类图可以完成一个程序的总体架构,并对各个架构进行分析和编写。类图还可以展示类的成员,通过点击类的成员可以直接定位到相应代码...

    UML 2.0 in a Nutshell

    This comprehensive new edition not only provides a quick-reference to all UML 2.0 diagram types, it also explains key concepts in a way that appeals to readers already familiar with UML or object-...

    Java Call Trace to UML Sequence Diagram-开源

    Java Call Trace to UML Sequence Diagram 是一款开源工具,专门用于将Java程序的调用跟踪转换为UML序列图。这个工具对于理解复杂程序的行为、调试多线程问题以及剖析部署在应用服务器上的J2EE应用程序尤其有用。UML...

    UML2.2-Visio2007.zip.

    UML use case diagram, class diagram, package diagram, object diagram, composite structure diagram, interaction diagram, sequence diagram, communication diagram, interaction overview diagram, activity...

Global site tag (gtag.js) - Google Analytics