Page tree
Skip to end of metadata
Go to start of metadata

Summary: this section provides instructions for using the Architecture/Quality Rule Model editor to edit and create models and templates.

Introduction

The Architecture Model editor is a graphical interface that allows you to create new and edit existing models and templates.

Click to enlarge

Sections

  • Header
  • Layers/Sets
  • Editor
  • Item editor

Header


This option is used to select an Application context when running a check on a specific model using the check icon:

The drop down list will display a Global context option by default (when set to Global, the check icon will not be available) and then a list of all Applications that are being managed in AIP Console. Selecting a specific Application will enable the check icon and allow you to perform a check against the selected Application / most recent snapshot using the selected model. Note that the Application context selected in the Model editor will be replicated in the editor.

Technically, selecting an application will load the appropriate metamodel and use this in the check, read and save processes. The Global context is therefore simply to allow the creation of a model for no particular application.

The check will compare the model/template against the results of the most recent snapshot for the selected Application and will display:

  • The number of objects matched by the layer or set in the upper right corner:

  • Any links between layers and any violations of the Architecture Model. In the example below showing violations, the model is a "Forbidden dependency" type, and 7 links have been identified that contravene this "forbidden" architecture:

Clicking the highlighted links will display all links in a table complete with source code for the violation. You can also download the list of links using the button highlighted below:

Click to enlarge

If no violations of the model are found, a message is displayed in the bottom left corner:

Allows you to check whether any objects you are capturing in your model are present in more than one layer - in other words you may have multiple layers that target the same object types. This is considered poor design and you should instead try to build sets and then re-use those sets in your layers.

When you click the button a new window will open listing all objects that belong to more than one layer and the layers they belong to:

This option will only appear when the context is set to a specific Application (if Global is set, then the option is not available):

Download a report in Microsoft Excel format about the results of the model check, containing:

  • Application name
  • Model name and description
  • Report date and time 
  • number of violations
  • List of violations

This option is only available if you have already actioned a check using the following icon:

Create new items:

Architecture ModelQuality Rule model

Layer

A Layer represents a layer in your application's architecture. You can assign specific objects to the layer through the use of specific selection criteria or via the inclusion of a Set. Layers are not applicable when working with Quality Rule models.

Set 

A Set is an element that contains specific selection criteria for assigning objects. These Sets can be re-used in multiple Layers whenever required through the use of the Member of block or the Excluded from block. When a Quality Rule Model is created, two default Sets called Scope and Violations are automatically initialized:

Unassigned Layer

The Unassigned Layer acts (Architecture Models only) like a garbage collector that retrieves all unassigned objects (i.e not assigned to any other Layer in the Architecture Model). Its purpose is to help define the behavior of the Architecture Checker with regard to unassigned objects, authorize dependencies to these objects or keep the default behavior: i.e.  dependencies to unassigned objects are forbidden.

When you define an Authorized type model, if there are "real life" links to objects that are not part of any layer in your model and you do not assign them to this Unassigned layer, the CAST Architecture Checker will report violations.

Create Module Layers and Create Analysis Unit Layers

The options Create Module Layers and Create Analysis Unit Layers (Architecture Models only) allow you to quickly create a layer based on the content of a Module or an Analysis Unit. For this to function, an analysis/snapshot is required. When selected, you will be offered the chance to choose the Modules/Analysis Units you want to create a layer from. Use the Search field to find an item you require - when an item is ticked, it will appear in the search results regardless of whether it matches the search string

 

These two options will only appear when the context is set to a specific Application (if Global is set, then the options are not available):

Manage library components using this option. See Managing library items below.

Undo and redo - use these buttons to undo or redo changes you have made in the Model. Actions excluded from the Undo/Redo options:

  • Model Properties changes
  • Changes to item positions in the editor
  • Model settings
Where an action resulted in an error (for example adding configuration to a Layer but not completing it), using the Undo action will remove the added action. When then using Redo, the action will be re-added together with the error - this is expected.

This option is used to select an Application context when running a check on a specific model using the check icon:

The drop down list will display a Global context option by default (when set to Global, the check icon will not be available) and then a list of all Applications that are being managed in AIP Console. Selecting a specific Application will enable the check icon and allow you to perform a check against the selected Application / most recent snapshot using the selected model. Note that the Application context selected in the Model editor will be replicated in the editor.

Technically, selecting an application will load the appropriate metamodel and use this in the check, read and save processes. The Global context is therefore simply to allow the creation of a model for no particular application.

The check will compare the model/template against the results of the most recent snapshot for the selected Application and will display:

  • The number of objects matched by the layer or set in the upper right corner:

  • Any links between layers and any violations of the Architecture Model. In the example below showing violations, the model is a "Forbidden dependency" type, and 7 links have been identified that contravene this "forbidden" architecture:

Clicking the highlighted links will display all links in a table complete with source code for the violation. You can find out more about this in AIP Console - Architecture Studio - Existing Models:

Click to enlarge

If no violations of the model are found, a message is displayed in the bottom left corner:

Each model that is used during a snapshot will be visible in the results as a distinct Quality Rule. A Quality Rule has various accompanying values that determine how its results are viewed in the CAST dashboards. These values must be configured for the rules that result from your models as described in AIP Console - Architecture Studio - Model properties.





Provides various editor display options:

Show only application types

When ON, all possible items that can be present in the Analysis Service are available for selection when creating a Layer or Set.

Note that this option is not available if the context is set to Global (see above) since no Application has been chosen.

Show dependencies

Toggle (on or off) the display of dependencies between Layers. By default this option is set to ON.

Show compositions

Toggle (on or off) the display of links between Layers and Sets via the configuration blocks member-of and excluded-from. By default this option is set to ON.

Show violations

Toggle (on or off) the display of violations in the editor. By default this option is set to ON. These violations are displayed only after using the  option, for example:

Show results with External Objects 

Activating this option (default position is OFF) will show all links based on the scope of the caller Layer, even those starting from external objects if the Layer is configured to include such objects:

This option applies in Architecture Studio, when you check: 

  • an Architecture Model, whether inside or outside of the Model editor. If at least one of the originating objects of a violation link is external, a warning will appear in the top-left corner of the violation links window (1), in addition to the information in a column called Internal (2) which displays, for each violation link, whether its originator object is internal or external to the application:

  • a user-defined Architecture Template in the Template editor.

Shows sets - toggle (on or off) the display of sets in the editor. By default this option is set to OFF. This global setting can be overridden for each set, individually:

Saves any changes you have made to the model/template. The chosen Application context will be used to validate the model during the save process.

  • Standard templates delivered with AIP Console cannot be saved, therefore the following will be displayed:

  • The Save button is not enabled unless changes have been made to the model.

This option is only available for Models. It allows you to save the current model either as a template (so that it can be re-used as a basis for other models) or as a new model (a clone of the current model):

You will be prompted to name the new clone Model or new Template:

Once saved, the new clone model or new templates will be displayed in the Architecture Studio main page.

Closes the Architecture Model. If you have made changes to the model and not saved them, the following prompt will appear:

Layers/Sets

The Layers/Sets panel enables you to manage your items. All items listed in the panel are automatically displayed in the Editor, except for Sets which can be manually hidden/unhidden:

Architecture Model

Quality Rule Model


1Search fieldUse this to search for items in the panel - the search is performed on the item name.
2A-Z sortUse this option to sort the items in ascending/descending order. By default the list is sorted by type and then by name.
3LayerThis icon indicates a Layer item - representing a layer in your application's architecture. You can assign specific objects to the layer through the use of specific selection criteria or via the inclusion of a Set. Layers are not applicable when working with Quality Rule models.
4UnassignedThis icons indicates the Unassigned layer and acts like a garbage collector that retrieves all unassigned objects (i.e not assigned to any other Layer in the Architecture Model). Its purpose is to help define the behavior of the Architecture Checker with regard to unassigned objects, authorize dependencies to these objects or keep the default behavior: i.e.  dependencies to unassigned objects are forbidden. Not applicable when working with Quality Rule models.
5SetThis icon indicates Set item - representing an item that contains specific selection criteria for assigning objects. These Sets can be re-used in multiple Layers whenever required through the use of the Member of block or the Excluded from block.
6Hide/UnhideThese icons show whether the item is displayed in the Editor or not. Clicking the icon will toggle the display and hidden/unhidden.
7Contextual menu

Contextual menu providing the following options:

Check content

This option will compare the item against the results of the most recent snapshot and will display a list of the objects that are matched:

Clone

Enables you to clone the existing item (only available for Layers and Sets). The cloned item will use the same name as the existing item with the addition of "- Copy":

Make a componentSave the selected item as a component in a "library" for re-use in other models/templates. See the explanation below under Save.
RemoveThis option removes the item entirely. This can be reversed using the Undo action.
8

The Any icon is displayed when a dependency has been created to the target layer from "any" other layer. No "link" will be displayed in the Model editor to depict this dependency. See Creating a dependency between Layers for more information. Not applicable when working with Quality Rule models.
9Scope

This item is only applicable when working with Quality Rule Models. It indicates the default Scope set which defines the "scope" of objects that will be tested by this Quality Rule Model. See AIP Console - Architecture Studio - Quality Rule models - define a new model.

10ViolationsThis item is only applicable when working with Quality Rule Models. It indicates the default Violations set which defines the the objects that will appear as Violations. By default, the objects defined by the default Scope set will always be included, however, you can then define additional "blocks" to create "conditions. See AIP Console - Architecture Studio - Quality Rule models - define a new model.


The number of objects associated with each item is displayed underneath the item:

This number will only be displayed:

  • when the check action has been performed using the icon in the header: 
  • if the item "captures" any objects

Editor

The editor is where you can edit your Architecture Model:

  • Items (layers and sets) can be moved by dragging and dropping
  • Selecting an item will display the item's configuration in the right hand "Item editor" section.

Alter the zoom levels.

Item (layer/set/unassigned item):

1Name of the item.
2

Number of objects captured by the item. Will display as 0 until the check action has been performed using the icon in the header  or the check action for the item itself (see icon 3 below).

3

This option will compare the item against the results of the most recent snapshot and will display the number of objects matched by the item in the upper right corner:

In addition the list of objects matched by the layer/set will also be displayed (you can find out more about this table in Check a model:

Click to enlarge

If an error or inconsistency exists in the item, this will be highlighted in the editor:

Click to enlarge

If the item is configured to include sub-objects or external objects:

The results window will indicate that the list of objects may contain these type of objects:

This option is not available if the Application context is set to Global:

4

Add dependency

This option is only available for Layers and only when there is more than one Layer in the model. It allows you to add a dependency to another Layer:

See Creating a dependency between Layers for more information about this.

Not applicable when working with a Quality Rule model.
5

Save the layer or set as an item in a "library" for re-use in other models/templates. Enter a name and an optional description for the item:

If the item already exists in the library, a message is displayed:

  • You cannot save an Unassigned item to the library, nor can you use the name Unassigned for an item you want to save to the library.
  • The item can be saved irrespective of whether the Application context is set to Global or a specific Application.
  • An item will only be prevented from being saved as a component if the Layer or Set contains a missing or incomplete configuration. See AIP Console - Architecture Studio - Model editor:

  • Metamodel errors do not prevent the item from being saved as a component.
6Removes the Layer or Set entirely. Cannot be undone.

Shows a dependency between two Layers when the Model is of type "authorized". The arrow shows the direction of the dependency - i.e. the dependency is allowed from Layer A to Layer B. Note that a dependency between two layers can be configured in both directions.

Shows a dependency between two Layers when the Model is of type "forbidden". The arrow shows the direction of the dependency - i.e. the dependency is forbidden from Layer A to Layer B. Note that a dependency between two layers can be configured in both directions.

Shows a link between a Layer and a Set, i.e. where a Set is being used in a Layer via a member-of block.

Shows a link between a Layer and a Set, i.e. where a Set is being used in a Layer via a excluded-from block.

Moving items in the editor

You can:

  • move individual items (i.e. sets/layers) in the editor by left clicking the item, dragging it to the new position and then releasing the mouse.
  • move multiple items in the editor by selecting the items you want to move (hold the CTRL key down and left click the required items), then dragging any of the selected items to the new position - all items will move to the new position:

Item editor

This section is located to the right of the screen and is displayed when an item is selected either in the Editor or in the Layers/Sets section:

1Name of the Layer or Set. Use the edit icon to update the name of the layer/set.
2

Add New Selection Criteria button - used to add a new selection block. A Layer or Set can contain multiple selection criteria blocks, these will be added using an OR condition:

3

Type/description of the selection criteria block:

  • All Objects Matching the criteria in the block
  • All Objects Matching the criteria in the block AND Sub Objects
  • All Objects Matching the criteria in the block AND External Objects
  • All Objects Matching the criteria in the block AND Sub Objects AND External Objects
4

This option will compare the block content against the results of the most recent snapshot and will display the number of objects matched by the block in the upper right corner of the item:

In addition the list of objects matched by the layer/set will also be displayed:

Click to enlarge

If the item is configured to include sub-objects or external objects:

The results window will indicate that the list of objects may contain these type of objects:

This option is not available if the Application context is set to Global:

5

Defines the criteria for the selection block:

  • The Count of option is only available for Quality Rule modelsThis criterion is based on the count of objects retrieved in another set.
  • For the Property - Identification option, various types can be selected. Assessment Model Scope refers to specific groupings of objects (scopes) used by Quality Rules. These are only available when working with a Quality Rule model. If you use one, you must ensure that this scope exists in the chosen context for your model otherwise publish will fail.

6

Edit an existing selection block (change the selection criteria). By default, the block will be added without either option selected, i.e. "All Objects Matching". If you need to match on sub-objects (children of matched objects) or objects that are considered external to analysis scope (thid-party libraries etc.), select the appropriate option:

Including external objects is useful for example if, when a selection criterion matches a Spring bean class for example, this class will be included in the Layer/Set regardless of whether it belongs to the Application or comes from an external JAR.

7Removes an existing selection block entirely.
8Edit the content of an existing content selection block (change matching criteria)<
9Removes an existing content selection block entirely.
10Multiple criteria in a single selection block, linked using an AND condition.
11Multiple selection blocks in a single Layer or Set, linked using an OR condition.

Creating a new Layer/Set/Unassigned

Click and choose the item you want to create:

Note that you can also add a Layer or Set that you have saved to the library by clicking .

The new item will be shown in the editor with no selection criteria:

You can edit the name of the item in the right hand Item editor:

Or in the item itself:

In basic terms, a Layer or Set is composed of a list of selection criteria. A selection criterion is a list of conditions that assign specific objects from a CAST analysis - objects that match these conditions are then "assigned" to the specific Layer/Set. The easiest way to select objects to fill a Layer or Set is to identify the objects by name or by type, but you can also use more complex methods. 

The Add New Selection Criteria button, located in the right hand Item editor, allows you to define the objects that will be assigned to the Layer or Set. These criteria are defined in selection block and you can define multiple selection blocks in one Layer or Set:

Now edit the selection block and choose whether you want to include Sub Objects and/or External Objects - neither is ticked by default:

Include sub-objects

This will match all objects with any of the criteria you add in AND any sub-objects of the matched object(s) will also be assigned to the Layer or Set. Sub objects are for example packages, classes and interfaces contained in a parent Java Package object.

Include external objects

This will match all objects with any of the criteria you add in AND any external objects (i.e. external to the Application) of the matched object(s) will also be assigned to the Layer or Set. Including external objects is useful for example if, when a selection criterion matches a Spring bean class, this class will be included in the Layer regardless of whether it belongs to the Application or comes from an external JAR.

The selection block will then be displayed within the Layer or Set, and a text legend will show whether sub or external objects are included:

Now define the criteria for the selection box:

For example, we have added a selection criteria based on Property - Identification - Type (i.e. object type):

Note that the process is identical for a Set - screenshots above show only Layers.

Creating a dependency between Layers

Not applicable when working with Quality Rule models.

When you have defined the Layers for your model, you can then create dependencies between Layers. These dependencies are checked during the analysis and any violations of the dependencies will result in a violation being recorded. When a Model is created in CAST Architecture Checker, it will either be created as an authorized dependency Model or a forbidden dependency Model. In other words one single Model can only define one type of dependency - either forbidden or authorized:

Authorized model type

  • When two layers have no links between them in the model and in reality there are links, then a violation will be reported.
  • If a link between two layers is created in the model, then no violations will ever be raised regardless of whether in reality links exist or not.
Forbidden model type
  • When two layers have no link between them in the model, whatever the reality is, no violations will be reported.
  • Violations will be reported only when a link between two layers is created in the model and in reality the link exists.


At the current time, it is not possible to change a Model's dependency type, therefore the dependencies you create between Layers will either be forbidden or authorized.

To create a dependency, click the dependency icon available when hovering over a layer and choose the relevant option:

Existing Layers in the Model will be available for selection. You can also choose:

From Any / To Any

The From Any / To Any option enables you to create a dependency From or To Any layer (as oppose to from or to one specific layer) to any other specific layer, or vice-versa. This option means you can avoid creating multiple dependencies. When an "Any" dependency is created, a link will not be displayed in the Model editor, instead, an icon will be displayed along side the target layer in the left hand panel:

Unassigned

Creates a dependency with the Unassigned layer:

You can now choose, if required, the type of links that will be checked. To do so, click the newly created dependency between the two layers and then choose the link type you want to focus on. If you do not choose specific link types (this is the default behaviour), then all links between the two layers will be considered as a match. If you select only Call type links (for example), then any other link type between the layers will be ignored:

In this example an authorized dependency exists between the CLIENT layer and the SERVER layer for "Use" links - in other words, objects in CLIENT are authorized to access objects in SERVER via a Use link. The direction of the arrow shows the direction of the dependency. In the example below no violations will be raised for objects in CLIENT accessing objects in SERVER:

Removing a dependency between Layers

Not applicable when working with Quality Rule models.

Managing library items

Software architecture is becoming more and more complex and can involve various components and patterns. The library provides a means to store frequently used Layers and Sets than can be inserted (with their definition) into Architecture Models or Templates, so that you do not need to define the same Sets and Layers again and again. Take the following example:

  • Any Layer or Set that exists in an Architecture Model or in a Template can be saved and stored in the Library.
  • When subsequently building a new Architecture Model (either to use in an analysis/snapshot or as a basis for a template), Layers and Sets stored in the Library can be re-used therefore reducing the time needed to build the Model.

Thus, like Architecture Templates, they can facilitate the creation of Architecture Models.

  • Some elements are supplied with AIP Console (standard library elements)
  • Elements can be created manually from existing Architecture Models (custom library elements)

Save an item in the library

To save an item in the library, in the Editor find/create the item (set/layer) you wish to save and click the save button:

Enter a name and an optional description for the item:

If the item already exists in the library, a message is displayed:

The item will then become available in both the AIP Console - Architecture Studio - Library Components list and in the library dropdown in the 382609440.

Note that you cannot save an Unassigned item to the library, nor can you use the name Unassigned for an item you want to save to the library.

Use an item from the library

To add an item into the model or template that has been provided by default with AIP Console (standard library item) or that you have previously saved (custom item) in the "library", click the  icon. A list of available items will be shown in a drop down list - choose the one you require to add it to the editor:

Layer

Set

You can also search for a specific library item by name:

Delete an item from the library

You can remove any custom item (i.e. an item you have previously saved) from the library: click the  icon - a list of available items will be shown in a drop down list. Those that you can delete will have a red trash icon next to them. All other items are standard items delivered with AIP Console. Click the red trash icon to delete the item from the library:

Note that deleting the item from the library will not delete the item from any Models or Templates in which it has been used.
  • No labels