简体   繁体   English

JTextfield UML类图

[英]JTextfield UML Class Diagram

I'm having 2 classes for a specific purpose in my project, basically what I am doing is putting everything related to GUI in let's say Class 1 and functionality and data manipulations in Class 2. 我在项目中有两个用于特定目的的类,基本上我正在做的是将与GUI相关的所有内容都放到Class 1中,将功能和数据操作放到Class 2中。

Class 2 will contain member variables such as int, String represented on class diagram. 类2将包含成员变量,例如在类图上表示的int,String。 However for Class 1, I have member variables of type JTextfield, JCombobox, among others which are normally used in a GUI. 但是对于第1类,我有类型为JTextfield,JCombobox的成员变量,以及其他通常在GUI中使用的变量。

My question is : Do we usually show member variables such as JTextfield on the class diagram? 我的问题是:我们通常在类图上显示成员变量,例如JTextfield吗?

Do we usually show member variables such as JTextfield on the class diagram? 我们通常在类图上显示成员变量,例如JTextfield吗?

No 没有

Only variables are need to be mentioned in the class diagram. 类图中仅需提及变量。

For the specifications of the variable, create one more file (Known as UISpecification) and there mention the type of your variable like 对于变量的规范,再创建一个文件(称为UISpecification),然后在其中提及变量的类型,例如

Variable   Type

Str         Text

Usually this UISpecification file is made in XL sheet 通常,此UISpecification文件以XL表制作

The answer is: it depends. 答案是:这取决于。 Namely on the target group of the diagram. 即在图的目标组上。

  • For an overview you can completely suppress the properties compartment. 有关概述,您可以完全隐藏属性栏。
  • For a more general use you can choose to show just public properties. 对于更一般的用途,您可以选择仅显示公共属性。
  • And for a detailed (implementation) view you can create a diagram that shows private properties also. 对于详细的(实现)视图,您可以创建一个还显示私有属性的图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM