Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: blackpuppy on March 30, 2005, 06:43:31 pm
-
Is it possible to model the constructor as a class operation? Or there is a specific way to do that?
I want to show the constructor in the communication diagram. I first define an operation named "new". But later found it will be generated as a method named "new" in the code and this is not waht I want. So later I use the class name as the operation name and set the return value blank. I was afraid that the code template will generate a default constructor and another constructor for my operation. But it turns out that the code template will check and avoid generating two constructors of the same name.
How does other people model constructors? What is the recommended way?
Thanks!
-
For C# I do it exactly the way you have described - except I always manually stereotype them as <<ctor>>.
hth
Bruce