My question is regarding design
I'm trying to design order/sequential calls based on different methods.
Suppose my Class :
public class Foo {
public Object method1(String a){
// impl1..
}
public Object method2(List<Object> list){
// impl2..
}
public Object method3(Map<String,String> map, Object otherStuff){
// impl3..
}
// other different methods ....
}
I want to follow this concept http://qrman.github.io/posts/2017/02/09/pipeline-pattern-plumber-quest
But my difference is that I use the only 1 class with multiple methods, if i had different services I would create new class to each service with interface implementation as in the link , but my purpose is create list of order methods inside 1 class that will iterate and execute them...
I was thinking about some method reference based on java 8
like described here : https://www.codementor.io/eh3rrera/using-java-8-method-reference-du10866vx
basic idea ?
List<> list = new ArrayList<>();
list.add(Foo::method1)
list.add(Foo::method2)
list.add(Foo::method3) ...
forEach ..list -> execute
Thanks a lot