Main Content

Class Diagram View of Software Architectures

Use class diagrams to display a graphical representation of the structure of a software architecture model. You can also use spotlight views to analyze component dependencies and hierarchy, and you can use component hierarchy views to visualize the component hierarchy as a tree diagram. For more information, see Create Spotlight Views and Display Component Hierarchy and Architecture Hierarchy Using Views.

A class diagram is a graphical representation of a static structural model that displays unique architecture types of the software components optionally with software methods and properties.

Class diagrams capture one instance of each referenced model and show relationships between them. Any component diagram view can be optionally represented as a class diagram for a software architecture model.

Software Architecture with Class Diagram View

This example uses a software architecture model with functions, stereotypes, and properties to explore class diagrams in the Architecture Views Gallery. Open the model to follow the steps in this tutorial.

Interact with Class Diagram View

  1. Simulate the model to compile it and populate functions. On the toolstrip, click Run. Alternatively, update the model to compile it by navigating to Modeling > Update Model.

  2. To open the Architecture Views Gallery, navigate to Modeling > Architecture Views.

  3. From the View Browser, select the View 1 view.

  4. To open the class diagram view, click Diagram > Class Diagram.

    Software architecture class diagram view.

    The class diagram consists of:

    • A class box for each unique component type, including reference components.

    • A class box as the root that corresponds to the root architecture of the top model.

    • Composition connections between the types.

    If there are multiple instances of the same type of component, for example, multiple components that reference the same model across the model hierarchy, then the type of the component is still represented as one unique box. The component will also relate to its parents and children via multiple composition connections.

  5. You can select Hide methods to simplify the output by removing software functions from the diagram. Select Hide properties to hide information about stereotypes and property values applied to the components.

    Class diagram menu option.

Client-Server Interfaces in Class Diagram View

Class diagrams display service (client-server) interfaces. The diagram shows the service interface classes and available services.

In this example, a software architecture has two components that are connected with client and server ports. The Interface Editor shows the interface assigned to the client and server ports.

model = systemcomposer.openModel("SoftwareArchitectureClientServer");

2022-04-19_11-48-00.png

openViews(model)

This is the class diagram view of the software architecture.

  • The icon on the upper right of the component distinguishes the service interface class.

  • The service interface class contains function prototypes as services.

  • The diagram displays an aggregation connection for the client port.

  • The diagram displays a composition connection for the server port.

2022-02-20_8-50-37.png

Related Topics