In HomeCADEngine facade class I have a method "addRoom(room:Room)" and it will add this room to a ArrayList. But is it break facade pattern when we create a room outside facade class and then pass it into addRom() method??
A:
It depends. If Room
belongs in your context (rather than the other one hidden behind facade), then it's a reasonable idea. If Room
belongs in the other context, then you probably could use a factory or translator which builds objects used by the other system from primitive properties or objects from your system.
Konrad Garus
2010-07-06 14:07:54
Can you explain more, what is in other context? I have to use Facade Pattern
SteveThai
2010-07-06 14:19:59
One context is your application. The other context is the CAD system for which you are writing the facade. Is Room defined and used in your system, or in CAD?
Konrad Garus
2010-07-06 14:31:43
My application is simple HomeCAD. I've created some classese(HomeCADEngine facade,Room,Item,Floor). Thanks for helping me
SteveThai
2010-07-06 14:40:06