On Fri, 2007-06-29 at 09:21 +0200, Arnaud Simon wrote:
> Hi,
> 
> I have attached a design document (I hope Rupert will be pleased :)).

Excellent doc. The color coded stack is great, and looks very like how I
envision the C++ stack.

On the multi-protocol-broker issue: It is possible to map between Basic
messages and Message messages as they have almost identical fields (but
in very different places.) The C++ broker does it, it supports both
Basic and Message classes over 0-9 framing. It was a big pain to do.

The other key to multi-version is the separation of the model layer (top
box in Arnauds diagram) from the rest of the framing stack. In C++ the
model layer maps AMQP class/method to C++ class method, I imagine java
does similar. So e.g.

namespace amqp0_9 {
class QueueOperations {...} // generated.

class QueueImpl : public QueueOperations {
  void declare(Ticket, Exchange, .. bool nowait) { do stuff }
};

namespace amqp0_10 {
 class QueueOperations { ... } // generated
 class QueueImpl : public QueueOperations { 
   // Removed nowait.
   void declare(Ticket t, ...) { queue09.declare(t, ..., false); }
   private: 
     amqp0_9::QueueImpl queue09;
  }
};

Note that the classes in different versions are *not* related by
inheritance, as inheritance (in c++ and java at least) does not support
addition, removal and modification of methods in a useful way. However
the logic from the previous version can be re-used via delegation or the
new version can redefine method entirely as appropriate.
 
Cheers,
Alan.

Reply via email to