DCL

An elegant OOP with mixins + AOP for JavaScript.

dcl.around()

Version 2.x

This is a convenience decorator to define a around advice based on dcl.advise().

Description

This is a shortcut function to define one around advice. Logically it is defined as a synonym for dcl.superCall():

dcl.around()
1
2
3
dcl.around = function (advice) {
  return dcl.superCall(advice);
};

It means that instead of:

Long
1
2
3
method: dcl.advise({
  around: advice
})

It is possible to write a shorter version:

Short
1
method: dcl.around(advice)

Of course you can always do it like that too:

Supercall
1
method: dcl.superCall(advice)

Advice function

Essentially it is the same as dcl.superCall(). It uses the same double function pattern, and its behavior is the same.

Notes

Do not forget to use the double function pattern for an around advice. See details in dcl.superCall() and in dcl.advise().