CRITICAL
Rule Definition
If you have different functionalities, you probably do not want every class of each to be accessible from any other functional areas. This rule makes sure that no restricted classes is accessed from outside its own function area.
Remediation
Keep every functional area loosely coupled.
Violation Code Sample
package functional
{
import functional.func1.api.Func1ExposedClass;
import functional.func1.restricted.Func1RestrictedClass; // VIOLATION
import functional.func2.api.Func2ExposedClass;
import functional.func2.restricted.Func2RestrictedClass; // VIOLATION
public class FunctionClient
{
}
}
package functional.func1.api
{
import functional.func1.restricted.Func1RestrictedClass;
import functional.func2.api.Func2ExposedClass;
import functional.func2.restricted.Func2RestrictedClass; // VIOLATION
public class Func1ExposedClass
{
}
}
package functional.func1.restricted
{
import functional.func1.api.Func1ExposedClass;
import functional.func2.api.Func2ExposedClass;
import functional.func2.restricted.Func2RestrictedClass; // VIOLATION
public class Func1RestrictedClass
{
}
}
package functional.func2.api
{
import functional.func1.api.Func1ExposedClass;
import functional.func1.restricted.Func1RestrictedClass; // VIOLATION
import functional.func2.restricted.Func2RestrictedClass;
public class Func2ExposedClass
{
}
}
package functional.func2.restricted
{
import functional.func1.api.Func1ExposedClass;
import functional.func1.restricted.Func1RestrictedClass; // VIOLATION
import functional.func2.api.Func2ExposedClass;
public class Func2RestrictedClass
{
}
}
Reference
http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD
Related Technologies
Technical Criterion
Architecture - Reuse
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.