4

For my Software Design class, I have to find out if it is possible to decrease coupling and decrease cohesion at the same time by using the Facade pattern?

As you all probably know, when there is low coupling, the cohesion of the classes is high and vice-versa.

To me, this is a contradictory state, but I still think it is possible but can't find the enough evidence to support this.

My answer is this. The reason for this is that if we give some instructions to the classes that are cohesive they would not function in the same manner if there were no instructions. Given that, let say that we have the same facade with the instructions that have the capability to receive attributes from the classes that have low or high coupling. If this is true, the classes wouldn't be so dependent to each other and the coupling would be also decreased. In that way we have a facade which in the same time decreases coupling and cohesion of the classes.

  • 3
    Why would you want to decrease cohesion? – Warlord Feb 12 '14 at 22:26
  • 1
    Yep, agree with @Warlord: you want to increase cohesion and reduce coupling. – Hovercraft Full Of Eels Feb 12 '14 at 22:27
  • 1
    I think this might be more of an academic *what if?*, rather than a realistic goal. – christopher Feb 12 '14 at 22:31
  • 1
    I agree that there is no need to decrease cohesion but what @christopher said this is more of an academic what if. The question is actually "do I agree with the claim that the Facade pattern decreases coupling while also decreasing cohesion". – Mislav Niko Zaloker Feb 12 '14 at 22:51
  • 1
    Facade would decrease cohesion if you added the "facading/interfacing" logic inside already existing classes; This way, of course, this new almost-responsibility of translation would decrease the cohesion of the class, as not everything in it was related to translation (the rest is related to do whatever the class does, whatever its business function is). – acdcjunior Feb 12 '14 at 23:14
  • 1
    This question appears to be off-topic because Stack Overflow is for specific questions about coding with definite answers. Discussions about high-level design concepts are more appropriate for programmers.stackexchange.com. Please read this for more information: http://meta.stackexchange.com/a/82990/228805 – Adi Inbar Feb 12 '14 at 23:32

0 Answers0