PHP - Where exactly do you sit?
I read an article recently about more on the Zend and IBM partnership, which I have been aware of for some time, but hadn’t quite seen it phrased this way - PHP is to compete against .NET for SME web applications. For me that was a big ‘wow’ statement.
When researching technologies for enterprise application development I have seen often a lot of Java technologies such as JSF, Spring/Hibernate, Struts and Tapestry - yet I rarely see in the same article the emerging structures from PHP or .NET. It is like there is a bottom teir that PHP, .NET and RoR falls into, great for lower level projects or specific implementations (such as rapid development with RoR and .NET, and speed and simplicity of PHP) . It has made me really think about how PHP lacks against the other technologies, and also trying to identify the best use for PHP - where does it end and others begin? If at all?
For me PHP has clearly been always a light-weight development tool that performs well. But it does lack a lot of enterprise level functionality, such as persistence layers and MVC frameworks and a useful class API (not just functions, but well structured classes/interfaces). This has sparked a lot of additional projects such as PEAR/Pecl which has aimed at providing additional class functionality. As a comparison I have seen .NET to have those parts of the application framework solved as part of its standard offer, and C# is great, but if you were to step up to that level you would be better off stepping into the JEE realm, as there is much more richness, developer focus, resources and technologies (personal preference) - and “it isn’t evil” as my old boss would say.
As a result taking the leap from PHP to JEE has been in the past quite large, and there is often debate in my mind where the line is between the projects. If you step up from PHP not only do you need a dedicated production environment (no adequate shared hosting in Australia) but you need to step the whole infrastructure of your applications up in their configuration. This has lead me down the path of introducing and leveraging off contributed frameworks for PHP, which have almost always been modeled off Java. Persistence layering homegrown, database abstraction ADOdb, MVC with php.MVC etc.
But once you start to build your aps and really press into these different packages you start to feel that you are just trying to implement concepts that have been around for 5+years in Java anyway, and hunders of developers are contributing to its stable releases and documentation. Also you then start to encounter overheads in loading of packages of PHP and then find you have to use cut down versions (such as ADOdb_lite etc) to try and pick up the performance back for your requests (as every request builds up and tears down). It feels like you are always trying to port framework ideas into PHP, when if you just took the next step up to JEE all your problems will be gone. But remember, dedicated production environment, bogus configurations, argh!
So I am interested to see what Zend and IBM start to introduce to make working for small to medium enterprise applications easier, without ending up creating a mix and match purpose driven dribble snippets of code, like a API to work with google, instead of dealing with creating a real set of structure that you can build off. Real sets of interfaces and classes to deal with first, then the nicer tricks built off the top.
So what things do I dig at the moment that are going on in the PHP world that will really excite where it is going?
- PDO - Formalising some structure behind database connectivity
- SDO - Single API for data, introducing concepts of Persistence and Object Relational Mapping
- XML - PHP5 with various additions of DOM, simpleXML etc - XML is great for almost everything
- Web Services - Ensuring future interoperability with larger parts of the application
Hopefully with the Zend Framework being developed on we will see more core structure and packages coming out dealing with collections, HTTP request objects and database etc, and then eventually see more application frameworks (MVC’s etc) being introduced. This may lead to a scenario where PHP can really sit into that small-medium project size, being able to be as simple as a Hello World web application in 1 line but still having the ability to scale into a medium app with MVC, abstraction and persistence. And, due to the XML and Webservices functionality provided in the newer PHP versions we will see PHP sit more and more definatively into its position in the industry.





