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 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:
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: If the model contains any configuration errors, this will be highlighted by Console in red - these errors should be corrected before you proceed: If the model contains any metamodel or types/category issues (for example, sets or layers that reference metamodel items or types/categories that are not present in the metamodels of the currently selected application), these will be highlighted by Console in orange. These warnings are ignored and the check action will proceed: Click to enlarge Note that ≥ 2.0.0-funcrel includes the ability to cancel the check action if the action takes too long to complete: after 30 seconds have elapsed, the close editor icon will be enabled, allow you to cancel the action:
| |||||
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:
This option is only available if you have already actioned a check using the following icon: | |||||
Create new items:
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:
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 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:
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:
| |||||
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.
| |||||
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 |
---|---|
1 | Search field | Use this to search for items in the panel - the search is performed on the item name. | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | A-Z sort | Use this option to sort the items in ascending/descending order. By default the list is sorted by type and then by name. | |||||||||||||
3 | Layer | This 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. | |||||||||||||
4 | Unassigned | This 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. | |||||||||||||
5 | Set | This 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. | |||||||||||||
6 / 7 |
| The Any icons are displayed when a dependency has been created to the target layer from "any" other layer - or vice-versa. 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. | |||||||||||||
8 | Hide/Unhide | These icons show whether the item is displayed in the Editor or not. Clicking the icon will toggle the display and hidden/unhidden. | |||||||||||||
9 | Contextual menu | Contextual menu providing the following options:
| |||||||||||||
10 | Scope | 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. | |||||||||||||
11 | Violations | This 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):
| |||||||||||||
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:
1 | Name 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:
|
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:
|
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 (third-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. |
7 | Removes an existing selection block entirely. |
8 | Edit the content of an existing content selection block (change matching criteria)< |
9 | Removes an existing content selection block entirely. |
10 | Multiple criteria in a single selection block, linked using an AND condition. |
11 | Multiple 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:
The new item will be shown in the editor with no selection criteria:
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:
Choose whether you want to include Sub Objects and/or External Objects - neither is ticked by default:
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. |
---|---|
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):
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 |
|
---|---|
Forbidden model type |
|
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 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 AIP Console - Architecture Studio - Model editor.
Use an item from the library
To add an item into the model or template that has been provided by default with 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 Console. Click the red trash icon to delete the item from the library: