Skip to content

Resolve the problem of using external components #20

Closed

Description

@glynos

This is especially important to resolve before submitting my XMPP client.

XMPP requires an XML parser, and various other components for security and authentication. It definitely falls outside the scope of our little project to rewrite the world and, in the case of some algorithms for cryptography, may violate the Boost license. So, it's necessary to define a policy for including such code in cpp-netlib or allowing the library to be extended to use such code.

First, it seems evident in our case that this can be partly done by deferring these to traits, so in the case of XML parsers we have:

namespace boost { namespace network { namespace traits {
template <
    class Tag
    >
struct xml_parser; // etc.
}}}

But where to put the parser code? So far, I've put things in the top level directory:

boost/network/xml/... (expat, libxml2)
boost/network/tls/... (gnutls)
boost/network/auth/...

but I don't think this is appropriate. Putting it in a subdirectory might be better:

boost/network/ext/xml/...

I would rule out "detail" because these aren't implementation details and may appear in the interface.

The questions to answer are therefore:

  1. What is the best strategy for reusing 3rd party components?
  2. Assuming that we write wrappers around every components, where do they belong in our directory structure?
  3. How well does our Tag approach scale?

I think the XMPP client might be the first real test of the true extensibility of the Tag approach this project is taking.

Activity

  1. glynos commented on Oct 19, 2010

    @glynos
    MemberAuthor
    1. gnutls is released under LGPL so I think we can still use it. Am I right in thinking that we can't distribute anything that uses GPL, but that doesn't stop users of cpp-netlib from writing such code?
    2. One problem I'm trying to solve here is that a lot of this 3rd party code is going to be reused across different protocols, so we'd need a subdirectory in the top level directory, such as boost/network/ext/ or boost/network/external/
    3. I'd include a big compile-time hit under the "not scaling well" header. This could be a reason against adoption.
  2. deanberris commented on Aug 4, 2011

    @deanberris
    Member

    Just to update this discussion, now that cpp-netlib is not strictly header-only anymore, I think we have some leeway with getting some of the implementation parts moved out into linked-in modules. I'm no longer dogmatic on the header-only idea, but will still strive to get as much of the library implemented in a header-only fashion and where it's practical to do so.

    Right now I'm thinking about allowing the HTTP implementation details that can be updated without causing a recompile of the client code. I think this will increase the likelihood that cpp-netlib would actually be useful in situations where being able to upgrade without recompilation is concerned.

    Thoughts?

  3. glynos commented on Aug 4, 2011

    @glynos
    MemberAuthor

    I think this is important. Many of the issues reported on the ML describe problems upgrading different versions of cpp-netlib and watching it fail in different ways with different versions of boost. Consequently, I think we should test this with at least the latest stable version of boost, but probably also previous stable versions.

  4. deanberris commented on Aug 5, 2011

    @deanberris
    Member

    Now that I think about it a little more, I think we ought to have a long-running effort to move implementations into non-header only versions and just have a flag to determine whether to use the library in header-only mode. This will help a lot with the compile times and with deployment.

    I'll deal with the Boost acceptability issues later on if/when they come up.

  5. glynos commented on Jun 19, 2013

    @glynos
    MemberAuthor

    No longer relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions