Damitha Kumarage wrote:

> 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.

   I don't know if this was related to my comments in 
http://marc.theaimsgroup.com/?l=axis-c-dev&m=116259914508051&w=2
but it sounds like it might be a big step in that direction.  Looking at
some random diffs in svn I'd have to say that looks a lot cleaner to me:

http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_create_seq.h?r1=437066&r2=472834&diff_format=h
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/seq_mgr.c?r1=472834&r2=473292&diff_format=h

Nice job!  (Now, if only I used Sandesha2 ... but I may someday!  :-)

Chris.

-- 
GPG Key ID: 366A375B
GPG Key Fingerprint: 485E 5041 17E1 E2BB C263  E4DE C8E3 FA36 366A 375B


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to