Home arrow Practices arrow Page 8 - Design with ArgoUML

Adding Modeling Elements to the Class Diagram - Practices

This article provides an overview of the practical application of object-oriented analysis and design (OOAD) design concepts and the Unified Modeling Language (UML). It is taken from chapter two of the book Enterprise Java Development on a Budget, written by Brian Sam-Bodden and Christopher M. Judd (Apress, 2004; ISBN: 1590591259)

TABLE OF CONTENTS:
  1. Design with ArgoUML
  2. The Unified Modeling Language
  3. Model-Driven Architecture and the UML
  4. Design Roadmap
  5. The Editing Pane
  6. Drawing Diagrams in ArgoUML
  7. Object Modeling Using Archetypes and Color in UML
  8. Adding Modeling Elements to the Class Diagram
  9. Assigning Archetypes and Creating Associations
  10. Use Case Modeling
  11. Refining Use Cases with Sequence Diagrams
By: Apress Publishing
Rating: starstarstarstarstar / 35
August 25, 2005

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

The next step is to graphically construct the model. Renowned object technologist Martin Fowler defines a domain model as “an object model of the domain that incorporates both behavior and data.”15

A domain model creates a web of interconnected objects, where each object represents some meaningful entity, whether it’s as large as a corporation or as small as a single entry in a user’s schedule. This seemingly static model is represented with a class diagram that shows the basic relationships between the candidate elements. A class diagram models structure and contents using design elements such as classes, packages, and objects. It also displays relationships such as containment, inheritance, associations, and others.

The slight difference in this approach from the traditional static domain entity model is that you’ll be adding relationships between entity classes in the form of moment-interval classes, and you’ll be identifying any other classes as belonging to one of the four Coad archetypes.

Let’s start with a small section of the domain, focusing on the session m-i candidate as shown in Table 2-3. Your basic strategy is to identify some m-i classes and plug other archetypes around them using the DNC as guide.

To add a new class to the diagram, follow these simple steps:

  • Select the diagram on the Navigator pane (entitled “Class Diagram”).

     

  • Click the class icon in the toolbar (yellow square with three compartments).

     

  • Click anywhere on the Editor pane.

     

The new unnamed class element should appear on the Editor pane at the location of the last mouse click as well as in the Explorer. Select the Properties tab on the Details pane and in the Name field enter person. Repeat these steps for the following classes: Presenter, Attendee, Session, SessionLocation, ContentToBePresented, Room, and Presentation. The class diagram should now resemble Figure 2-9.


Figure 2-9. Newly created classes

The next step is to associate the created classes with one of the four archetypes. To date the only tool that includes built-in support for the Color in UML techniques, the four basic archetypes, and the DNC is Borland’s Together line of products, formerly TogetherSoft’s TogetherJ. ArgoUML enables the creation of custom stereotypes and also enables a class color to be selected. Although at this point it isn’t possible to associate a specific stereotype with a class color or any other attribute. Therefore, for each class you need to manually assign a color. This is a small price to pay for the extra expressiveness that color brings into the process.

Creating a Custom Stereotype

Adding a new stereotype to ArgoUML is a little trickier than it needs to be (we expect the procedure to be simplified in future versions):

  • Select any class in the class diagram.

     

  • On the Details pane choose the Property tab and select any stereotype from the stereotype drop-down list.

     

  • Click the button next to the drop-down list. The button is unlabeled with a graphic of an arrow with a 90-degree bend. This should take you to the stereotype Property tab.

     

  • Click the New Stereotype button (the one adorned with guillemets).

     

  • Enter the name of the new stereotype, in this case enter party.

     

    Repeat the last two steps shown previously for the following stereotypes: place, thing, role, moment-interval, and description.


NOTE

The ArgoUML manual cautions about a known bug. Apparently, in certain versions of ArgoUML the newly created stereotypes will not appear in the class property stereotype drop-down list until the entire model is saved and then reloaded.



 
 
>>> More Practices Articles          >>> More By Apress Publishing
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PRACTICES ARTICLES

- Calculating Development Project Costs
- More Techniques for Finding Things
- Finding Things
- Finishing the System`s Outlines
- The System in So Many Words
- Basic Data Types and Calculations
- What`s the Address? Pointers
- Design with ArgoUML
- Pragmatic Guidelines: Diagrams That Work
- Five-Step UML: OOAD for Short Attention Span...
- Five-Step UML: OOAD for Short Attention Span...
- Introducing UML: Object-Oriented Analysis an...
- Class and Object Diagrams
- Class Relationships
- Classes

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: