0

I have a question related to design patterns, I am developing an MVC app in php, but I dont know where will be the class facade, if I am using an mvc pattern, I think that the facade have to be in the model, but I dont know??, where to put the class facade?

**model**
DeliveryDepartment.php
DiscountDepartment.php
OrderDepartment.php
PizzaCallCenterFacade.php
**view**
**controller**

or I have tp put the facade in another folder? how do you organize the dessing pattern facade with MVC?

thanks for answering

bentham
  • 1,701
  • 3
  • 20
  • 32

2 Answers2

2

If you're talking about Facade pattern implementation, than this class has to stay together with models, since it "facades" other model classes.

yegor256
  • 102,010
  • 123
  • 446
  • 597
  • correct. Facades are created to reduce complexity. It belongs in the model. – jgauffin Sep 07 '12 at 07:03
  • @yegor256 thanks for answering, if I use an mvc framework like zend the design patterns should be in the helpers folder or in another folder? – bentham Sep 07 '12 at 13:30
  • "design patterns" are not classes, they can't _"be in a folder"_. [Model-view-controller (MVC)](http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller) is also a design pattern, for example. – yegor256 Sep 09 '12 at 07:02
1

I would create a new directory called components. thats where I stick extra classes that are not model views or controllers. Maybe call it helper if thats what it is.

**components**
facade.php 
**model**
DeliveryDepartment.php
DiscountDepartment.php
OrderDepartment.php
PizzaCallCenterFacade.php
**view**
**controller**
jarchuleta
  • 1,231
  • 8
  • 10
  • thanks for answering, if I use an mvc framework like zend the design patterns should be in the helpers folder or in another folder? – bentham Sep 06 '12 at 23:40