Jump to content

Recommended Posts

I'm sorry, I checked all the forums and didn't know where to ask this @_@ I really wanted to ask on phpfreaks.com though because everyone here answers 1) fast, and 2) correctly :P

 

So I'm ACTUALLY working on a Java assignment... but the language shouldn't matter here... UML should be the same for all OO languages right? :)

 

I am just wondering, what do I put as the return type for constructors (in the method/3rd box of a class diagram)? Constructors technically "return" an object of type CLASS (whatever it is constructing for) right? So do I put...

 

+ thisConstructor() : CLASS

 

or should it be VOID? **OR** do I not even include constructors in UML diagrams? :P

 

Thanks so much to anyone who can help me out :D

Link to comment
https://forums.phpfreaks.com/topic/52588-simple-oo-uml-help/
Share on other sites

<<constructor>> SomeClass() : void is the common thing to do I believe. I personally would simply omit the return type, because the constructor stereotype already makes it irrelevant. As much with UML, it's mostly preference though. <<constructor>> SomeClass() : SomeClass would be acceptable too IMO.

Link to comment
https://forums.phpfreaks.com/topic/52588-simple-oo-uml-help/#findComment-259676
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.