Re: [PATCH 4/6] Serialize all properties



On Fri, 2010-05-28 at 11:15 +0200, Víctor M. Jáquez L. wrote:
> > -grl_media_serialize (GrlMedia *media)
> > +grl_media_serialize (GrlMedia *media,
> > +                     gboolean full)
> 
> Why not keep grl_media_serialize() which would be a wrapper of a
> grl_media_serialize_ex() 

Are you meaning having two serialization functions,
grl_media_serialize() and grl_media_serialize_extended(), instead of one
using the "full" parameter?

If so, then I had already considered about it, but then I thought it was
better having one function.

If in future we need to add more ways of serializing it, then seems more
easy to refactor them and replace the gboolean by an "enum
serialize_type", than adding more functions.

And if serialization type depends on a variable, seems easier to use:

   full = has_variable_right_value
   grl_media_serialize (media, full)


than:

   if has_variable_right_value
     grl_media_serialize (media)
   else
     grl_media_serialize_ex(media)

	J.A.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]