Here are some useful links for UML class diagrams
http://www.objectmentor.com/resources/articles/umlClassDiagrams.pdf
http://www.ibm.com/developerworks/rational/library/content/RationalEdge/sep04/bell/
And a book, thanks to Asmaa Magdi ACMaa
http://portal.aauj.edu/portal_resources/downloads/uml/sybex_mastering_uml_with_rational_rose2002.pdf
The difference between Aggregation and Association
Aggregation is when an object contains a collection of other object. This is done mainly via data structures. Like a class that contains an Array, a List, a Dictionary, a HashTable, ...
Association is when objects/classes (sub-systems) interact together in a larger system. This can be achieved either by letting the objects have references to other objects in the system (this involves aggregation), by using static classes, ...
Examples,
- In Asp.Net, the use of static classes is obvious. You have the MembershipProvider, the RuleProvider, the ConfigurationManager, ... which provide services (functionality) to other objects/classes.
- Suppose you're designing a strategy game where soldier must know the location of other soldiers. So you will make a list of references to other soldiers in the soldier class.
Object Composition at wikipedia
This file contains a sample C# code and it's simple UML class diagram (in both Word 97-2003 and Word 2007 formats)

3 comments:
جزاك الله كل خير
Thanks alot.
Sorry, i made a mistake in the UML in the Rectangle but i re-uploaded the file.
Post a Comment