Saturday, November 21, 2009

Comparing PHP Java and Ruby

Today I tried to do a small research to try and find out what language is best
when it comes to web development and tools that supports it. I tried to compare the three most used languages for web frameworks namely PHP, Java and Ruby.
All the details collected here are from my colleagues and not from a firm source. So if there is
any mistake please feel free to highlight.

The comparison was split between following items.

1/ Speed
2/ Debugging (and profiling)
3/ IDEs and Tools
3/ Testing (Unit, functional, performance)
4/ Logging and Log file maintenance
5/ Security
6/ Application integration (Integrate legacy systems and ERP systems).

Speed component depends on what you really do and the actual framework you
are using. But in general when the number of requests are low to medium PHP > Java > Ruby. When the number of requests are
high Java > Ruby > PHP is the case.

Tools that supports Debugging.
PHP - PHPEd, Expert Debugger
Java - Any IDE, JMeter, JProfiler
Ruby - ruby-debug,ruby-prof(Profiler)

List of popular IDEs for each language.
PHP - PHPEd, PHP Designer, Zend Studio Professional, PHP Expert Editor
Java - Eclips, JIdea, JBuilder
(Note: JIdea is best)
Ruby - Aptana RadRails, TextMate, Steel IDE ( NetBeans, JIdea Ruby plugin, CodeGear's 3rdRail
(Note: NetBeans free and the best so far)

PHP - Testilence, izh_test,Phpunit, Spike PHPCoverage,SimpleTest.
Java - Junit, Cactus,Jemmy, jfcUnit, Abbot
Ruby - MiniTest, Test::Unit

The security features of Java is unmatched when compared with PHP or Ruby or any other language. Actually Java was born
with security. Starting from its Strong data typing, Automatic memory management, Bytecode verification, Secure class loading
Java exposed a new dimension to the world of security.

When it comes to logging and application integration also Java leads the other languages for its versatility, available tools and frameworks.

Now the issue is if Java is such strong what is the catch. Why people use PHP for most of the sites. One reason is the cost. You need a dedicated server to host a Java site most of the time. Next you need a skilled staff from development to network administration to handle a heavy wait Java application server.Because of the above reasons PHP would be a better option to run small to moderate sites.

Also check the following comment by
James Gosling the father of the Java programming language
Ruby can't scale as good as Java

Monday, November 16, 2009

Porting our existing J2EE ecommerce application to Liferay.

The main reason for porting the existing portal to Liferay was, to use the
CMS capabilities it provides. On the evaluation on what CMS to use
we found a hand full of Java Portal/CMS systems.
Although the framework of each of them were attractive they lacked good portlets or plugins which can be used out of the box. Liferay on
the other hand has many plugins available already. It has a Forum, Blog, RSS/Atom Module, A fine HTML templating module and a couple of simple frame works to write CRUD applications which were critical for our requirements.

The site we implemented had three full fledged ecommerce applications, landing sites for several affiliate products, promotion pages,
forums, blogs, newsletters, testimonials, press releases and articles. There was a magazine and advertising
campaign application that was meant to be used by the readers of the company magazine. This application
had a poll, a survey, a competition and couple of other options aimed for the campaign.

From the side of implementation we used an agile development approach and our development
team had 11 members. The time span for this project was only 2 months and the site had around 80 pages both
dynamic and static. Although this was a tough deadline we had to accept it as the management already scheduled advertising
campaigns that follows the delivery of the site.

Since the complexity of the user interface designs and for the flexibility we agreed not to use portlets for implementing
the ecommerce modules. The architecture was to use AJAX/JSON to integrate functionality and keep the pages
generating from the Liferay CMS.

Today we got a reward for completing the project on time with a lot of appreciation from our management. Being the
project manager Im so pleased and like to thank the whole team for their dedication and hard work. Cheers Guys.
Also now we are fully convinced that Liferay Portal is a better Java based CMS (or a WCM - Web content Management System) among the
Java CMS family.

If you like to have a look on the site visit this link
>>>Link Removed !<<<

Thursday, November 5, 2009

Use rewriterule with DocumentRoot instead of ProxyPass

When ProxyPass is used on root level with DocumentRoot proxing will dominate and appache will not serve anything from the document directory.

For example if following configuration is used

DocumentRoot /var/www/html/
ProxyPass / ajp://
ProxyPassReverse / ajp://

The content in /var/www/html/ will not be served by appache.

RewriteRule is the way to solve this.

DocumentRoot /var/www/html/

RewriteEngine on
rewriterule ^/blog - [L]
rewriterule ^/(.*) ajp://$1 [P,L]

When the configuration is changed as shown in the above example the content in the folder /var/www/html/blog will be accessible with a URL like http://domain/blog