Star UML: how to add get/set properties - uml

I have started using Star UML application and its great. Is there a way to add get/set functions and foward/reverse engineer the code.
Thanks

Create an operator then set the stereotype to CSharpProperty.
Example:
Right-click the class in the Model Explorer
Select Add -> Operation
In the property pane add the CSharpProperty stereotype.
Add a "return" parameter (right-click the new operation and select Add -> return)
Set the Type to the property type (e.g. int, string, etc.)
Set the DiretionKind to Return
The above steps should produce C# code with both an accessor and modifier when StarUML generates the code.

You just need to install a tool named "Generate Getters and Setters".
Open the StarUML and select Tools -> Extension Manager...
Search "Generate Getters and Setters" and install it
Reload the StarUML
Select attributes or classes first and then select Tools -> Generate Getters Setters(Ctrl+Alt+G)
staruml-gettersetter in GitHub

I don't think that there is an easy way for automation in generating getters and setters.
The development of StarUML stopped 4 years ago. An alternative would be nice.

Related

Constructor in visual paradigm

How can you take a HashMap of type, for example, <Person,Integer>, as a parameter for the constructor in class diagrams? Every time I try in visual paradigm, it gives an error.
I am not sure what error you were getting, but what you wanted to achieve can be done by performing the steps in Visual Paradigm.
Add a constructor into the class by right clicking on the class and selecting Add > Constructor.
Right click on the constructor and select Open Specification...
Under the Parameters tab, click Add...
Enter the parameter name, enter java.util.HashMap as type and as Type modifier. If you want only a diagram for presentation purpose without the need of code generation, you may enter HashMap without entering 'java.util.HashMap'
Done!
The article below provides you with more information about their Class Diagram support. Hope this helps.
https://circle.visual-paradigm.com/docs/uml-and-sysml/class-diagram/how-to-draw-a-class-diagram-in-uml/
Do you mean something like this?

How to create abstract class in MagicDraw

I'm newbie in MagicDraw and I'd like to know how to specify a class as {abstract}.
I know about de property "Is abstract" in the Specification of Class, but I'd like that it appears in the header.
The place where you set isAbstract in MagicDraw is in the specification window for the class. To open that window, either right-click on the class or press enter while it is selected. The window will look like this:
You didn't specifically ask for more information, but I'll provide it in case you find it helpful.
The model you want to create will look like this:
Notice that Abstract Class is written in italics to indicate it is abstract. Also notice that {complete, disjoint} is specified for the generalization set. (Just FYI, {complete} is also known as a covering axiom.)
Beware that if you do not specify {complete}, you're creating a conflict with the isAbstract meta-property. The reason there's a conflict is that in UML, the default is {incomplete}, which means that you are allowed to create an instance of the super-class without it also being an instance of one of the sub-classes. That conflicts with isAbstract.

Is there option to show attributes of operations in Rational Software Architect?

I'm fairly new to Rational Software Architect and it annoys the hell out of me that I can't see attributes of operations (methods) in UML diagrams. If I add method called get() with attributes att1 and att2, I'd like to see get(In att1, In att2) on diagram.
Is there a possibility to show this by default?
Right click on a class -> "Filters" -> "Show Signature".
Click on the class diagram background and then use the show hide compartment option. You have attributes and methods compartments which need to selected in order to be displayed graphically.
It worked pretty well last time I evaluated the Rational tools.

how to automatically create an interface member from within a class using Resharper?

I have already created an interface, and I am in the class that binds to the interface.
If I create a new method in the concret class, is there a shortcut to create the method declaration in the interface?
Refactor - Pull Members Up:
This refactoring helps you move type members to a superclass or an interface. This operation is useful as a way to generalize behavior. ReSharper analyzes all members in the current class and makes a list of members that you can pull up. Before completing the refactoring, ReSharper also checks for possible conflicts, for example, whether the members that you are trying to move to a superclass will be accessible in the destination type. The reverse functionality is available with 'Push Members Down'.
The keyboard shortcut for invoking this re-factoring is: Alt+R > R > U

How to add a display name for a decorator in Visual Studio DSL (Domain Specific Language) Tools?

In my DSL project I have a shape with a number of decorators that are linked to properties on my domain class. But even though ieach decorator has a DisplayName property (set to a meaningfull value) it does not appear in the generated DSL project. (I have not forgtten to use regenerate the t4 files.)
Do I have to create another decorator for each property that only has the display name as a value that I wish to display or is there some other way that I can't figure out right now?
I assume by a display name for the decorator you mean you want the element in the generated DSL to appear as "Example = a_value" where a_value is the actual value and Example is the property name.
What I've done with this in the past is to create second property "ExampleDisplay" that's not browsable and is what the decorator actually points to. I then set the Kind property of the ExampleDisplay to "Calculated". You then need to provide the method that the toolkit tries to call to display the decorator which you can do a partial class.
partial class ExampleElement
{
string GetExampleDisplayValue()
{
return "Example : " + this.Example;
}
}
This is not ideal as you don't get a good way of setting the property on the DSL diagram you have to use the properties window. (There's sometime lags from the property window unless you hook into the update of the underlying property too). Getting the slick editing in the GUI that actual DSL toolkit does maybe possible but I haven't found out how.
It maybe worth ask VSX forums if you haven't already done so.

Resources