Here is a piece of cool code to add the two integers, a and b:
NameService nameService = NameService.getSingletonInstance(); OperationService operationService = nameService.resolve(OperationService.class); ValueFactory factory = OperationServiceFactory.newInstance(); AbstractValue va = factory.newIntegerValue(a); AbstractValue vb = factory.newIntegerValue(b); Operator operator = operationService.resolve(AdditonService.class); AbstractValue vc = operator.performOperation(a, b); int c = nameService.resolve(IntegerDecorator.class).getValue(vc);
Unfortunately I cannot paste the actual production code that does a little bit more (while not much) but the problem should be obvious: there is much more code than minimally required and despite of "design patterns applied" it is very difficult to read or refactor it. It can be written much simpler and shorter but the author of the code claims you being unprofessional for saying so. Where is the problem with the code? It really could not be that there is no any.