views:

16

answers:

1

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
Can you explain more, what is in other context? I have to use Facade Pattern
SteveThai
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
My application is simple HomeCAD. I've created some classese(HomeCADEngine facade,Room,Item,Floor). Thanks for helping me
SteveThai