Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP project with excellent OOP design for studying purposes

I've recently became interested in proper OOP design in web applications. I think I understand most of the principles and design patterns but sometimes I have problem with putting them into practice.

I use MVC and I think I am able to design controllers and views in OOP way. The problem I face is with models. I'm particularly obsessed with dependency injection and inversion of control in general. It works nice in small examples but I have trouble to design complex multi layered models - I'm thinking about various ways to inject dependencies into lower layers etc.

So I decided to look for some projects made by more experienced OOP programmers which I could study. I'm looking for PHP web application, preferably made with MVC architectural pattern. Also I don't mind if it has anemic model (which is usually considered to be antipattern but in heavy data based applications I'm often forced to use anemic models).

Thanks a lot.

EDIT: I'm not looking for a framework but for a complete application. Frameworks usually have not a lot of to do with model architecture.

like image 347
Tomik Avatar asked Aug 31 '10 20:08

Tomik


2 Answers

Code igniter is php4, i don't recommend it too much. PHP OOP has changed since then. A better idea would be kohana

I learned a lot by checking out Konstrukt. The creator is semi active on SO too =)

like image 74
Galen Avatar answered Nov 09 '22 23:11

Galen


Magento Commerce has complex multi layered models (www.magentocommerce.com) which you may pick up a trick or two from.

But my (personal) experience with Magento was frustrating: I was hacking with it around version 0.8-1.1 and it appeared over engineered and poorly documented. Trying to figure out how it actually worked was complex: you'd end up with tons files open in your editor, most of them called Abstract.php. Hopefully things have improved a long way since then.

like image 21
Steve Avatar answered Nov 10 '22 00:11

Steve