Page 1 of 1

PoEAA and PHP

Posted: Thu Jul 28, 2005 9:15 am
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?

Posted: Thu Jul 28, 2005 11:17 am
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.

Posted: Thu Jul 28, 2005 11:38 am
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.

Posted: Fri Jul 29, 2005 2:08 pm
by McGruff