RAD Plug-in for Migrating from STRUTS to SPRING · PDF fileRAD Plug-in for Migrating from STRUTS to SPRING By ... Framework • Basic architecture for designing a complex application
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
� Step 2: Organ Transplant : Changing Struts Form Beans to Spring Command Classes � Struts provide FormBeans as interface between the JSP and the controller servlet.
In Spring these are replaced by POJO (Plain Old Java Objects) Command Classes.
� Form beans extend the ActionForm class of struts framework. POJO Command Classes do not extend any class
��$����� ��$�����
,�(� ��������*�� ����� ���'��"�� �������=>���?
,�(� ��������*�� �������'=�>���?
Five Step Methodology
IBM Rational Software Development Conference 2006
AM13
� Step 3: Heart Transplant: Changing Struts Action classes to Spring Controller classes
� Struts provide ActionServlet by default as the controller where as in Spring the default controller is DispatcherServlet
� Spring has different controllers which handle individual modules. These can be seen as replacement for Action Classes
� Converts struts related tags, codes etc to spring equivalent
� File Creator
� Creates Spring project folders structure
� Copies converted files to appropriate folders
IBM Rational Software Development Conference 2006
AM13
���� ���� ��� �����
IBM Rational Software Development Conference 2006
AM13
J2EE Framework Migrator
� A Plug-in (MIGRATOR) which is compatible with Eclipse
� It can convert an application from Struts to Spring
� Easy to install & enhance
Features
� This plug-in reduces certain overheads :
� Creating new Folder Structure according to
the migrated framework.
� Installing related Jars of migrated framework
� Converting Configuration files from one framework to other.
� Converting one Framework specific tags to other framework specific tags
� Converting Framework specific code
Operational Features
IBM Rational Software Development Conference 2006
AM13
Plug-in Development Environment
� Eclipse has provided an API for plug-in development (PDE) for RAD, which is used to develop MIGRATOR Plug-in.
� This helps it to plug in various different IDE’s like Rational Application Developer (RAD), WebsphereApplication Developer (WSAD), Netbeans, and Eclipse 3.0.
What does this plug-in do?� Creates framework specific Folder structure
� Places all framework specific jars in lib folder
� Converts framework specific code of JSP’s, Form beans, Action Classes
� Creates/Converts framework specific configuration XML’s
� Places all the converted files in appropriate folder
IBM Rational Software Development Conference 2006
AM13
� Migrator can be installed on any eclipse based IDE or NetBeans IDE using the Installer provided.
� There are two ways to start Migrator
Installing Migrator Plug-in
IBM Rational Software Development Conference 2006
AM13
� Phase-wise capability in terms of effectiveness of migrating a simple application from Struts to Spring
Phase in Migration Plug in Capability
Face Lift 50%
Organ Transplant 90%
Heart Transplant 30%
Brain Transplant 20%
Blood Transfusion 90%
� Overall the MIGRATOR Plug-in is capable to reduce 70% (approx) of the manual efforts in migrating a simple Struts application to Spring. Further enhancements may increase the level of automation.
Migrator Plug-in Capability
IBM Rational Software Development Conference 2006
AM13
���� ��� � ���
IBM Rational Software Development Conference 2006
AM13
Creator Classes
IBM Rational Software Development Conference 2006
AM13
File Converter and Locator Classes
IBM Rational Software Development Conference 2006
AM13
File Parsers
IBM Rational Software Development Conference 2006
AM13
Mapping Database
IBM Rational Software Development Conference 2006
AM13
Mapping Database
IBM Rational Software Development Conference 2006
AM13
Demo
IBM Rational Software Development Conference 2006
AM13
Migrator UI
IBM Rational Software Development Conference 2006
AM13
JSP with Struts tags (Before migration)
IBM Rational Software Development Conference 2006
AM13
Spring JSP (After migration)
IBM Rational Software Development Conference 2006
AM13
Migration Summary
IBM Rational Software Development Conference 2006
AM13
� Presently MIGRATOR plug-in is capable of migrating simple applications in
Struts to Spring, for more complex applications
� It can be enhanced to migrate areas such as
� Struts tld library
� Logic tags
� Validation framework
� Error handling
� Database Mapping
� Other Controllers of Spring
Further Enhancements
IBM Rational Software Development Conference 2006
AM13
� It only handles SimpleCommandController
� findForward("sucess") , “success” is user defined tag which cannot be pre assumed for
success or failure views. So after conversion both the statements of Success & Failure are inserted in comment , the programmer can choose the statement according to the view required
� Some closing tags are missed out or not in proper place , the programmer must ensure it before executing
� Programmer has to handle logical flow of the application as migrator handles only