4
saiphp
7y

Fat model or fat controller?

Comments
  • 2
    My gut tells me fat controller.
    But don't trust my gut, it thinks enough mate is the same as enough sleep.
  • 3
    Model. Your controller should not have much to do but provide for proper input validation and handling of requests. I've seen many projects with fat controllers and at some point it always seems to turn out in a mess.

    Fat models however provide for clean controllers, they encapsulate access to business or service layer, provide access to required data and can be reused wherever you need. If you have.complex models that obtaim their data through different ways or are made up.of several.different models consider using a model builder pattern.
  • 0
    Ok thank you two for the reply. I think I'm on the right track. But my co worker don't agree with me. I said models are reusable, controllers are not. Right?
Add Comment