Le 29/04/2013 04:21, Gary Gregory a écrit :

> Upon reflection, it seems overly restrictive (thanks to Java) to have one
> encoding or decoding type per class. What should be the alternative for a
> nice OO design?

Just a wild guess, but would a builder pattern be suitable for codec?

Maybe something like:

Encoder<String, byte[]> encoder = new
EncoderBuilder().in(String.class).out(byte[].class).type(HEX).create();

encoder.encode(s, buffer);


Emmanuel Bourg


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to