开发者

constructor with parameters in UML class diagram

开发者 https://www.devze.com 2023-01-21 07:29 出处:网络
How wou开发者_Python百科ld you create an uml class diagram for constructors with parameters? For default constructors (no parameters) you do

How wou开发者_Python百科ld you create an uml class diagram for constructors with parameters?

For default constructors (no parameters) you do

  • policyholder() for the diagram and in the pseudo-code

For constructors with 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.

constructor with parameters in UML class diagram

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

0

精彩评论

暂无评论...
验证码 换一张
取 消