Struts2 - Java on Rails?
January 17th, 2008 | by Admin |Ruby on Rails is a Web application framework based on Ruby language. In many respects, Struts2 is very similar to Ruby on Rails but at the same time is better suited to large enterprise applications. Being J2EE based, Struts2 can leverage the entire Java API along with J2EE API such as EJBs for distributed processing.
Let us see if Struts2 compares to RoR when it comes to strong points of Ruby on Rails.
1. Minimal configuration - Like RoR, Struts2 requires minimal configuration. The both assume “intelligent defaults” for most of the configuration.
2. Automatic data transfer between controller and view - Struts2 achieves transparent data transfer between controller and view component using value stack concept. OGNL support in Struts2 makes it very simple!
3. ORM Mapping - Hibernate is an ideal open source tool that supports complex ORM mapping requirements. This can be easily used along with Struts2. In RoR, equivalent is the ActiveRecord. Another option for Java developers is the Spring DAO.
In addition to these, Struts2 has other very important features which makes it the ideal choice for any large scale Web application development. These are,
1. Talent Pool - A lot of Java talent is available in the job market. You cannot hire a 100 member RoR team in a day!
2. Scalability - J2EE has been evolving for almost 10 years now and offers pretty good scalability.
3. Out of the box portlet support - This is a must have for a large enterprise application composed of multiple Web applications.
4. Advanced Ajax support - The Dojo based Ajax support can be leveraged to create highly responsive Web applications.
5. Validation support - Client side and server side validations can be applied declaratively.
Pretty soon Struts2 will turn out to be “Java on Rails”…