>> but if we do a macro that counts the number of parameters and if no
>> class is given it would assume the default class (base), that's easier
>> to use.
>>
>
> I'm a bit worried about the naming scheme for those macros, as they would
> then have to merge a full method name (eg. my_first_class_func) and the
> implementing class name (eg. my_other_class). I honestly didn't really
> think of this idea as very neat because of this ;) But maybe you have a
> good idea?
well, I'd suggest to skip the first name, just the second:
my_other_class_func()
Example:
a_create()
b_create()
but maybe we'll have to live with C nasty bits... after all look at this:
dialer = efl_add(EFL_NET_DIALER_HTTP_CLASS, loop,
efl_name_set(efl_added, "dialer"),
efl_net_dialer_http_method_set(efl_added, method),
efl_net_dialer_http_primary_mode_set(efl_added,
primary_mode),
efl_net_dialer_http_version_set(efl_added, http_version),
efl_net_dialer_http_authentication_set(efl_added,
username, password, authentication_method, authentication_restricted),
efl_net_dialer_http_allow_redirects_set(efl_added,
allow_redirects),
efl_net_dialer_http_cookie_jar_set(efl_added, cookie_jar),
efl_net_dialer_proxy_set(efl_added, proxy),
efl_net_dialer_timeout_dial_set(efl_added, timeout_dial),
efl_event_callback_array_add(efl_added,
dialer_cbs(), NULL));
Where not only you have to replicate the namespace multiple times, you
also have to resolve the method yourself (note:
efl_net_dialer_proxy_set() is in the base class, while others are in
the specific class. Not to say the replication of "efl_added, "
At first I found that Gobject's name-as-string was bad, but looking at
this it does help usability at the expense of string lookups and lack
of compile-time errors due typos and incorrect types:
dialer = g_object_new(cls, "method", method, "proxy", proxy...);
which is closer to high level bindings, I'd expect in Python it to be:
dialer = Efl.Net.Dialer.Http(method=method, proxy=proxy...)
> As you may know I've used such a factory for input events, and the syntax
> is a bit crappy (but it returns the private data, which is convenient for
> internal code).
That private data thing did annoy me, but I didn't look into much
detail how we could fix that.
In Ef.Net I use some @protected methods only meant at subclasses to
override behavior... maybe that could work there?
--
Gustavo Sverzut Barbieri
--------------------------------------
Mobile: +55 (16) 99354-9890
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel