How to communicate Architecture – TAM Class Diagrams
This blog post continues the previous posts from Bernhard Groene in part1 and part2, and my previous post from part3. The intent of this article is to present details about Entity/Relationship diagrams using TAM.
TAM Class Diagrams are used to describe the static structure of the system entities and their relationships.
On conceptual level it is possible to describe the structure of data which is found in storages or which is transferred via channels. It is also possible to use in order to create topic maps or to use as glossary.
On design level, this type of diagram is useful to describe the relationship of programming elements such as classes, database tables, etc.
Elements of a TAM Class diagram
Entity/Class: represent the main objects on a system (conceptual level) or the classes or tables (design level).
Associations: used to represent a family of links between entities. Binary associations (between two entities or classes) are normally represented as a line. Associations can be adorned with text which describes the type of the association.
Composition and Aggregation: both represent a “has a” relationship. The difference between these two is that a composition indicates a “strong life cycle dependency” between the container and the contained. This means that if a container is destroyed, it is expected that the entire contained collection items are destroyed as well.
In the case of an aggregation, it represents a part-whole or a part-of relationship. It can be used to describe collections of Entities/Classes but in which the “contained” can exist isolated of the “container”.
Cardinality: indicates the relation between entities. Types of relations can be 1-1 (one to one), 1-m (one to many) or n-m (many to many).
An example: The Online shop
The diagram below contains the description of an example online shop using TAM class diagram on conceptual level.
Some ideas regarding the “Online shop” can be derived form the diagram above, such as:
- A customer can browse through catalogs.
- Some products appear on Catalogs.
- A customer can place orders which consist of order items. Each order item refers to a Product.
- Products are supplied by Suppliers.
- Orders contain not only the order items but shipping information and payment information, referring to the logistics company or payment service provider involved.
An Entity Relationship diagram (E/R diagram) represents entity sets and the types of relations, the relationships, which relate an entity to the others.
In the diagram above “Product” represents a type of entity, and not a particular instance.
Instances of the same type of Entity share the same attributes and may participate in the same type of relations.
It is possible to partition a set of instances into subsets by using specialization. Specialization can be represented by using the “generalization” (represented by an arrow or triangle pointing to the more generalized Entity) symbol from UML and the association with the specialized entities.
Examples on specialization can be seen in the image below. Employees can be males or females.
The second example: there are three rooms types: A, B and C.
TAM Class diagrams are used to describe static structure of a system on conceptual level, for example to describe the terminology of a domain. On design level it can be used to represent programming entities such as classes, or to be a reference to the database tables used by an application.