Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Tigerstripe Class Diagram Tutorial"

(Editing the Model through the Diagram Editor)
Line 58: Line 58:
 
** To add an attribute from the editor, hover the mouse pointer over the artifact where you wish to add the attribute.  
 
** To add an attribute from the editor, hover the mouse pointer over the artifact where you wish to add the attribute.  
 
** Notice a floating toolbar will appear with icons representing items that can be added to the Artifact - a red square corresponds to an Attribute (as it does in the Tigerstripe Explorer expanded view).
 
** Notice a floating toolbar will appear with icons representing items that can be added to the Artifact - a red square corresponds to an Attribute (as it does in the Tigerstripe Explorer expanded view).
** Click on the icon and an attribute will be added to the Artifact, with default name and type. This is equivalent to selecting the '''Add'' button in the Attributes section of the Artifact editor.
+
** Click on the icon and an attribute will be added to the Artifact, with default name and type. This is equivalent to selecting the '''Add''' button in the Attributes section of the Artifact editor.
  
 
* Adding Methods and Labels to Artifacts.
 
* Adding Methods and Labels to Artifacts.
 
** This is done in using the same technique as for attributes, but selecting the relevant icons in the floating toolbar.
 
** This is done in using the same technique as for attributes, but selecting the relevant icons in the floating toolbar.
  
 +
 +
Class Diagram are automatically kept up to date with model changes that are made through Artifact editors (although you may be prompted to save the diagram after such updates). Similarly updates made through the diagram editor are automatically propagated to the Tigerstripe Explorer.
 +
 +
You can switch from the Diagram Editor to the Artifact Editor by selecting an Artifact in the Diagram, right-clicking and selecting '''Open in Editor'''
  
 
=Enhancing your diagram=  
 
=Enhancing your diagram=  

Revision as of 11:45, 24 January 2008

< To: Tigerstripe_Tutorials

You can edit a Tigerstripe model project graphically using the Tigerstripe Class Diagram Editor. This allows you to better visualize how the artifacts in your model are related and used.

Prerequisites

Before you can complete this tutorial, you must be familiar with the concepts covered in the Simple Service Contract Design tutorial.

Create a new class diagram

  1. Open a Tigerstripe Project and navigate to a package where you have, or want to create, some artifacts. Right-click on the package folder in the Tigerstripe Explorer, select New and click New Class Diagram. The New Tigerstripe Diagram dialog box opens.
    creatediagram
  2. Enter a file name and click Finish.
    • For this example use the name simpleDiagram.

In the Tigerstripe Explorer you will see a new icon representing your Class Diagram, and the Diagram Editor will open, showing a blank diagram.

You are now ready to start graphically designing your service contract.

Add existing Artifacts a Class diagram

  • Click on an artifact in your project (Note: Don't select an Association, AssociationClass or Dependency Artifact!)
  • Keep the mouse button pressed down and drag the icon across the diagram, then release the mouse.
  • The artifact will be shown in the diagram, with its Annotations, Attributes, Methods and Labels as appropriate.
  • As you drag more artifacts on, any Associations, AssociationClasses or Dependencies that relate to the artifacts are automatically added to the diagram, as are extends relationships.


Adding Artifacts to the model using the Diagram Editor

The drawing pallete is the most convient way to create your service contract when utilizing the Tigerstripe Diagram Editor. The drawing pallete automatically displays on the right hand side of the Tigerstripe Diagram Editor once you create your class diagram.

  • To create a new artifact, click on the icon corresponding to the type of artifact you wish to create, then point to where on the diagram you want to draw it, and click again.
  • The artifact will be drawn, and the name of the artifact will immediately be set in edit mode so that you can enter your own name for the artifact.
  • When you have entered the name, press Enter.

Alternatively, if you rest the mouse pointer on the diagram background, the available artifact types will appear in a floating toolbar - just select the type and proceed as above.

Notice that the artifacts created like this are created in the package where the diagram was created, and that they are automatically added to the Tigerstripe Explorer.


  • Adding Relationships

You may notice that there are no icons for adding Associations, AssociationClasses or Dependencies (Collectively called relationship). These can be added directly to your diagram as follows:

    • Hover the mouse pointer the artifact that you want to be at one end of the relationship.
    • Notice two arrows will appear that point to/from the artifact. Click on the box at the end of the arrow pointing away from the artifact. Hold the mouse button down and drag the line to the artifact you want to be at the other end of your relationship, then release the mouse.
    • A pop-up menu will appear with a number of options asking you which type of relationship should be created. Select Create Association.
    • An Association Artifact will be created in the Tigerstripe Explorer, and it will be drawn on the diagram. You can edit the name as for the Artifact you just created.
    • Using the away arrow will result in the first Artifact you selected being the A end and the second being the Z end. using the in arrow would have created the Association with the ends swapped.

Note that subject to normal model constraints you can also create Extends relationships between Artifacts in the same way, even though these are not Artifacts themselves.


Editing the Model through the Diagram Editor

  • Adding Attributes to Artifacts
    • To add an attribute from the editor, hover the mouse pointer over the artifact where you wish to add the attribute.
    • Notice a floating toolbar will appear with icons representing items that can be added to the Artifact - a red square corresponds to an Attribute (as it does in the Tigerstripe Explorer expanded view).
    • Click on the icon and an attribute will be added to the Artifact, with default name and type. This is equivalent to selecting the Add button in the Attributes section of the Artifact editor.
  • Adding Methods and Labels to Artifacts.
    • This is done in using the same technique as for attributes, but selecting the relevant icons in the floating toolbar.


Class Diagram are automatically kept up to date with model changes that are made through Artifact editors (although you may be prompted to save the diagram after such updates). Similarly updates made through the diagram editor are automatically propagated to the Tigerstripe Explorer.

You can switch from the Diagram Editor to the Artifact Editor by selecting an Artifact in the Diagram, right-clicking and selecting Open in Editor

Enhancing your diagram

  • Zooming
  • Layout
  • Notes
  • Options

In addition to the Artifact menu options, you can also:

  • Select items in your diagram using the Select tool ().
  • Zoom in closer to view specific areas of your diagram using the Zoom tool ().
  • Zoom out to view your entire diagram by pressing SHIFT + the Zoom tool.
  • Attach notes and text to your diagram by using the Note tool () and the corresponding pull-down menu to select from the options available: Note, Text, Note Attachment.

Note: If you rest on the drawing area of the editor, an Artifact shortcut menu will appear. The tools available from this menu are identical to the tools available from the other access options. Attaching Notes and Text

Using the options available from the Note tool, you can attach text and notes to your diagram to further explain your service contract.

To attach a note:

  1.
     Click Note (), in the Diagram Editor Drawing pallete.
  2.
     Click in the Diagram Editor and the Note appears.
  3.
     Enter the necessary information in your note and click Save to save your changes.

To attach text:

  1. Select the drop-down menu next to the Note tool.
  2. Click Text and click in the Diagram Editor. An empty text box appears.
  3. Enter your text in the text box and click Save to save your changes.

Create a Session Facade

With the diagram editor.

In the previous step, you created a new project named SimpleProject. After you create your new project, you can create a Session Facade using the Tigerstripe Diagram Editor. For detailed information about a Session Facade, refer to Create a Service End-point Model. Complete the following procedure to create a Session Facade in your SimpleProject.

To create a Session Facade:

  1.
     Click Session Facade (), in the Diagram Editor Drawing pallete.
  2.
     Click in the Diagram Editor and the Session Facade appears. When you initially create a Session Facade, the facade is pre-populated with the default name of Session0.
  3.
     Enter a name for your facade.
     For this example, name your facade MySessionFacade.

Note: Your new facade automatically displays in the Tigerstripe Explorer under the src folder.

  4.
     Rest on your facade, and the Add Method option appears (createmethod).
  5.
     Click Add Method and a default method named void method0() appears.
  6.
     Enter a new name for your method.
     For this example, name your method processOrder.
  7.
     Double click the project descriptor (tigerstripe.xml) in the Tigerstripe Explorer. This opens your Tigerstripe project perspective.
  8.
     Navigate to the Generation tab and enable the desired generation plug-ins.
  9.
     Click Save to save your changes.
 10. Click the Generate icon generateIcon on the toolbar. The Generate Tigerstrip Project dialog box displays.
 11. Accept the default Source Folder or click Browse to navigate to a new location and click Finish.

Create a Managed Entity

Enhancing your session facade.

As in the Simple Service Contract Design tutorial, you can enhance your service model by creating an entity artifact and adding attributes to your entity. After you successfully create your entity artifact, you can establish your managed entity.

To create an entity artifact:

  1.
     Click Managed Entity (), in the Diagram Editor Drawing pallete.
  2.
     Click in the Diagram Editor and the Managed Entity appears. When you initially create a Managed Entity, the entity is pre-populated with the default name of Entity0.
  3.
     Enter a name for entity.
     In this example, name your entity Order.

To add attributes to your entity:

  1. Rest on your entity, and the Add Attribute option appears ().

Note: You will also have the option to add a method.

  2.
     Click Add Attribute and a default attribute named attribute0:String appears.
  3.
     Enter a new name for your attribute.
     For this example, name your attribute OrderId.

To establish your managed entity:

  1. Rest on your session facade;MySessionFacade. In addition to the Add Method option, you will also see a couple of arrows appear. These arrows allow you to establish associations between entities within your service contract.
     In this example, you have one session facade named MySessionFacade and one entity named Order.
  2. Click the arrow that leads away from your session facade and connect the arrow to your Order entity.
  3. Select Create Manages from the shortcut menu. A line connects the session facade to your entity and the word manages displays. This indicates that the entity is a managed entity of the associated session facade.
  4. Click Save to save your changes.
  5. Click the Generate icon and review your generated code.

The following image in a graphical representation of the your service contract as displayed in the Tigerstripe Diagram Editor.


As you can see, the session facade MySessionFacade has a method named processOrder. The Order entity has an attribute named orderID. And the Order entity is managed by MySessionFacade as indicated by the arrow connecting the two items in the diagram.


Congratulations! You've completed your first Tigerstripe Service Contract using the Tigerstripe Diagram Editor! Tigerstripe Diagram Editor Additional concepts.

In addition to the basic tools available with the Tigerstripe Diagram Editor, you also have access to additional standard drawing tools. These tools allow you to add basic shapes to your diagram, such as ovals, triangles, rectangles, cylinders, and diamonds.

To access the standard shapes palette:

  1. Right-click on the Tigerstripe Diagram Editor. A shortcut menu displays.
  2. Click Add and select the shape for which you want to add to your diagram. The shape appears in the Tigerstripe Diagram Editor.
  3. Click to highlight the shape and move the shape to the desired location on your diagram.

You can move the shape any where on your diagram including on an entity or session facade.

To move the shape on an entity or session facade:

  1. Select the shape and drag it to the desired location. The area on the entity or session facade becomes darker.
  2. Release the shape.

You can place the shape behind your diagram to highlight a specific area.

To place the shape behind an entity or session facade:

  1. Select the shape from the diagram right-click menu.
  2. Resize the shape to encompass the desired area. The shape appears over your entity or facade.
  3. Right-click the shape and click Format.
  4. Click Order and select Send to Back. The shape displays behind the item as shown in the following figure.

Back to the top