What is the datatype for image when doing a design class diagram?

Viewed 3639

I have to make a UML Design class diagram of a sale. When creating the classes, one of the classes (Product) has an image of the item as one of its properties. I have to indicate visibility, the property and the datatype. Which datatype do I use for the image? For example I have properties like :

  • productId : int
  • productName : string
  • productPrice : decimal
  • productImage : ????
2 Answers

UML does not prescribe which PrimitiveTypes or DataTypes you need to use. It does define a set of reusable Primitive Types, but this is mainly used in the definition of meta-models.

You should define your own PrimitiveTypes and DataTypes that are to be used in your model.

In this case it seems like the best option would be to create a DataType Image.
This could look something like this, depending on your needs:

enter image description here

There is no primitive type for an image, you can create your own class Image for that.

Out of that warning the primitives types names you use are not the predefined ones, probably you want in order :

  • Integer
  • String
  • Real

(c.f. chapter 21 of formal 2017/12/05 )

Related