plugins(interceptor) best practice

Notes

  • Around-plugins SHOULD only be used when behavior of an original method is supposed to be substituted in certain scenarios.
  • Plugins SHOULD NOT be used within own module.
  • Plugins SHOULD NOT be added to data objects. ( why? )
  • Plugins MUST be stateless.
  • Plugins SHOULD NOT change the state of an intercepted object (Intercepted object is $subject).

plugins SHOULD BE used for modifying the input or output of a function.

References

technical-guidelines-interception

发表评论

电子邮件地址不会被公开。 必填项已用*标注