Content by Category
.NET 1.x
.NET 2.0
.NET 3.0
.NET 3.5
.NET 4.0
.NET 4.5
.NET Assemblies
.NET Framework
.NET Getting Started
Accessibility
ADO.NET
Advertorials
Agile Development
AJAX
Amazon Web Services
Analysis Services
Android
Architecture
Arduino
ASP .NET Web API
ASP.NET
ASP.NET MVC
ASP.NET WebForms
Azure
B2B (Business Integration)
BDD
Big Data
Bing
BizTalk
Book Excerpts
Build and Deploy
Business Intelligence
C#
C++
ClickOnce
Cloud Computing
Code Contracts
CODE Framework Info - non Technical
CODE on the Road!
COM+
Community
Conferences
Continuous Integration
Crystal Reports
CSLA.NET
CSS
Data
Debugger
Design Patterns
Development Process
Display Technologies
Distributed Computing
Document Database
DotNetNuke
DSL
Dynamic Languages
Dynamic Programming
Editorials
Enterprise Services ("COM+")
Entity Framework
Events
Expression Blend
F#
Fox to Fox
Frameworks
Functional Programming
Git
Graphics
HTML 5
Internet Explorer 8.0
Interviews
IOS
iPhone
Iron Ruby
Java
Java Script
JavaScript
jQuery
JSON
Lightswitch
LINQ
Linux
LUA
Mac OS X
MDX
Messaging
Metro
Microsoft Application Blocks
Microsoft Business Rules Framework
Microsoft Dynamics
Microsoft Expression
Microsoft Office
Mobile Development
Mobile PC
Mono
MsBuild
MVVM
MySQL
Network
NHibernate
node.js
NOSQL
Nuget
Object Oriented Development
Objective C
Odata
OLAP
Open Source
Opinion
Opinions
Oracle
ORM
Other Languages
Parallel Programming
Patterns
PHP
Podcasts
Post Mortem
PowerPoint
Print/Output
Prism
Product News
Product Reviews
Project Management
Prolog
Python
Q&A
Rails
Rake
Razor
Reporting Services
REST
RIA Services
Ruby
Ruby on Rails
Scheme
Search
Security
Services
SharePoint
SignalR
Silverlight
SOA
Social Networks
Software & Law
Software Business
Source Control
Speech-Enabled Applications
SQL Server
SQL Server 2000
SQL Server 2005
SQL Server 2008
SQL Server 2012
SQL Server CE/AnyWhere/Mobile/Compact
SSIS
Subversion
Sync Framework
Tablet PC
TDD
Team System
Techniques
Testing and Quality Control
TFS
Tips
TypeScript
UI Design
UML
User Groups
VB Script
VB.NET
Version Control
VFP and .NET
VFP and SQL Server
Virtual Earth
Vista
Visual Basic
Visual Basic 6 (and older)
Visual FoxPro
Visual Studio .NET
Visual Studio 11
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Visual Studio 2011
Visual Studio 2012
Visual Studio Tools for Office
VSX
WCF
Web Development (general)
Web Services
WebMatrix
WF
Whitepapers
Windows 7
Windows 8
Windows Azure
Windows Live
Windows Phone 7
Windows Phone SDK
Windows Server
Windows Vista
WinForms
WinRT
Workflow
WPF
XAML
Xiine Documentation
XML
XNA
XSLT



Learn Now


rssbus
 


Component One

Reader rating:
Click here to read 5 comments about this article.
Article source: CoDe (2002 - Jan/Feb)


Article Pages:  1  2 3 4 - Next >


UML Class Diagrams

Class diagrams are among the centerpieces of the Unified Modeling Language. They are critical for helping you design classes that will serve as building blocks for your application. This article will cover the basics of class diagrams and help you see how you can use them in your software development?especially in building your business object classes.

In this second article in the series, we take a close look at UML class diagrams. Class diagrams are most often used in the elaboration and construction phase of software projects. When used in conjunction with UML sequence diagrams (covered in the next article in this series), they can help you produce well-designed families of classes that form the foundation of flexible and extensible software applications.

This article provides a practical overview of the most commonly used features of class diagrams. It is not intended to be a completely comprehensive guide to class diagrams?that would require a book; and, in fact, it's highly recommended that you refer to The Unified Modeling Language User Guide by Booch, Rumbaugh and Jacobson (Addison-Wesley) for the complete details on class diagrams. For the most up-to-date information, check out the latest official version of the UML specification at www.omg.org/technology/uml/index.htm.

Why Use Class Diagrams?

If you're creating monolithic applications where the application and data access logic is melded together inside the user interface, you will find little use for class diagrams?or the entire UML for that matter! Fortunately, many software developers are beginning to understand the importance of creating component-based applications that can be easily maintained, extended and scaled from the desktop to the Internet. This requires that you create families of classes (most importantly business object classes) that have crisp boundaries and a balanced distribution of responsibilities. Class diagrams can help immensely in this regard. They enable you to design your classes, which become the building blocks of your application.

Class diagrams allow you to document the structure (attributes and operations) of classes. They are also extremely useful for understanding relationships between classes, inheritance hierarchies, and responsibilities of the entities that provide the system behavior.

Modeling Class Structures

As shown in Figure 1, classes are graphically represented as a rectangle containing three compartments. The upper compartment contains the name of the class, the middle compartment contains a list of attributes and the bottom compartment contains a list of operations.

Click for a larger version of this image.

Figure 1: You can choose to show or hide as much detail as you like in a class diagram, as shown in these two representations of the VSSItem class found in Microsoft's Visual Source Safe.

You can display classes with as little or as much detail as desired. Figure 1 shows two different representations of Microsoft Visual SourceSafe's VSSItem class. The class on the left side shows a simpler representation of the class with just the attribute and operation names displayed. The class on the right side shows additional detail?the type and value of properties and the parameters (their types) and return values of operations.

To the left of each attribute and operation is a symbol that indicates the item's visibility?public, protected, private or implementation (see the Visibility sidebar for details). When showing full detail, attribute names are followed by a colon and the type and default value of the attribute.

Operation names are followed by parentheses. When showing full detail, the parentheses hold the argument name followed by a colon and the type and default value of the argument. A colon and the type of the operation's return value follow the parentheses.

Modeling Class Relationships

There are four different relationships that can be modeled in class diagrams?generalization, dependency, association and realization.

Click for a larger version of this image.

Figure 2: You can design a family of classes that inherit their interface from an abstract parent class. This model provides your applications with a great deal of flexibility and extensibility.

&

By: Kevin McNeish

Kevin McNeish is President of Oak Leaf Enterprises, Inc, and chief architect of the MM .NET Application Framework. He is a Microsoft .NET MVP and a well-know INETA speaker and trainer throughout North America and Europe including VSLive!, DevTeach (where he serves as one of the .NET chairs), SDC Netherlands, and Advisor DevCon. He is co-author of the book Professional UML with Visual Studio .NET, author of the book .NET for Visual FoxPro Developers, writes articles and has been interviewed for .NET Rocks! He spends about half his time on the road training and mentoring companies to build well-designed, high-performance .NET applications.

kevinm@oakleafsd.com

Fast Facts

Class diagrams are the most commonly used diagrams in the UML. They can make complex systems far easier to comprehend, analyze and design.



Article Pages:  1  2 3 4 - Next Page: 'Generalization' >>

Page 1: UML Class Diagrams
Page 2: Generalization
Page 3: Association
Page 4: Aggregation

How would you rate the quality of this article?
1 2 3 4 5
Poor      Outstanding

Tell us why you rated the content this way. (optional)

Average rating:
4 out of 5

9 people have rated this article.

Xojo

      Xojo

 

Learn Now