Skip to content
Thomas edited this page Mar 27, 2017 · 6 revisions

Three shades of advice, four of scope

About advices

Currently, Mr. Advice can work at three level of advices:

  • The usual level, at method or property interception. We call it simply an advice
  • In a more unusual way, when the advice comes at type load (so it occurs only once per member). We call it info advice (because we had no better idea at the moment)
  • And the most innovative is the ability to advice Mr. Advice itself at weave-time. This allows to write code to generate new type information or rename existing members. This is called weaving advice

About levels

Mr. Advice support four levels of pointcut injection:

  • What you expect is the method level, so an advice is injected specifically on a method or property.
  • But it can also be inject at type level. If so, all methods and properties of the type will be advised.
  • The most common, it can be injected at assembly level, and here, all methods of all type will be advised.
  • Finally, advices can also be injected on parameters.