Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] Invariants

Hi Frederic,

> - In order to implement the proper semantics of a class invariant, I
> also want to ensure that when an object calls methods from its public
> interface on itself (as opposed to on other instances of the same
> class), the invariant should not be checked, how do I achieve that?

You can exclude those calls by saying && !within(MyClass ..) or to avoid
deeper calls you can use && !within(cflow ..).

> - Other more general question, is there a reuse mechanism that would
> allow me to capture this general aspect "pattern" generically, then
> instantiate it for concrete classes and specify the accompanying
> invariant assertions for that class?

Yes, you can make the aspect abstract.

Hope this helps,
Macneil



Back to the top