I've been working the past few weeks on providing a stable API layer in Ruby on top of the swig bindings. I've made a few decisions in the design and want to now float them out here to get feedback.
You can take a look at the WIP in my Github repo [1]. NAMESPACES ========== The APIs all live within the Qpid::Proton namespace. Each major group of APIs exist within namespaces below them. For example, the Driver APIs live within Qpid::Proton::Driver, Qpid::Proton::Driver::Connector and Qpid::Proton::Driver::Listener. CLASSES VS MODULE METHODS AND CONSTANTS ======================================= All of the APIs are module-level methods in the design. There's no need to instantiate an object to work with them. You only need to pass in the object types returned by the underlying Proton C implementation. Enumerated types are represented by classes that provide a simple, consistent interface for working with symbols that have roughly the same names as the enum. For example, Qpid::Proton::Trace represents pn_trace_t, and values can be accessed using Qpid::Proton::Trace::RAW. UNIT AND FEATURE TESTING ======================== For now I've focused on writing Rspec tests to cover as many conditions as I can setup, with the goal of keeping the coverage at 100% or within 2 points. Some of the conditions aren't easy to setup, so those I'm documentingn with a note to fix them in future. For feature tests, I plan to write those using Cucumber. But I'd like to start a second conversation there since we can use Cucumber to test features across all currently supported languages (Ruby, Python, Perl, PHP, Java). Since Cucumber supports these [2] we can write one set of feature tests and ensure all implementations and bindings work as expected. Questions? Thoughts? [1] https://github.com/mcpierce/Proton/tree/Ruby-language-APIs [2] https://github.com/cucumber/cucumber/wiki/ -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/
pgpL7UdvXICvw.pgp
Description: PGP signature
