Dependencies - Rules tab
This tab enables you to manage all the dependency rules for the Technologies in the Application.
When a dependency exists and during the analysis process, source code corresponding to the Technologies/Analysis Units in the Source column is scanned for references to objects in source code corresponding to the Technologies/Analysis Units in the Target column. If any matches are found, then a link between the two objects will be created (this will be visible in CAST Enlighten or in the CAST Discovery Portal).
References are traced using search strings which is less selective than parser based technology used for other links traced by the analyzer. This technology detects a reference to an object wherever its name is mentioned, regardless of the context in which this reference occurs. As a result, incorrect links may be traced if a string happens to match a given name even if it is not logically related to the corresponding object. As a result you may have to intervene to filter incorrect references. Refer to the Dynamic Link Manager for more details on how to ignore these ambiguous links.
|Source||Lists the Technology or Analysis Unit that forms the Source for link creation (calling objects).|
|Target||Lists the Technology or Analysis Unit that forms the Target for link creation (called objects).|
|Reference Pattern||Indicates whether a Reference Pattern is also being used to determine links between Source and Target code. These can be added manually. |
Since Reference Patterns are based on Regular Expression searches, this is a way of adding more accuracy to the search for links between the Source and Target by targeting specific Regular Expressions.
|Origin||Default||Default dependency Rules are created automatically by the CAST Management Studio between Technologies, as follows: |
If no dependency Rules are "discovered" (during the package configuration in the CAST Discovery Manager Tool) between Analysis Units in the Application, then CAST will use a "default" rule defined at Technology level (you can modify the default Dependencies yourself - please see the individual Technology for more information).
Note that generally speaking database technologies do not have any technologies set as Target. The exception to this is MS SQL Server which has a default Target .NET technology.
In the example screen shot below, no dependencies were "discovered" between any .NET Analysis Units and MS SQL Server Analysis Units - as such a default Technology level rule was used to ensure links were created where references exist:
A more complex example of this feature is as follows. Take a situation where we have the following rules defined at Technology level:
If the following Analysis Units exist in the Application:
And CAST has discovered the following dependencies automatically:
Then the following dependencies will exist in this tab:
In other words, the J2EE > J2EE rule has been removed because CAST has discovered that certain Analysis Units depend on others and has created specific Discovered rules for them. No dependencies were discovered between any J2EE Analysis Units and SQL Analysis Units, therefore the default rule J2EE > SQL will be applied.
The J2EE > Mainframe rule will not appear because there are no Analysis Units of this Technology type in the Application.
|Discovered||Discovered dependency Rules are also created automatically by the CAST Management Studio - these Rules are, however, directly "discovered" from the source code, i.e., CAST has detected that one Analysis Unit depends on another. |
Dependency Rules that have been "discovered" are between Analysis Units:
|Custom||Custom dependency Rules are those that have been created manually. Typically these are created to cover a situation which the automatic Default and Discovered dependency Rules do not take into account. |
For example, this may be cross technology situations where code in Analysis Unit Technology A relies on code in Analysis Unit Technology B:
Custom rules can be created between Analysis Units - and between Analysis Units and Refined Targets - see below for more information about creating Custom rules.
Working with dependency rules via the available buttons
| Use this button to add a new Custom dependency Rule. A blank line will appear in the list of dependencies, which when selected will enable you to define the Custom rule: |
Creating a rule
|Use this option to remove a rule - you can remove any rule (Default, Discovered or Custom).|
|Use this option to reset the configuration: remove any Custom rules, and re-instate all removed Default and Discovered rules.|
|Use this option to reset the configuration: re-instate all removed Default and Discovered rules.|
|Use this option to clone an existing rule|
This option will transform an existing Default or Discovered dependency rule into a Custom rule.
|This option is only available if you have added a Reference Pattern to an existing dependency. Clicking the option will run the Reference Pattern between the Source and Target and save the results to the CAST Analysis Service.|