Hello,
I'm using Design Level Assertion in my project. I have a SystemArchitecture Aspect to map the application layers :
.. and a DLA aspect to catch any unexpected cross-layer usage :Code:public aspect SystemArchitecture { pointcut inPersistenceLayer() : within(com.capgemini.quickstart.persistence..*); }
Code:public aspect DesignLevelAssertions { declare error : SystemArchitecture.callPersistenceImplementation() && ! SystemArchitecture.inPersistenceLayer() : "Do not invoke persistence layer implementation";
I'd like to convert this to AspcetJ 5 Annotation based syntax. Its ok for SystemArchitecture :
But I can't find how to convert my declare error, as a String is expected by @DeclareError() :Code:@Aspect public class SystemArchitecture { @Pointcut( "within(com.capgemini.quickstart.persistence..*) " ) void inPersistenceLayer() {} }
Code:@Aspect public class DesignLevelAssertions { @DeclareError( ??? ) static final String INVOKE_PERSISTENCE_LAYER = "Do not invoke persistence layer implementation";
Any suggestion ?


Reply With Quote