Please tell me this wheel is invented and ready in MINA!!

Here is the scenario taking as an example the SumUp server (the closest
thing to the case).
Let's suppose there is this project called MegaMath, which is kind of like
SumUp but has more operations:

public class MegaMathMessage {
   private byte opcode;

   MegaMathMessage(opcode) {
       this.opcode = opcode;
   }

   ...
}

public class MultiplyMessage extends MegaMathMessage {
   private byte operand0;

   MultiplyMessage()
   {
       super(Constants.MULTIPLY_OPCODE);
       ...
   }

   ...
}

public class DoSomethingReallyNiceWithThreeArguments {
   private int arg0;
   private short arg1;
   private byte arg3;

   // ... initialize with ctor etc...
}

Now that we have the variable parameter quantity messages, we could write
the decoders and encoders, but that's not nice.

So the part we are writing let's us do basically this:

   NiceEngine.register(MultiplyMessage.class);
   NiceEngine.register(SingASongMessage.class);
   NiceEngine.register(DanceMessage.class);

   MessageEncoder multiplyMessageDecoder =
NiceEngine.getDecoder("MultiplyMessage");
// classname or class can be used here.
   MessageDecoder multiplyMessageEncoder = Nice... you get the point...

Is this available?

The problem is that manually creating Decoders and Encoders is just a waste
of time. This should be a machine's work, and this is what our design is
promissing to aid us in.

We tried using Javastruct, and even devoted three full days to writing code
for it, but we came to the conclusion that we needed more and in a more
structured manner, so we started this solution.

If this is already implemented, please share some light on how to use it.

Thanks,
Rodrigo


On 7/23/07, Trustin Lee <[EMAIL PROTECTED]> wrote:

On 7/23/07, Rodrigo Madera <[EMAIL PROTECTED]> wrote:
> Hello Maarten,
>
> I'm familiar with it, thanks.
>
> The thing is that I'm in the middle of implementing some engines, and I
> don't realize the full power of the demuxer yet.
>
> I was hoping to see more info on it so I don't happen to reinvent the
wheel.

What wheel are you going to invent?  We could tell you how to
implement a certain protocol message using
DemuxingProtocolCodecFactory if you can give us the specific use case.

HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Reply via email to