[VSDK] SetCompareFunction()

Eric Forget forgete at cafederic.com
Sat Nov 15 12:02:32 CST 2003


Ruslan,

Ok, this is my last one on that subject.

> Oh, Eric, I think we better make DIRECT wrapper of
>   Java around C++ kernel

That's not allowed. You have to go with C for most of the languages that I
mentioned anyway, except for Python and Objective-C, I think. C is the
lingua franca for the binding between all languages.

> Instead of 
>   Java  around  ---  C framework around ---- C++ kernel
> 
> It will be quite not effective, in C framework catch C++ exceptions, convert
> them into error codes, then on top level again convert them to exception...

That's what you call encapsulation. This is one on the basis of O-O design.
You don't want to export all internal exceptions to the outside.

One example, if you use STL and you have a buffer overflow in the kernel. It
should be exported as an internal kernel error. If not, it becomes a
nightmare for the user of your library: the list of exported exception might
be very big and all should be managed with correct error message for the end
user.

> Again, I agree with you that there is BIG SENSE provide C SDK framework,
> To follow Apple standard way.

This is not Apple standard way, this shared library standard way. Even
Microsoft is doing the same thing. And when it really needs to provide a C++
API, like MFC, it created a lot of DLL, one for each versions.

> for example in Valentina 2.0 we have about 50 (!!!) Interface classes.

I Just hope you didn't the error of having 1 class for each type instead of
using templates...

Finally, if you really want to continue the way you do, stop creating
DLL/framework: just create .lib. DLL/framework are useful only if they can
be used between applications and be placed at standard places. Yours cannot
be placed at standard places because of conflicts between different third
parties. This is just give a false sense of security, which is very bad. If
you recall, this is where all this discussion started from. Arthur,
suggested to place the framework in /Library/Frameworks/, something that
should be definitively avoided.

Cheers,

Éric 
___________________________________________________________________

 Eric Forget                       Cafederic
 ForgetE at cafederic.com             <http://www.cafederic.com/>

 Fingerprint <86D5 38F5 E1FD 5D9C 71C3  BAA3 797E 70A4 6210 C684>




More information about the Valentina mailing list