Hi all,

As damitha has done to sandesha, If we can get rid of unneccesary OO code in
axis2c core, the code would get much cleaner and small. In addition to that
we can  remove some amount of memory leaks in the process because
the memory allocations done for ops structures will be reduced.

+1 for removing unnecessary OO code.

Thanks
Nandika


On 11/10/06, Damitha Kumarage <[EMAIL PROTECTED]> wrote:
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to