โœ๏ธHow to Design Star UML file

Create your own Design:

Code-Wizard supports StarUML tool for creating a Design File or a UML (Unified Modeling Language) diagram for the purpose of generating code. Below is a step-by-step guide to create a model file in StarUML:

Step 1: Install StarUML

Visit the StarUML website and download the suitable version for your Operating System. Install the StarUML.

Step 2: Create a new Project

Click on File- New Project or start with a blank project.

Step 3: Add elements to diagram

Classes:

  • From the left hand side under toolbox, drag and drop 'class'.

  • Click on the class and you will see an Editor box on right hand side, you can rename the class, stereotype like enumtype, complextype etc.

  • For simple or entitytype class, no need to select any stereotype of class.

  • Attributes and methods can also be added by right-clicking, click on Add and then click on Attribute or Operation.

Attributes:

  • Click on the added attribute, go to the editor box in right hand side, rename the attribute and write in the type as Int, String, Double, Date, Long, Boolean etc.

  • Create one of the attribute as Id by checking the isId option shown in the editor box.(Mandatory)

  • If you have used any class as enumtype or complextype and want to use that in another entity type/simple class, select type of attribute as enumtype classname.

Associations:

  • To define relationship in two classes, we need to add Association from the left hand side menu under toolbox.

  • Select the association and write the name from editor box and select end2.multiplicity like 1, 1..*, and so on.

Guidelines for creating design StarUML file

Classes

  • Give a name to the UML Model which is created.

  • Class name should start with a Capital letter in the beginning.

  • Class names should not have spaces.

  • Class names should not have underscore.

Attributes

  • Attributes should be in small letters only.

  • If the first letter is in upper case, let the platform change it to camel case

  • Declare data type

  • Should check/tick โ€œisIdโ€ for key property of the class

  • Associations should be drawn in every UML Model.

Associations:

Name should start with โ€œcapital letterโ€.

Name should be a โ€œNounโ€, not an operation / action. However, exceptions apply.

Data Types Supported

  • Int: Integers, whole numbers without a decimal point. Example: 42

  • Float: Floating point numbers, numbers that include a decimal point. Example: 3.14

  • Decimal: Decimal numbers, more precise than floats, often used for financial calculations. Example: 10.99

  • String: A sequence of characters, used to represent text. Example: "Hello, World!"

  • List(String): A list or array of strings, used to store multiple text values. Example: ["apple", "banana", "cherry"]

  • Boolean: A binary value representing true or false. Example: true

  • Long: Long integers, used for larger whole numbers. Example: 1234567890

  • DateTimeOffset: Represents date and time with an offset from UTC, used to store exact date and time values including time zone information. Example: 2024-05-29T14:53:00+00:00

  • Date: Represents only the date without time. Example: 2024-05-29

Associations Supported

  • One-to-One: An association where one instance of a class is associated with one instance of another class. This type of association is used when each instance of a class can have only one counterpart in the associated class. Example: A Manager can be associated with one PetCareCenter.

    • Example: Manager โ†” PetCareCenter

  • One-to-Many: An association where one instance of a class is associated with multiple instances of another class. This type of association is used when each instance of a class can be related to multiple counterparts in the associated class. Example: A PetOwner can have multiple Pets.

    • Example: PetOwner โ†” Pet(s)

https://docs.staruml.io/working-with-uml-diagrams/class-diagram

Last updated