[aosd-discuss] validate architecture

eric at bodden.de eric at bodden.de
Mon Jan 12 12:26:40 EST 2004


Once upon a time (Montag, 12. Januar 2004 15:53), discuss-bounces at aosd.net
<> enriched the world with the following:

> Hello all,
> 
> I am writing an aspect attempting to determine if there are 
> architectural design decisions that are being broken (I'm new to the 
> group).  It probably goes without saying that I am still a newbie.  In 
> this case we have:
> 
>                  ---  Class1
> facade ---- --- Class 2
>                 --- Class 3
> 
> I want to make sure that facade classes are the only ones that are 
> calling Class 1,2,3.

Assuming that Class 1,2,3 are in package pkg and all facades implement the
Interface Facade (just to make it easy), youi want something like:

pointcut facade(): this(Facade); //not within(Facade) cause that would also
match inner classes, right?
pointcut callToNonPrivateMethodsOnPkg(): call(!private pkg.*.*(..));
pointcut forbiddenCalls(): callToNonPrivateMethodsOnPkg() && facade();

Didn't test it but should work kind of like this...

Eric

--
Eric Bodden
Aachen University of Technology (RWTH)
ICQ UIN: 12656220
Website: http://www.bodden.de
PGP key: http://www.bodden.de/pub_key.asc





More information about the discuss mailing list