mercredi 25 novembre 2015

Facade pattern combined with observer pattern

I got an assignment to find out exactly what the facade pattern is. I have googled and found out it is ment to shield a client from a very complex system by making an "interface". So I have 2 questions, I have seen in multiple examples is they make an C# interface for the complex system, but I have also seen a few that used A class as the "Interace" (as seen here). I can only make sence of it if it is a base class that simpliefies a lot of different complex method calls to different classes as in (the bank example seen here)

So my first question is if I am correct that you would implement the "interface" as a class?

My other question then is, could you use facade pattern together with the observer pattern. The facade class would observe on all subjects and then control what methods in different classes should be called, depending on the subject?

Aucun commentaire:

Enregistrer un commentaire