Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the differences between class and dataType

As i read through UML specification that:

 class has a set of attributes/operations
and data type has a set of attributes/operations

1)with regards to attributes/operations of data type what this means?

because i don't know how such a data type has attributes and operations?

2)What’s the main difference between a class and a datatype?

like image 861
Andrew Avatar asked Apr 03 '13 06:04

Andrew


1 Answers

according to UML 2.4.1 specification

A data type is a special kind of classifier, similar to a class. It differs from a class in that instances of a data type are identified only by their value. All copies of an instance of a data type and any instances of that data type with the same value are considered to be equal instances. Instances of a data type that have attributes (i.e., is a structured data type) are considered to be equal if the structure is the same and the values of the corresponding attributes are equal. If a data type has attributes, then instances of that data type will contain attribute values matching the attributes.

1)Attributes/operations of data type have the same meaning than attributes/operations of classes i.e. attributes represent the structure of your data type and operations represent the method available on your data type.

2)The main difference between a class and a datatype is that it is not possible to have two instances of a datatype with the same values (these instance would be one unique instance).

Hoping it helps,

RB

like image 65
Red Beard Avatar answered Sep 22 '22 05:09

Red Beard