advertisement

Search Tips
Articles  |   Tutorials  |   Reviews  |   Dev Tools  |   by Category  |   by Date  |   by Name  |   Submit  |   Source Code  |  

Browse DevX
DevX Updates - Sign Up Here


Partners & Affiliates












advertisement

Articles : Advanced Topics in Java :
Unified Modeling Language :

Contents
Classes and Inheritance
Associations
Roles
Attributes and Behaviors
Abstract Classes, Interfaces, and Relationships
Conclusion

Attributes and Behaviors

Once you have defined the classes and the associations in between them, you should specify their behaviors and attributes. A class in a UML class diagram can contain two "compartments", one for the attributes and one for the behaviors. You can specify the name, the type and the initial value of each attribute. You can also enter the name, the arguments (incl. their names and types) and the return type of a behavior:


Rational Rose allows the user to hide individual attributes and behaviors from the compartments and hide the behaviors' signatures (i.e. their arguments and return type). Unfortunately, it cannot hide attributes' types and initial values, which usually enlarges the class box so that it doesn't fit within the diagram. On the other hand, attributes are not important in the initial analysis stages of the development and you can always supply a separate diagram for each class that depicts all the attributes and operations in the design stage.

An obvious conclusion is that attributes are represented as instance variables and behaviors as methods in Java.

Notice that attributes and roles are represented the same way, as instance variables. When should an association role and attribute be used? An attribute is used for a simple type (this is a constraint of the Rose, not of UML). Beyond that, attributes are atomic for the purpose of a diagram and should not be used for important relations in between classes.

NEXT


The author has over three and a half years of experience on developing web and object oriented application with a development focus on server side and enterprise Java .He is a regular writer for the European publication "Programmez!" and writes on and of for some online publications. He can be reached at sameertyagi@usa.net

How to Add Java Applets to Your Site

New on the Java Boutique:

New Review:

Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling API boasts simplicity, ease-of-integration, a well-rounded feature set, and it's free!

New Applet:

Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA sequences into three useful formats.

Elsewhere on internet.com:

WebDeveloper Java
Lots of Java information on webdeveloper.com

WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.

ScriptSearch Java
Hundreds of free Java code files to download.

jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.

internet.com logo


JavaBytes
Internet Cyclone
This powerful, easy-to-use, internet optimizer is for Windows 95, 98, ME, NT, 2000 and XP. It's designed to automatically optimize your Windows settings, boosting your Internet connection up to 200%.
Blackmail Applet
This applet prints out text that looks like letters cut out of a newspaper. You can specify the text, the width and height of the applet and the delay after each letter. Future versions will have more parameters.
JB User Poll
What is your primary tool for learning Java?
The JavaBoutique Top 15:
1. Little_Wizard
2. Castles
3. longball
4. articles.rdf
5. applets.rdf
6. MoonStar
7. Stardust
8. Cliffie
9. Viewer
10. linx
11. BMTron
12. RushHour
13. quickserv
14. BlackViper
15. KaaBlitz
Want more? Check out our Top 100!

Refer-It
Affiliate Program and Referral Directory.
New on internet.com
Google IM Not Talking to Other Jabbers
Newly-launched Google Talk IM service doesn't connect to other open source Jabber servers and users -- at least not yet.

Printer Sets Good Example for Small Business Security
While surveys suggest that small businesses aren't prepared for ever-present security dangers, this Boston-area printer has maintained a pristine operation since a scare six years ago.

VoIP Gizmo Comes to Universities
As student gear up for back to school, a SIP-based initiative aims to VoIP-enable universities around the world for free calling.



Copyright 2002 INT Media Group, Incorporated. All Rights Reserved.
Legal Notices,  Licensing, Reprints, & Permissions,  Privacy Policy.
http://www.internet.com/