title: How to implement a dynamic chain of responsibility in Java?
body: <p>I have a set of requirements on a business logic validation:</p>
  
  <ol>
  <li>Each independent step of the validation must be separated;</li>
  <li>The order of these steps can be defined by an administrator;</li>
  <li>Steps can be disabled.</li>
  <li>Each validation step isn't user-defined - i.e. the code <em>is</em> compiled.</li>
  </ol>
  
  <p>So I thought of implementing a dynamic chain of responsibility, that'd load the steps order and classnames from a table, instantiate them with <code>Class.forName()</code>. But I'm not very fond of storing the className in a table as this could lead to potential issues (refactoring the name of a validator, for instance, would simply break the code). This is what I do:</p>
  
  <p><img src="https://i.stack.imgur.com/YOgX7.png" alt="Enter image description here"></p>
  
  <p>Of course, the more flexible a solution has to be, the more complex it will be. Still, I'd like to know if there's a way to garantee the above requirements without storing the class names in a table?</p>