带参数的uml类关系图构造函数 [英] uml classdiagram constructor with parameters

查看:664
本文介绍了带参数的uml类关系图构造函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个完全的新手,因此我需要一些帮助。



如何创建带参数的uml类图和构造函数。



默认(无参数),您执行



policyholder()进行图表和伪代码



对于参数,您会做同样的事情



用于类图和伪代码的policyholder(策略编号,服务类别和客户年龄)。 / p>

它还要求将每个属性初始化为可实例化此类型对象的值,如果策略号不在1000和999之间(包括1000和999),则设置该策略号到0。(策略号是属性)

解决方案

常见的方法是编写类似方法的构造函数,并简单地省略返回类型。





如果要特别清晰,可以添加<< constructor& gt;> 在前面。


I am a complete ROOKIE at this so I need some help on it.

How would you create uml class diagram and constructors with parameters.

for default (no parameters) you do

policyholder() for diagram and pseudo-code

for parameters would you do the same thing

policyholder (policynumber, service class, and customer age) for class diagrams and pseudo-code.

It also asked to initialize each attribute to value where an object of this type can be instantiated, If a policy number is not between 1000 and 999 inclusive, then set the policy number to 0. (policy number is attribute)

解决方案

The common way is to write constructors like methods and simply omit the return type.

If you want to be extra clear, you can add <<constructor>> in front.

这篇关于带参数的uml类关系图构造函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆