[sugar] [PATCH] (partial) AP palette patch

Marco Pesenti Gritti mpgritti at gmail.com
Thu Apr 10 04:32:17 EDT 2008


If I remember correctly icon is a a Palette property so why not just
access it through the property...

Marco

On Thu, Apr 10, 2008 at 9:31 AM, Tomeu Vizoso <tomeu at tomeuvizoso.net> wrote:
> On Thu, Apr 10, 2008 at 12:53 AM, Eben Eliason <eben.eliason at gmail.com> wrote:
>  >  >  What do you mean here?
>  >  >  +            self.props.icon_name = icon_name
>  >  >  +            # This breaks style guidelines; we should store a reference
>  >  >  +            self._palette._icon.props.icon_name = icon_name
>  >
>  >  I'm accessing the private _icon member of the palette class, rather
>  >  than keeping a reference to it to use for this purpose.  It was a
>  >  quick hack.
>
>  This is not breaking style guidelines, but encapsulation, which is a
>  basic concept when designing object-oriented APIs.
>
>  Related links:
>
>  http://en.wikipedia.org/wiki/Information_hiding
>  http://en.wikipedia.org/wiki/Separation_of_concerns
>  http://en.wikipedia.org/wiki/Cohesion_%28computer_science%29
>  http://en.wikipedia.org/wiki/Coupling_%28computer_science%29
>
>  I think we should only push hacks like this to master repositories in
>  cases of emergency when refactoring is not an option (very close to
>  release date).
>
>  Also, if you have felt the need to do such a thing, means that our API
>  has a problem somewhere that should be solved ASAP.
>
>  Tomeu
>
>
> _______________________________________________
>  Sugar mailing list
>  Sugar at lists.laptop.org
>  http://lists.laptop.org/listinfo/sugar
>


More information about the Sugar mailing list