Re: Pluggable widgets II
- From: "Kalle Vahlman" <kalle vahlman gmail com>
- To: "Tim Janik" <timj imendio com>
- Cc: Gtk+ Developers <gtk-devel-list gnome org>
- Subject: Re: Pluggable widgets II
- Date: Tue, 19 Dec 2006 22:14:03 +0200
2006/12/19, Tim Janik <timj imendio com>:
- g_object_factory_ was suggested as namespace for this factory. that'd be
technically correct because the API is supposed to only create GObject
derived types, however g_object_factory_ is significantly longer and i
think we can be pretty certain to not need other fundamental object types
in libgobject any time soon, so picking g_factory_ isn't too risky.
What about other factories? It's always sucky to have The foo after
you come up with the idea that this other foo which does baz instead
of bar would be handy too. Then you really wish you had named The
foo as foo_bar so now the API would have more clarity ("foo_baz is for
baz? What's for bar then? Just foo? Why on earth..?").
Besides, breaking so far uniform API (I think?) to manipulate GObjects
just to save characters sounds like a bad policy to me. At least the
proposed API calls are not gigantic by any standard.
- g_factory_new (type, ...) was suggested to create objects instead of
g_factory_create (type, ...). i think that naming is too similar to
naming a factory constructor and suggested that a factory is created.
to avoid that impression, i personally prefer g_factory_create().
This I agree with strongly.
 I speak from experience with the issue. I named ScwView simply
"view" and now that I want to add another viewing widget, it's silly
to have a view and then "the other view"...
 Example API is fictive. Any resemblance to actual API calls is
P.S. This all sounds very much like GStreamer, which opens up some
interesting paths to walk for the little grey cells :)
Kalle Vahlman, zuh iki fi
Powered by http://movial.fi
Interesting stuff at http://syslog.movial.fi
] [Thread Prev