[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tsp-devel] Use of opaque types
From: |
Stephane GALLES |
Subject: |
Re: [Tsp-devel] Use of opaque types |
Date: |
Sat, 31 Mar 2007 17:10:32 +0200 |
User-agent: |
Thunderbird 1.5.0.10 (X11/20070306) |
Eric Noulard wrote:
> 2007/3/31, Robert de Vries <address@hidden>:
>> I see that the developers have used opaque types to hide the
>> implementation
>> of the structures from the end users.
>> A typical example is this:
>>
>> /** Opaque handle type for provider */
>> typedef void* TSP_provider_t;
>
> [...]
>
>>
>> The problem I currently see as that with the current scheme of opaque
>> types
>> you not only hide the type, but also the type information, and that is
>> not
>> so good.
>
> Yes your are right.
> Stephane (GALLES) did this :))
> I let him explain why with more detail.
>
> I think we was "only wanting" to ease future changes,
> The fact is it has been more painful that useful.
> We discovered those drawbacks during our 5 years of TSP usage.
>
> The initial TSP base code (src/core mainly) was done in 2002
> and we discovered from time to time that the code needs
> to be refactored and some parts have already been
> almost fully rewritten.
>
> We should make changes smoothly
> in order to keep backward compatibility
> and your suggestion is a good one.
>
>
Yes, this turned out to be a bad idea. I started to code the
prototype with opaque types because I wanted the pointers
to looks like handlers.
This definitely was a typical premature optimisation of the API
that was not justified by any functionnal need.
I agree, this should be modified.
Stephane.