> Ok, this is acceptable.

Well, I'll have a stab at it and see how it goes.

As for DLL:s, they are not strictly necessary to make the ABC useful.
Applications can still have their own, application-specific,
connectors linked in.

I would suggest putting the the standard connectors into libwt, and
then optionally search a path for DLL:s. A reasonable default path
would be

        the directory where the application resides
        the directory where libwt.so resides

Such shared libraries should, I think, have a prefix:

           wt-connector-fcgi.so
           wt-connector-http.so

In C++, connectors can be registered something like this:

     class ConnectorFactories {
       public:
         typedef WServer *(*Factory)(parameters...);
         void register_factory(string name, Factory *f);
         Factory *find(string name);
     }

   and in each WServer implementation

     static FcgiServer *fcgiConnectorFactory(parameters...) { return new ... }

     static class FcgiConnectorRegistrant { // class name must be unique or 
MSVC will fail
         FcgiConnectorRegistrant() {
             ConnectorFactories::register_factory("fcgi", fcgiConnectorFactory);
         }
     } fcgiConnectorRegistrant;

The FcgiConnectorRegistrant is just a roundabout way of calling
ConnectorFactories::register_factory. Note that no symbols need to be exported, 
so
everything can be declared static to avoid cluttering up the global namespace.

Care must be taken when implementing ConnectorFactories, as we can not be sure
that a global instance of ConnectorFactories will be initialized before
the registrants.

This was inspired by http://www.linuxjournal.com/article/3687.

Regards
/Lars Hamrén

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have 
the opportunity to enter the BlackBerry Developer Challenge. See full prize 
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to