UML Tutorial --Class Diagrams

 

      Class diagrams describe the static structure to a part of a system.
Classes      
A class describe a set of objects with similar structure,behavior and relationships.The class is shown as a rectange with tree compartments.Both the attribute and operation compartments can be suppressed.
Attribute
An attribute describes a range of values that instances of the class may hold.It's defined by a name and a type.Additionally,an attribute can have properties like visibility(to other classes),multiplicity,and initial value and a property-string that indicates property values.
      visibility name[multiplicity]:type-expression = initial-value{property-string}
Operation
Operations are specified by a name and a optional list of arguments.
      visibility name(parameterlist):return-type-expression{property-string}.
Stereotype
A stereotype is a classfication element and is used to indicate a difference in meaning or use between two elements with the same structure.
Object
An object is an instance of a class.In UML an object is represented by a rectangle with one or more compartments(up to four compartments).The top compartment shows the name of the object and the name of the class.
Object sets
Sets of objects can only be displayed through cardinalities of associations.Cardinality an association ends only tells how many instances that may be associated with a given number of source intances across the given association.
Relationship types:
In UML many kinds of relationships can be modeled .The main types are shown below:
Association:
An association defines a relationship between two or more classes.The association may indicate that the classes communicate ,but this is not necessarily true.
Aggregation:
In UML there are two kinds of aggregations:aggregation and composition.An aggregation ,also called relation aggregation is a specialised association.It is specified by an aggregation association with a hollow diamond.A part in thie type of aggregation can participate in several aggregates.
Composition,or "real aggregation",is a stronger form of aggregation where the parts can not exist without the whole.The parts can only participate in one composite.Composition is shown as an association with a filled solid diamond nearest the class constituting the whole,or alternatively using the graphically nested form.
Dependency:
A dependency is a relationship that indicates that a model element is in some way dependent of another model element.All model elements must exist on the same level of abstraction or realisation.
Generalisation:
A generalisation is a relationship between a more general element and a more specific element.Generalisation is a mechanism for structuring sets of classes with similar properties into general and specialised classes.





转载于:https://www.cnblogs.com/cmleung/archive/2009/09/14/1566591.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值