Jump to content

simple OO UML help?


triphis

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.