EA - IT Architecture V2 > UML modeling > Attribute type > Packages and Primitive Types
Packages and Primitive Types
Packages
The assignment of classes to packages imposes a rigid structure. As a class can belong to only one package, it is necessary to define client/supplier relationships so packages can use classes they do not own when they need to.
This is especially important for primitive type classes, because they will be used to define the attributes of other classes.
*Rule: a class can belong to only one package.
What primitive types are available for typing the class attributes depends on which package the class is in.
The type you can give to class attributes can only be primitive types defined for the package containing the class.
The accessible primitive types are public classes with the “Primitive Type” stereotype, that are contained in or are used by the package or the packages of which it is the client.
You can define a reference package (or several reference packages) containing the primitive types used by the enterprise. All the other packages are declared as clients of the reference package of primitive types.
In the example below, the “Data types reference” package contains the classes “Address”, “Code”, “Date”, etc.
It is referenced by the packages "Library", "Order management", etc.
The class attributes for these packages can be typed using the types “Address”, “Code”, “Date”, etc.
It is also possible to specify directly that a package uses a class contained in another package.
In the example below, the classes “P-Datetime”, “P-Multimedia”, "P-Numeric", etc. are used by the “Data Type Reference” package without being owned by that package.
Of these classes, only “M-Multimedia” is exported by the package for public use.