the semantic of Data Type in UML

2019-06-05 12:59发布

问题:

data Type is a descriptor of a set of values that lack identity

What does mean by Lack of identity here?

回答1:

Referring to the UML DataType description on IBM's Help Center:

A data type is similar to a class; however, instances of data type are identified only by their value. If two data types have the same value, the instances are considered identical.

So this means, that you can't seperate these objects of this DataType by their identifier, because they don't have any. Only the current value is used to compare instances. Like int-instances in Java for example.

I hope I could help...



回答2:

In UML data types are model elements that define data values. A data type can be anything from value types in business domain to primitive types or structured types of a programming language. e.g- date/time, gender,integer, currency, address. As noted in another answer it is similar to a class,whose instances are identified only by their value.

Now, coming to your question, the Lack of Identity here means any data value which has not been described of its type yet. Its qualification is unknown in the problem whether its any currency or integer or date or anything.

An example of a datatype:

By default, when you create a new data type, the compartments for attributes and operations are hidden.