societe-generale/arch-unit-build-plugin-core

Add the possibility to have inheritance for configurable rule.

magori opened this issue · 4 comments

Summary

Have the possible to have inheritance in configurable rules and the invocation is donne on the master class(abstract).
In this case only on method is call.

Type of Issue

It is a :

  • bug
  • request
  • question regarding the documentation

Motivation

  • The advantage is that it allows to apply actions for all rules that implement for example an abstract class.
  • Less duplication of code.

Current Behavior

Now only the declared methods is invoke.

Propsition: https://github.com/societe-generale/arch-unit-build-plugin-core/compare/master...magori:InvokeConfigurableRuleMethodWithInheritance?expand=1

hi, do you have an example with a couple of rules where's there's actually some duplication avoidance ? I am struggling to picture the benefits right now

I made library with rules and somes rule can be disabled by a configruation file or with a annotation. For the moment this code(for filtering) is in each rules, so i have duplication of code

enabling/disabling rules through a config file sounds a lot like what you can do by configuring the rules in the maven/gradle plugin. why not take that approach instead ?

closing as no feedback - please reopen if required