Gary Feldman wrote:
> It occurs to me that part of the learning curve problem with respect to BIOs
> (and other aspects of OpenSSL) is that they're essentially an
> object-oriented concept implemented in C.  Or to put it another way, they're
> a poor-man's polymorphism in C.

Yes, that's exactly right.  Polymorphism looks strange in C, and 
while it works fine, it definitely need explanation.  And whoever
wrote s_server.c got just a little function-pointer happy, if you
ask me...
 
> This makes me wonder whether a) perhaps a native C++ interface is in order
> (with the inherent advantages and disadvantages); 

A C++ binding might be nice.  It might be hard to share code with the C
version, at least for BIO.  This should be done way after the documentation
for the C version is brought up to snuff, though.

> and b) should
> object-oriented terminology be used in the documentation, as a pedagogical
> tool?  In other words (for the latter), perhaps the documentation should be
> along the lines of: "A BIO is essentially an abstract class, but is
> specified in C.  You can implement your own particular BIO (analogous to
> deriving an implementation class from an abstract class), by providing the
> following functions (i.e. methods).  Since this is C and not C++, you have
> to make the methods available as follows...., and you have to explicitly
> create (i.e. construct) and free (i.e. destroy)....

I believe this would be helpful.  To avoid annoying those who do not
think in C++, it could be put into a "C++ programmer's introduction
to OpenSSL"

> Note that the existing ssleay.txt already uses the term "method" but doesn't
> really make the connection to the OO concept explicit.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to