Sunday, 5 August 2012

struts differences

The Struts Framework

Struts 1.0 weakness addressed by Struts 1.1
Weak point
Struts uses the container’s default logging system and does not provide a ready mechanism for applications to provide their logging language.
(Struts 1.1 implements the Commons-Logging interface package)
Loads a single configuration file per application
Larger projects need to use multiple configuration files that do not need to be shared by the entire team. (Struts 1.1 supports multiple configuration files)
Loads single resource file per locale
Larger projects need to use multiple resource files that do not need to be shared by the entire team (Struts 1.1 supports multiple resource files)
No service manager
ActionServlets must be sub classed to be extended with additional services, such as a custom logger or authentication system. (struts 1.1 offers several new extension points and components)
ActionForm red tape
Struts 1.0 excepts developers to create custom java beans for use with HTML form inputs (Struts 1.1 supports Maps and DynaBeans in place of custom java beans)
Struts 1.1 weakness
Weak point
No event model
Struts is tightly coupled with the request-response model used by HTTP. This can be restricting to developers used to finely grained events.
There is no support for automatic debugging. Developers have to resort to creating manual “breakpoints” by writing to standard out or the container’s log.
No default data model or concrete recommendations
Access to persist data model is left entirely as an exercise for the developer
Single ActionServlet
Only one ActionServlet can be used in a single application. This restriction can lead to configuration conflicts.
Requires understanding of the Struts components
To work in struts, a developer needs to understand several special classes and how they interact.
Vendor does not offer priority supports
The apache software foundation is an all over volunteer organization without a paid staff that can provide a guarantee response.

Struts 1.0 Vs 1.1
1.     First difference regarding ActionServlet sub classing. The implementation of ActionServlet changed quite a little bit between 1.0 and 1.1. Most developers did not sub class from the Struts 1.0 ActionServlet because of two main reasons:

a.     ActionServlet is Singleton. We do not create new ActionServlets as how we do sub classes of ActionForm and Action classes.
b.    Second the ActionServlet spends most of its time for invoking other objects but not the functions of servlet. We code the object and functions called by servlet. Most of the frameworks use this approach. In fact this type of approach is called Inversion of control (a.k.a the “Hollywood principle” or “Don’t call us we will call you”. The ActionServlet coordinates the activities but the methods defined by the user to tailor the framework are only called by the servlet. In fact I want to know how exactly the contract can established between third party framework with user developed code. This type of mechanism is called as call backing mechanism. To understand this remember how ejbPassivate() and ejbActivate() functions are called by the container process since container generated by one vendor and bean code developed by developer.

Because developer do not know the implementation of ActionServlet in Struts framework hence such type of components are called as black box components. Action and ActionForm sub classes are called as white box components.
2.     In the struts deployment descriptor file controllers, message-resources, global-exceptions, plug-ins are included.
3.     DynaActionForm and DynaValidatorActionForm (validation framework) are introduced.
4.     To enhance view tiles-defs are included.
5.     perform() method of Action class replaced with execute() method.
6.     ActionError and ActionErrors classes are replaced with ActionMessage and ActionMessages.

Struts 1.1 and 1.2
In Struts 1.2 Fileupload option introduced
This will remain based on Servlets 1.2/JSP 1.1
Struts 1.3 will introduce the struts chain request processor. Tag libraries are newly introduced for this.

No comments:

Post a Comment

Write your openion about my blog spot..To get automatic facebook updates like my Page ..It takes only 1 min to write the comment and to like the page.. Thanks.