Java bytecode analysis is required to use this rule. |
A source code comply to an architectural model when it fully adheres to a set of architectural constraints. An architectural constraint allows to deny references between classes by pattern.
Here are some examples of patterns:
An "Architectural constraint" rule, provided by the "Sonar" rule engine, allows to define as many architectural constraints as desired:

The architectural constraint should be considered as a rule template and should not be directly activated. Let's say for instance that you want to forbid use of java.sql package by all your projects. In that case, you must first "Copy" the "Architectural constraint" rule to create and share your own specialized architectural constraint:


Your newly created rule can now be used and activated in any desired quality profile:
