views:

73

answers:

2

Hi,

I'm a little bit confused about MVC and OO paradigms. I have read some documentation about classical OO in the book "The Object-Oriented Thought Process".

Now I need to apply what I have learn in this book in the context of MVC pattern.

How can I design from scratch using the OO paradigm and implement it in a MVC Framework like CodeIgniter, or CakePHP, or other?

Best Regards,

A: 

Not sure on PHP but i would imagine the general principles would remain the same IMHO.

  1. Clear seperation of concerns by using a Dependency Injection (DI) container
  2. Lightweight and DRY controllers that only handle view presentation logic
  3. A Service layer to handle all Business Logic and Model validation
  4. A Repository Layer to handle persistence of your Data Model
  5. Use interfaces to decouple each layer and inject instances using your DI container
Mark
+1  A: 

Best way is to work through a tutorial and see how it fits together: http://book.cakephp.org/view/1528/Blog

Leo
+1. Yeah. Start with cookbook. You need to understand CakePHP.
bancer