Say I follow the principle of shared responsibility, and I have the following classes.
public class Extractor { public Container extract(List<Container> list) { ... some extraction } } public class Converter { public String convert(Container container) { ... some conversion } }
As you can see, this is in accordance with the principle, and all class / method names report what they do. Now I have another class that has such a method.
public class SomeClass { private Extractor extractor = new Extractor(); private Converter converter = new Converter(); private Queue queue = new Queue(); public void someMethod(List<Container> list) { Container tmp = extractor.extract(list); String result = converter.convert(tmp); queue.add(result); } }
As you can see, "someMethod" -Method calls, converts and adds. Now my question is: what do you call such a class / method? It does not extract, convert or add, but calls them? If you name the method after its responsibility, what would it be?
source share