Re: Pluggable widgets II

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[1] 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..?")[2].

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.

[1] 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"...

[2] Example API is fictive. Any resemblance to actual API calls is
purely coincidal.

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
Interesting stuff at

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