面向对象软件工程
什么是对象图? (What is an Object Diagram?)
An object is a real-world problem entity whose activities are defined by the classes. The Object is a specimen of a particular moment in runtime, plus objects and data ethics or values. A steady UML object diagram is an example of a class diagram; it shows a snap of the detailed state of a system at a point in time, thus an object diagram circumscribe objects and their relationships at a point in time. It may examine a special case of a class diagram or a communication diagram.
对象是现实世界中的问题实体,其活动由类定义。 对象是运行时特定时刻的样本,还包括对象和数据伦理或价值观。 稳定的UML对象图是类图的示例。 它显示了某个时间点的系统详细状态的快照,因此,一个对象图限制了某个时间点的对象及其关系。 它可以检查类图或通信图的特殊情况。
对象图的符号 (Notation of the Object Diagram)
![Object Diagram | 1](https://i-blog.csdnimg.cn/blog_migrate/2bebc800363e8d19928c97e8f567937d.png)
对象图的动机 (The Motive of Object Diagram)
It is used to represent the occurrence of the class. You might create a class diagram to present the structure and then create a set of objectives.
它用于表示类的出现。 您可以创建一个类图来表示结构,然后创建一组目标。
It is used to understand the activity or working of an object.
它用于了解对象的活动或工作。
In summary, the relation between the instantiated class and the defined class is been shown by the Object diagram. The best way to exemplify what an object diagram looks like is to show the object diagram generated from a similar class diagram.
总之,对象图显示了实例化类和已定义类之间的关系。 举例说明对象图看起来的最好方法是显示从类似的类图生成的对象图。
对象图符号 (Object Diagram Notation)
Name: Every object is represented like a rectangle, that offers the name from the object and its class emphasize as well as divided with a colon.
名称 :每个对象都像一个矩形表示,该矩形提供了对象的名称及其类的重点,并用冒号分隔。
Attributes: Similar to classes, you can list object characteristics inside a separate section. However, unlike classes, object credit should have values given to them.
属性 :与类相似,您可以在单独的部分中列出对象特征。 但是,与类不同,对象信用应该具有赋予它们的值。
Links: Links tells to be an example associated with the relationship. You can draw a link while using the lines utilized in class diagrams.
链接 :链接是与关系相关的一个例子。 您可以在使用类图中使用的线条的同时绘制链接。
绘制对象图的步骤 (Steps for drawing Object diagram)
A communication diagram called collaboration in the previous version of UML without comment is known as an object diagram. An object diagram must be a valid actualization of a fixed class diagram. This can be used as a fast regularity check. To do this we can develop an object diagram by using the following steps:
在UML的先前版本中没有注释的称为协作的通信图称为对象图。 对象图必须是固定类图的有效实现。 这可以用作快速规律性检查。 为此,我们可以使用以下步骤来开发对象图:
Recognize the mechanism you'd like to draw. An apparatus constitute some functions or behaviors of the part of the system you are modeling.
识别您想要绘制的机制。 设备构成您要建模的系统部分的某些功能或行为。
Show the state and accredit values of each such object, as necessary, to understand the scene.
根据需要显示每个此类对象的状态和认证值,以了解场景。
实例规格 (Instance specification)
Each object and link on an object diagram is presented by a current quality. This can show an object's classifier e.g. an abstract or concrete class and instance name, as well as attributes and other structural features using slots. Each part corresponds to a single meaning or feature and may include a value for that state.
对象图上的每个对象和链接均以当前质量表示。 这可以显示对象的分类器,例如抽象或具体的类和实例名称,以及使用槽的属性和其他结构特征。 每个部分对应一个单一的含义或特征,并且可以包括该状态的值。
The name on an instance specification optionally shows an instance name, separator, and not compulsory one or more classifier names separated by commas.
实例规范上的名称可以选择显示实例名称,分隔符,而不是一个或多个用逗号分隔的分类器名称。
对象图示例 (Object diagram example)
![Object Diagram | 2](https://i-blog.csdnimg.cn/blog_migrate/d983a6ff8ebec844cf7406ae77585daf.png)
Image source: https://cloud.smartdraw.com/editor.aspx?templateId=680993af-b8b1-48a9-8fce-3f57a65eb834&noro=1&nsu=1
图片来源:https://cloud.smartdraw.com/editor.aspx?templateId=680993af-b8b1-48a9-8fce-3f57a65eb834&noro=1&nsu=1
翻译自: https://www.includehelp.com/basics/object-diagram-software-engineering.aspx
面向对象软件工程