PoEAA and PHP

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

PoEAA and PHP

Post by nielsene »

Actually this title should be more "patterns" and PHP. There are a lot of patterns that make a lot of sense in any programming environment, but there's also a lot that don't make as much sense in PHP. I'm working my through PoEAA right now, but I'm having lots of "tingling misgivings". I know the first set of misgivings is having to suffer through a devout OOP-ists critisms/complaints about relational databases, but I was expecting that and can deal....

However, I'm feeling that languanges with application scope will offer very different patterns than those without (like PHP). Does anyone know of some good articles exploring this?
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Haven't seen anything specifically related to patterns in php apart from http://www.phppatterns.com. Also, Jason Sweat is about to publish a book on patterns in php including some of the PoEEA enterprise patterns.

I'm out of my depth here but I guess the big differences with php and a language like java are statelessness and loose typing. Lack of state means you're more concerned with using just what you need rather than loading up the entire domain model - lazy-loading is possibly more important.

I do think PoEEA is very relevant to php though. If any single book was the programming bible, this is it.
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

I don't deny that its a useful book, and I do look forward to getting a copy of jsweat's book. But I do feel that there are big issues in difference in underlying application framework that should be looked at. (I'm not pushing for any paticular change from PoEAA, just think that this analysis has been lacking in the PHP OOP community to date.)

Lots of patterns such as Data Mappers, some implementations of Front Controllers, Gateways, MetaData Mappers, etc are all designed about a system where its worth doing lots of "setup" work upfront, once, and then being able to re-use it on every later page. PHP can't do that, without re-setting up everytime. So a different pattern might be more appropriate, etc.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Post Reply