I'm done refactoring Overactive Logistics to support automatic data conversion on post invocation in a form. This refactoring eliminated about 40% total of the application's code which was every single line of code written in the Web Commands to take the parameter out of the HttpServletRequest, convert it to the right type and set it in the collection to be sent to the EJBCommand.
Now I'm back with shipments which I calculate is about 70% done, the gui is in place as well as its web and ejb commands plus its ejb maintenance and domain classes. The pieces still to be completed are the notations to map the entitybeans and the database tables.
Thursday, July 27, 2006
Friday, July 14, 2006
Significant refactoring comming up.
I'm putting the development of the shipments module temporarily on hold since I came up with a very cool idea that will reduce a lot of the amount of code required in the web commands.
One of the tasks for a web command is to convert the values of the parameters that are comming out from the HttpServletRequest object to their right types. For example a textfield element in a screen module my prompt for a number, when the form is submitted this value is sent to the server side component as an String due to HTTP. The web command then gets this value using the method getParameter(String) and converts it to Integer placing it later in a collection that will contain all the parameters for the required ejb command. This results in writing a lot of code to convert all the non String values to their right types.
By modifying the xsd definition for the input elements to require a type property, their values can be sent in the following way:
Integer:1
String:hello
Boolean:True
Float:5.912
Then a single method can parse all the value and convert them using the information provided.
This refactoring effort will eliminate up to 30% of the code that has already been written however it will require modify all the stylesheets to provide the type property in the definition of each input element.
One of the tasks for a web command is to convert the values of the parameters that are comming out from the HttpServletRequest object to their right types. For example a textfield element in a screen module my prompt for a number, when the form is submitted this value is sent to the server side component as an String due to HTTP. The web command then gets this value using the method getParameter(String) and converts it to Integer placing it later in a collection that will contain all the parameters for the required ejb command. This results in writing a lot of code to convert all the non String values to their right types.
By modifying the xsd definition for the input elements to require a type property, their values can be sent in the following way:
Integer:1
String:hello
Boolean:True
Float:5.912
Then a single method can parse all the value and convert them using the information provided.
This refactoring effort will eliminate up to 30% of the code that has already been written however it will require modify all the stylesheets to provide the type property in the definition of each input element.
Thursday, July 06, 2006
Shipment module update.
The shipments module progress is moving slowly mainly because I'm trying to avoid the need for any future refactoring as much as possible. As I move forward I've been making improvements and refining the core framework that will minimize the amount of code written in the web commands.
If possible I'll try to have a release at the end of this month.
If possible I'll try to have a release at the end of this month.
Subscribe to:
Posts (Atom)