Home » Modeling » UML2 » Constructors and Parameters
Constructors and Parameters [message #477670] |
Mon, 11 August 2008 20:28 |
Eclipse User |
|
|
|
Originally posted by: pfuriani.uci.edu
To create a method (operation) for a class, I right click on the class (in
the text editor), and choose the option "New Child" -> "Owned Operation" ->
"Operation". Then, in the properties view I can't figure out how to set
parameters for the operation. Also, How do I make a constructor for a
class? Thanks.
|
|
|
Re: Constructors and Parameters [message #477672 is a reply to message #477670] |
Mon, 11 August 2008 22:45 |
Eclipse User |
|
|
|
Originally posted by: cdamus.zeligsoft.com
Hi, PFuriani,
To create operation parameters, you can use the "New Child -> Owned
Parameter" action in the context menu (like what you used to create the
operation. Input parameters generally have the default "in" direction.
To specify the return type, you need to create an owned parameter and
set its direction to "return."
UML doesn't model constructors as such. Your best approximation to a
Java constructor is a static operation that has the same name as the
class and the class as its return type. The semantics of constructor
chaining etc. are language-specific and outside of the scope of UML.
HTH,
Christian
PFuriani wrote:
> To create a method (operation) for a class, I right click on the class (in
> the text editor), and choose the option "New Child" -> "Owned Operation" ->
> "Operation". Then, in the properties view I can't figure out how to set
> parameters for the operation. Also, How do I make a constructor for a
> class? Thanks.
>
>
|
|
|
Re: Constructors and Parameters [message #477673 is a reply to message #477670] |
Mon, 11 August 2008 22:55 |
Eclipse User |
|
|
|
Originally posted by: pfuriani.uci.edu
Update: I figured out how to make the parameters, but I am still not sure
how to make a Constructor for a class. There is no option "New Child" ->
"Owned Constructor". Can someone please tell me how I can create a
constructor? Thanks
"PFuriani" <pfuriani@uci.edu> wrote in message
news:g7q75n$o41$1@build.eclipse.org...
> To create a method (operation) for a class, I right click on the class (in
> the text editor), and choose the option "New Child" -> "Owned
> Operation" -> "Operation". Then, in the properties view I can't figure
> out how to set parameters for the operation. Also, How do I make a
> constructor for a class? Thanks.
>
|
|
|
Re: Constructors and Parameters [message #477681 is a reply to message #477672] |
Tue, 12 August 2008 18:36 |
Eclipse User |
|
|
|
Originally posted by: pfuriani.uci.edu
I have a question. If I import a UML model from a .uml or .xmi file that
was created from a different UML modeling tool, then will the "in" and "out"
directions of parameters (and the return type) for operations be set in the
properties view like how you describe they are supposed to be set here? Or
do they only get set this way if you create the UML model using UML2?
"Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
news:g7qfdu$ue4$1@build.eclipse.org...
> Hi, PFuriani,
>
> To create operation parameters, you can use the "New Child -> Owned
> Parameter" action in the context menu (like what you used to create the
> operation. Input parameters generally have the default "in" direction. To
> specify the return type, you need to create an owned parameter and set its
> direction to "return."
>
> UML doesn't model constructors as such. Your best approximation to a Java
> constructor is a static operation that has the same name as the class and
> the class as its return type. The semantics of constructor chaining etc.
> are language-specific and outside of the scope of UML.
>
> HTH,
>
> Christian
>
>
> PFuriani wrote:
>> To create a method (operation) for a class, I right click on the class
>> (in the text editor), and choose the option "New Child" -> "Owned
>> Operation" -> "Operation". Then, in the properties view I can't figure
>> out how to set parameters for the operation. Also, How do I make a
>> constructor for a class? Thanks.
|
|
|
Re: Constructors and Parameters [message #477682 is a reply to message #477681] |
Tue, 12 August 2008 18:39 |
Eclipse User |
|
|
|
Originally posted by: cdamus.zeligsoft.com
The structure of an Operation is defined by the UML specification. Any
tool that exports a UML-compliant XMI 2.1 file will provide the correct
structure, as you are able to produce using the MDT UML2 editor.
HTH,
Christian
PFuriani wrote:
> I have a question. If I import a UML model from a .uml or .xmi file that
> was created from a different UML modeling tool, then will the "in" and "out"
> directions of parameters (and the return type) for operations be set in the
> properties view like how you describe they are supposed to be set here? Or
> do they only get set this way if you create the UML model using UML2?
>
|
|
| |
Re: Constructors and Parameters [message #626864 is a reply to message #477670] |
Mon, 11 August 2008 22:45 |
Eclipse User |
|
|
|
Originally posted by: cdamus.zeligsoft.com
Hi, PFuriani,
To create operation parameters, you can use the "New Child -> Owned
Parameter" action in the context menu (like what you used to create the
operation. Input parameters generally have the default "in" direction.
To specify the return type, you need to create an owned parameter and
set its direction to "return."
UML doesn't model constructors as such. Your best approximation to a
Java constructor is a static operation that has the same name as the
class and the class as its return type. The semantics of constructor
chaining etc. are language-specific and outside of the scope of UML.
HTH,
Christian
PFuriani wrote:
> To create a method (operation) for a class, I right click on the class (in
> the text editor), and choose the option "New Child" -> "Owned Operation" ->
> "Operation". Then, in the properties view I can't figure out how to set
> parameters for the operation. Also, How do I make a constructor for a
> class? Thanks.
>
>
|
|
|
Re: Constructors and Parameters [message #626865 is a reply to message #477670] |
Mon, 11 August 2008 22:55 |
Eclipse User |
|
|
|
Originally posted by: pfuriani.uci.edu
Update: I figured out how to make the parameters, but I am still not sure
how to make a Constructor for a class. There is no option "New Child" ->
"Owned Constructor". Can someone please tell me how I can create a
constructor? Thanks
"PFuriani" <pfuriani@uci.edu> wrote in message
news:g7q75n$o41$1@build.eclipse.org...
> To create a method (operation) for a class, I right click on the class (in
> the text editor), and choose the option "New Child" -> "Owned
> Operation" -> "Operation". Then, in the properties view I can't figure
> out how to set parameters for the operation. Also, How do I make a
> constructor for a class? Thanks.
>
|
|
|
Re: Constructors and Parameters [message #626873 is a reply to message #477672] |
Tue, 12 August 2008 18:36 |
Eclipse User |
|
|
|
Originally posted by: pfuriani.uci.edu
I have a question. If I import a UML model from a .uml or .xmi file that
was created from a different UML modeling tool, then will the "in" and "out"
directions of parameters (and the return type) for operations be set in the
properties view like how you describe they are supposed to be set here? Or
do they only get set this way if you create the UML model using UML2?
"Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
news:g7qfdu$ue4$1@build.eclipse.org...
> Hi, PFuriani,
>
> To create operation parameters, you can use the "New Child -> Owned
> Parameter" action in the context menu (like what you used to create the
> operation. Input parameters generally have the default "in" direction. To
> specify the return type, you need to create an owned parameter and set its
> direction to "return."
>
> UML doesn't model constructors as such. Your best approximation to a Java
> constructor is a static operation that has the same name as the class and
> the class as its return type. The semantics of constructor chaining etc.
> are language-specific and outside of the scope of UML.
>
> HTH,
>
> Christian
>
>
> PFuriani wrote:
>> To create a method (operation) for a class, I right click on the class
>> (in the text editor), and choose the option "New Child" -> "Owned
>> Operation" -> "Operation". Then, in the properties view I can't figure
>> out how to set parameters for the operation. Also, How do I make a
>> constructor for a class? Thanks.
|
|
|
Re: Constructors and Parameters [message #626874 is a reply to message #477681] |
Tue, 12 August 2008 18:39 |
Eclipse User |
|
|
|
Originally posted by: cdamus.zeligsoft.com
The structure of an Operation is defined by the UML specification. Any
tool that exports a UML-compliant XMI 2.1 file will provide the correct
structure, as you are able to produce using the MDT UML2 editor.
HTH,
Christian
PFuriani wrote:
> I have a question. If I import a UML model from a .uml or .xmi file that
> was created from a different UML modeling tool, then will the "in" and "out"
> directions of parameters (and the return type) for operations be set in the
> properties view like how you describe they are supposed to be set here? Or
> do they only get set this way if you create the UML model using UML2?
>
|
|
| |
Goto Forum:
Current Time: Thu Apr 25 22:14:13 GMT 2024
Powered by FUDForum. Page generated in 0.03955 seconds
|