0

Remove middle man has diagrams from hide delegate?

Petr Vnenk 8 months ago updated by Hoang Tran 7 months ago 1

I feel like https://refactoring.guru/remove-middle-man resues diagrams from https://refactoring.guru/hide-delegate, just switches their position (suddenly the solution is a problem). Shouldn't "remove middle man" have completely different diagrams?

In these cases, we need to weight which solution we should go for. The first one is the middle man has too many methods that simply delegate to other objects while the second one wants to hide the delegate. Both problems are quite vague in my opinions. We should try both to see if it solves our current code design.