I am new to SE. Recently I read about the Chain of Responsibility pattern, so basically what it does is: it creates a class that has some methods and also next class (next chain block), so when it processes the data it passes the processed data to the stored class. I have seen many implementations of it, for example here: https://www.journaldev.com/1617/chain-of-responsibility-design-pattern-in-java
mt question is: why just don't create a dictionary of class? dict['0'] would be first-class, dict['1'] would be second class, and so on. by the way those classes are more general (they can also not inherit from one superclass, they might be totally unconnected classes), so this implementation is more general and also easier to implement.