PHP, .NET or J2EE? –Some considerations when choosing web development platform

One of my old posts, with some thoughts apparently not true or outdated in today’s view; just put it here to fill the space 😉

— The technical platform selection first is determined by what kinds of resources/expertise the developemnt team have.

— Language by itself: PHP is a scripting language, like VB script used in ASP. whileas Jsp and are pre-compiled when serving the request, Java and ASP.NET(whether C# ,, J# or others) are full-fledged object-oriented language; PHP is still not full OO before version 5 . Traditional COM based ASP mainly uses VB/VBscript, which sucks.

— Enterprise level Services: J2EE and .NET and the traditional ASP (with microsoft DNA architecture built around COM/DCOM and MTS/COM+) provides enterprise level services such as component services, security, transaction management, object pooling, O/R amapping, clustering etc so that the application developer can focus on the application logic, and they are proven technologies in large-scale applications of various industries. PHP is weak at this area: You probably need to build the frameworks by yourself in a large scale/complex distributed system.

— About Software Design: Java/C# etc are good OOP languages and suitable of applying OO design patterns. Among the two, Java community is more design-patterns aware, with J2EE spec requesting developers having design patterns in mind when deisgning applications. Microsoft’s development tools, especially Visual Studio for ASP.NET emphersise on the usability and simplicity for the developer and don’t require advanced design knowledge. There are pros and cons of both approaches. J2EE’s approach makes it difficult for beginners, also the lacking of good IDE support (hopefully new IDEs with good JSF support will catch up) makes even very simple application development a complicated process. ASP.NET approach makes it easy for simple apps and beginners, but has more retrictions when you want to go more advanced steps.

There are lots of open source frameworks in J2EE to improve productivity and enforce design patterns, such as MVC frameworks like struts, webwork or JSF/ASP.NET types framework such as echo. ASP.NET basically is a page-level MVC framework. The use of framework can enforce the design pattern but on the other hand the developer is restricted by the framework’s own limitations.

AOP (Aspect-oriented programming) is one of the most hyped software engineering methdologies. There are lots of projects provides AOP in Java now, either through a language enhancement (aspectJ) or through frameworks utlizing bytecode enhancing or runtime reflection/Dynamic proxy(Spring, AspectWerkz, JBossAop etc). MS .Net currently does not have any of this, but probably will eventaully have similar features.

— tradional COM based ASP (asp 3.0) is currently widely used, but there are lots of issues with the technology and that’s why MS is discarding it and come up with .net.

— Lots of J2EE features are now being ported into .NET– for example in the up-coming 2.0, things like JDO or Hibernate type of O/R mapping is being added; The new “MS build” concept is stolen from the Apache Ant project; And because of the similarity between Java and C# languages, actually there are lots of open source Java frameworks are being ported to .NET: ant, junit, hibernate …; It’s similar vice versa: The Sun JSF specification is about the same concept as the ASP.NET web forms.

— When it comes to a web application, it is much faster to prototype it in PHP and ASP.NET than in Java without WYSIWYG IDE support.

— About backend Database systems: Although APache+PHP+MySQL is popular in building web apps, MySQL is not yet matured for complex systems, since up till now it still lacks some important features in a RDBMS: subselects, stored procedures, triggers, views, foreign key referential integrity etc. It just recently added transaction support with the help of innoDB
engine. All major commercial DBMS beat it in terms of features and performace under heavy multiple users, complex queries, and read/write query load. MySQL is faster for simple SELECT queries. If going for Open source DBMS, then Postgres SQL is a better choice both in features and licenses(truly open source ).

–Scalability: There is an never-ending argument between different camps. But I think the most important factor is the application architecture . If you build something that does not scale, it’s more of the design, not the language itself.

— vendor lock-in etc.

PHP and J2EE does not have the vendor lock-in problem.

At this moment ASP.NET do have the this issue. simply look at what MS did for Office users.

However, in the long run, .NET platform may not be a big problem for vendor lock-in. With (hopefully) the rise of open souce .NET implementations like MONO, we may not rely on MS for the .NET technology. but that’s not ture at this moment and quite possibly will never happen.

--Integration with other systems/platform:

traditional MOM middleware is well supported in java and MS technologies. they also support web services well. PHP also has some existing library supporting XML web services. PHP also supports calling other languages such as java.


About: mmpower

Software Architect & Soccer Fan 黑超白袜 = IT 民工 + 摇滚大叔

Leave a Reply

Your email address will not be published. Required fields are marked *