Hi,
Like in all axis2 core and modules Sandesha2 also had lot of unneccesary
OO code and
macros. In order to get rid of this I did the following
1. Find functions which are passed a structure as the first parameter
but not necessary to do so(funcion
is not structure specific).
Removed that argument from the methods making the enviroment the
first argument.
2. Removed op structure from all files where the structure is not used
in a inheritance hierarchy.
I found that in lot files this happened. Removing these op
structures mean getting rid of lot
of function macros which in turn made the code lot simple and lot
readable.
3. Where OO is neccessary(I found in only very few places) I replaced
the macro with the following
code
in header file
axis2_char_t* AXIS2_CALL
sandesha2_iom_rm_element_get_namespace_value(
sandesha2_iom_rm_element_t *element,
const axis2_env_t *env);
In implementation file
axis2_char_t* AXIS2_CALL
sandesha2_iom_rm_element_get_namespace_value(
sandesha2_iom_rm_element_t *element,
const axis2_env_t *env)
{
return
((sandesha2_iom_rm_element_t*)(element))->ops->get_namespace_value(
(sandesha2_iom_rm_element_t*)element, env);
}
All this took about 2 days to complete. But when I look at the cleaner
code I think it is worth
the effort. From this I guess that if we spend about two weeks we can
make similar changes
to whole of axis2c code which will lead to a more cleaner 1.0 release.
Damitha
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org
|