[jira] [Commented] (CODEC-158) Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder and decoder

2013-02-26 Thread Mirko Raner (JIRA)

[ 
https://issues.apache.org/jira/browse/CODEC-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13587495#comment-13587495
 ] 

Mirko Raner commented on CODEC-158:
---

It seems like everybody had a chance to voice their opinion on this feature 
now. I'm not too familiar with how decisions are made at Apache Commons, so my 
next question is how we drive this forward. I'm happy to accept any outcome 
here, but to me it seems that this issue has been in limbo for long enough now.
Is there any other information I can provide to resolve this?

 Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder 
 and decoder
 ---

 Key: CODEC-158
 URL: https://issues.apache.org/jira/browse/CODEC-158
 Project: Commons Codec
  Issue Type: Improvement
Affects Versions: 1.7
Reporter: Mirko Raner
Priority: Minor
 Attachments: CODEC-158.patch, CODEC-158.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 Currently, there are no common interfaces that extend both the encoder and 
 the decoder interfaces. This makes it hard to deal with a codec as a single 
 entity and requires separate treatment of encoder and decoder parts.
 For example, let's say you want to develop a storage abstraction that uses an 
 encoding. Right now, you would need to write
 class Storage
 {
 @Inject Encoder encoder;
 @Inject Decoder decoder;
 //...
 }
 In practice, encoder and decoder need to match, and most likely both encoder 
 and decoder would be bound to the same implementation, like Base64 or 
 URLCodec. Because of the lack of a common superinterface they need to be 
 specified separately. There are some classes like BaseNCodec that can be used 
 to unify some of the encoders and decoders, but they are too specific and 
 restrictive.
 Ideally, I would like to write:
 class Storage
 {
 @Inject Codec codec;
 //...
 }
 Assuming that combined encoder/decoder classes like Base64 would implement 
 that Codec interface, this could be directly bound to a combined 
 encoder/decoder implementation.
 It would be nice if these interfaces were added and the existing codec 
 classes (BaseNCodec, Hex, QCodec, QuotedPrintableCodec, URLCodec) could be 
 modified to implement these new interfaces.
 I'm happy to contribute a patch if there is interest in this feature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CODEC-158) Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder and decoder

2013-02-26 Thread Gary Gregory (JIRA)

[ 
https://issues.apache.org/jira/browse/CODEC-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13587506#comment-13587506
 ] 

Gary Gregory commented on CODEC-158:


For me, fiddling with interfaces should be done in the context of dealing with 
generics. It does not have to be that way of course, that's my opinion, but I 
think that rejiggering the interfaces will make adding generics later more 
painful. I could be wrong ;)

Please see the branch I created here: 
https://svn.apache.org/repos/asf/commons/proper/codec/branches/generics

 Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder 
 and decoder
 ---

 Key: CODEC-158
 URL: https://issues.apache.org/jira/browse/CODEC-158
 Project: Commons Codec
  Issue Type: Improvement
Affects Versions: 1.7
Reporter: Mirko Raner
Priority: Minor
 Attachments: CODEC-158.patch, CODEC-158.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 Currently, there are no common interfaces that extend both the encoder and 
 the decoder interfaces. This makes it hard to deal with a codec as a single 
 entity and requires separate treatment of encoder and decoder parts.
 For example, let's say you want to develop a storage abstraction that uses an 
 encoding. Right now, you would need to write
 class Storage
 {
 @Inject Encoder encoder;
 @Inject Decoder decoder;
 //...
 }
 In practice, encoder and decoder need to match, and most likely both encoder 
 and decoder would be bound to the same implementation, like Base64 or 
 URLCodec. Because of the lack of a common superinterface they need to be 
 specified separately. There are some classes like BaseNCodec that can be used 
 to unify some of the encoders and decoders, but they are too specific and 
 restrictive.
 Ideally, I would like to write:
 class Storage
 {
 @Inject Codec codec;
 //...
 }
 Assuming that combined encoder/decoder classes like Base64 would implement 
 that Codec interface, this could be directly bound to a combined 
 encoder/decoder implementation.
 It would be nice if these interfaces were added and the existing codec 
 classes (BaseNCodec, Hex, QCodec, QuotedPrintableCodec, URLCodec) could be 
 modified to implement these new interfaces.
 I'm happy to contribute a patch if there is interest in this feature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CODEC-158) Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder and decoder

2013-02-26 Thread Gary Gregory (JIRA)

[ 
https://issues.apache.org/jira/browse/CODEC-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13587505#comment-13587505
 ] 

Gary Gregory commented on CODEC-158:


For me, fiddling with interfaces should be done in the context of dealing with 
generics. It does not have to be that way of course, that's my opinion, but I 
think that rejiggering the interfaces will make adding generics later more 
painful. I could be wrong ;)

Please see the branch I created here: 
https://svn.apache.org/repos/asf/commons/proper/codec/branches/generics

 Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder 
 and decoder
 ---

 Key: CODEC-158
 URL: https://issues.apache.org/jira/browse/CODEC-158
 Project: Commons Codec
  Issue Type: Improvement
Affects Versions: 1.7
Reporter: Mirko Raner
Priority: Minor
 Attachments: CODEC-158.patch, CODEC-158.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 Currently, there are no common interfaces that extend both the encoder and 
 the decoder interfaces. This makes it hard to deal with a codec as a single 
 entity and requires separate treatment of encoder and decoder parts.
 For example, let's say you want to develop a storage abstraction that uses an 
 encoding. Right now, you would need to write
 class Storage
 {
 @Inject Encoder encoder;
 @Inject Decoder decoder;
 //...
 }
 In practice, encoder and decoder need to match, and most likely both encoder 
 and decoder would be bound to the same implementation, like Base64 or 
 URLCodec. Because of the lack of a common superinterface they need to be 
 specified separately. There are some classes like BaseNCodec that can be used 
 to unify some of the encoders and decoders, but they are too specific and 
 restrictive.
 Ideally, I would like to write:
 class Storage
 {
 @Inject Codec codec;
 //...
 }
 Assuming that combined encoder/decoder classes like Base64 would implement 
 that Codec interface, this could be directly bound to a combined 
 encoder/decoder implementation.
 It would be nice if these interfaces were added and the existing codec 
 classes (BaseNCodec, Hex, QCodec, QuotedPrintableCodec, URLCodec) could be 
 modified to implement these new interfaces.
 I'm happy to contribute a patch if there is interest in this feature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CODEC-158) Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder and decoder

2013-01-30 Thread Mirko Raner (JIRA)

[ 
https://issues.apache.org/jira/browse/CODEC-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13566287#comment-13566287
 ] 

Mirko Raner commented on CODEC-158:
---

Introducing a common interface for encoder/decoder and converting the existing 
hierarchy to generics are orthogonal issues, in my view. As such, I propose to 
solve them separately and not intermix these two issues.

A common superinterface for encoders and decoders is useful with and without 
generics, and, as far as I can see, it does not impede the introduction of 
generics at a later point.

CODEC-158 is strictly about the common superinterface for encoders and 
decoders. I agree that, going forward, genericized encoders/decoders would be 
extremely useful, but we should discuss this as a separate issue.


 Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder 
 and decoder
 ---

 Key: CODEC-158
 URL: https://issues.apache.org/jira/browse/CODEC-158
 Project: Commons Codec
  Issue Type: Improvement
Affects Versions: 1.7
Reporter: Mirko Raner
Priority: Minor
 Attachments: CODEC-158.patch, CODEC-158.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 Currently, there are no common interfaces that extend both the encoder and 
 the decoder interfaces. This makes it hard to deal with a codec as a single 
 entity and requires separate treatment of encoder and decoder parts.
 For example, let's say you want to develop a storage abstraction that uses an 
 encoding. Right now, you would need to write
 class Storage
 {
 @Inject Encoder encoder;
 @Inject Decoder decoder;
 //...
 }
 In practice, encoder and decoder need to match, and most likely both encoder 
 and decoder would be bound to the same implementation, like Base64 or 
 URLCodec. Because of the lack of a common superinterface they need to be 
 specified separately. There are some classes like BaseNCodec that can be used 
 to unify some of the encoders and decoders, but they are too specific and 
 restrictive.
 Ideally, I would like to write:
 class Storage
 {
 @Inject Codec codec;
 //...
 }
 Assuming that combined encoder/decoder classes like Base64 would implement 
 that Codec interface, this could be directly bound to a combined 
 encoder/decoder implementation.
 It would be nice if these interfaces were added and the existing codec 
 classes (BaseNCodec, Hex, QCodec, QuotedPrintableCodec, URLCodec) could be 
 modified to implement these new interfaces.
 I'm happy to contribute a patch if there is interest in this feature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CODEC-158) Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder and decoder

2013-01-29 Thread Gary Gregory (JIRA)

[ 
https://issues.apache.org/jira/browse/CODEC-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13566162#comment-13566162
 ] 

Gary Gregory commented on CODEC-158:


I'd like to see any new interface work involve generics. So instead of adding 
more typeless interfaces that would make 2.0 more difficult as a target for 
porting or compatibility.

For example an Encoder interface would have two types input and output: 
EncoderI, O, same for a Decoder interface. EncoderI,O would implement O 
encode(I input).

We could then have a symmetric Encoder and Decoder interface, ones where the 
I and O are the same: SymetricEncoderT extends EncoderT,T.

Then a CodecI,O interface would extend both Encoder and Decoder.

The problem today is that because of type erasure and if we had generics, we 
cannot end up with more than more encode() method. See the generics branch I 
created for a generics implementation of [codec].

So I'd like to talk about how to solve the generics issue and then backtrack to 
how this could be back-ported to 1.x in a forward compatible manner if at all 
possible, I am guessing not though.

 Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder 
 and decoder
 ---

 Key: CODEC-158
 URL: https://issues.apache.org/jira/browse/CODEC-158
 Project: Commons Codec
  Issue Type: Improvement
Affects Versions: 1.7
Reporter: Mirko Raner
Priority: Minor
 Attachments: CODEC-158.patch, CODEC-158.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 Currently, there are no common interfaces that extend both the encoder and 
 the decoder interfaces. This makes it hard to deal with a codec as a single 
 entity and requires separate treatment of encoder and decoder parts.
 For example, let's say you want to develop a storage abstraction that uses an 
 encoding. Right now, you would need to write
 class Storage
 {
 @Inject Encoder encoder;
 @Inject Decoder decoder;
 //...
 }
 In practice, encoder and decoder need to match, and most likely both encoder 
 and decoder would be bound to the same implementation, like Base64 or 
 URLCodec. Because of the lack of a common superinterface they need to be 
 specified separately. There are some classes like BaseNCodec that can be used 
 to unify some of the encoders and decoders, but they are too specific and 
 restrictive.
 Ideally, I would like to write:
 class Storage
 {
 @Inject Codec codec;
 //...
 }
 Assuming that combined encoder/decoder classes like Base64 would implement 
 that Codec interface, this could be directly bound to a combined 
 encoder/decoder implementation.
 It would be nice if these interfaces were added and the existing codec 
 classes (BaseNCodec, Hex, QCodec, QuotedPrintableCodec, URLCodec) could be 
 modified to implement these new interfaces.
 I'm happy to contribute a patch if there is interest in this feature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CODEC-158) Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder and decoder

2013-01-19 Thread Thomas Neidhart (JIRA)

[ 
https://issues.apache.org/jira/browse/CODEC-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13558006#comment-13558006
 ] 

Thomas Neidhart commented on CODEC-158:
---

I am in favor of integrating this change as it makes sense and is quite useful 
as Mirko pointed out in his example.
Regarding the name, what do you think of the following:

 * [Binary, String]Coder
 * [Binary, String]Endec (see http://en.wikipedia.org/wiki/Endec)

 Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder 
 and decoder
 ---

 Key: CODEC-158
 URL: https://issues.apache.org/jira/browse/CODEC-158
 Project: Commons Codec
  Issue Type: Improvement
Affects Versions: 1.7
Reporter: Mirko Raner
Priority: Minor
 Attachments: CODEC-158.patch, CODEC-158.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 Currently, there are no common interfaces that extend both the encoder and 
 the decoder interfaces. This makes it hard to deal with a codec as a single 
 entity and requires separate treatment of encoder and decoder parts.
 For example, let's say you want to develop a storage abstraction that uses an 
 encoding. Right now, you would need to write
 class Storage
 {
 @Inject Encoder encoder;
 @Inject Decoder decoder;
 //...
 }
 In practice, encoder and decoder need to match, and most likely both encoder 
 and decoder would be bound to the same implementation, like Base64 or 
 URLCodec. Because of the lack of a common superinterface they need to be 
 specified separately. There are some classes like BaseNCodec that can be used 
 to unify some of the encoders and decoders, but they are too specific and 
 restrictive.
 Ideally, I would like to write:
 class Storage
 {
 @Inject Codec codec;
 //...
 }
 Assuming that combined encoder/decoder classes like Base64 would implement 
 that Codec interface, this could be directly bound to a combined 
 encoder/decoder implementation.
 It would be nice if these interfaces were added and the existing codec 
 classes (BaseNCodec, Hex, QCodec, QuotedPrintableCodec, URLCodec) could be 
 modified to implement these new interfaces.
 I'm happy to contribute a patch if there is interest in this feature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CODEC-158) Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder and decoder

2013-01-19 Thread Gary Gregory (JIRA)

[ 
https://issues.apache.org/jira/browse/CODEC-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13558101#comment-13558101
 ] 

Gary Gregory commented on CODEC-158:


I am not in favor, please see my previous comments. 

 Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder 
 and decoder
 ---

 Key: CODEC-158
 URL: https://issues.apache.org/jira/browse/CODEC-158
 Project: Commons Codec
  Issue Type: Improvement
Affects Versions: 1.7
Reporter: Mirko Raner
Priority: Minor
 Attachments: CODEC-158.patch, CODEC-158.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 Currently, there are no common interfaces that extend both the encoder and 
 the decoder interfaces. This makes it hard to deal with a codec as a single 
 entity and requires separate treatment of encoder and decoder parts.
 For example, let's say you want to develop a storage abstraction that uses an 
 encoding. Right now, you would need to write
 class Storage
 {
 @Inject Encoder encoder;
 @Inject Decoder decoder;
 //...
 }
 In practice, encoder and decoder need to match, and most likely both encoder 
 and decoder would be bound to the same implementation, like Base64 or 
 URLCodec. Because of the lack of a common superinterface they need to be 
 specified separately. There are some classes like BaseNCodec that can be used 
 to unify some of the encoders and decoders, but they are too specific and 
 restrictive.
 Ideally, I would like to write:
 class Storage
 {
 @Inject Codec codec;
 //...
 }
 Assuming that combined encoder/decoder classes like Base64 would implement 
 that Codec interface, this could be directly bound to a combined 
 encoder/decoder implementation.
 It would be nice if these interfaces were added and the existing codec 
 classes (BaseNCodec, Hex, QCodec, QuotedPrintableCodec, URLCodec) could be 
 modified to implement these new interfaces.
 I'm happy to contribute a patch if there is interest in this feature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CODEC-158) Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder and decoder

2013-01-19 Thread Sebb (JIRA)

[ 
https://issues.apache.org/jira/browse/CODEC-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13558114#comment-13558114
 ] 

Sebb commented on CODEC-158:


@Gary Please explain how the addition of these interfaces would make it harder 
to add generics?

 Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder 
 and decoder
 ---

 Key: CODEC-158
 URL: https://issues.apache.org/jira/browse/CODEC-158
 Project: Commons Codec
  Issue Type: Improvement
Affects Versions: 1.7
Reporter: Mirko Raner
Priority: Minor
 Attachments: CODEC-158.patch, CODEC-158.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 Currently, there are no common interfaces that extend both the encoder and 
 the decoder interfaces. This makes it hard to deal with a codec as a single 
 entity and requires separate treatment of encoder and decoder parts.
 For example, let's say you want to develop a storage abstraction that uses an 
 encoding. Right now, you would need to write
 class Storage
 {
 @Inject Encoder encoder;
 @Inject Decoder decoder;
 //...
 }
 In practice, encoder and decoder need to match, and most likely both encoder 
 and decoder would be bound to the same implementation, like Base64 or 
 URLCodec. Because of the lack of a common superinterface they need to be 
 specified separately. There are some classes like BaseNCodec that can be used 
 to unify some of the encoders and decoders, but they are too specific and 
 restrictive.
 Ideally, I would like to write:
 class Storage
 {
 @Inject Codec codec;
 //...
 }
 Assuming that combined encoder/decoder classes like Base64 would implement 
 that Codec interface, this could be directly bound to a combined 
 encoder/decoder implementation.
 It would be nice if these interfaces were added and the existing codec 
 classes (BaseNCodec, Hex, QCodec, QuotedPrintableCodec, URLCodec) could be 
 modified to implement these new interfaces.
 I'm happy to contribute a patch if there is interest in this feature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CODEC-158) Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder and decoder

2012-10-26 Thread Mirko Raner (JIRA)

[ 
https://issues.apache.org/jira/browse/CODEC-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13484759#comment-13484759
 ] 

Mirko Raner commented on CODEC-158:
---

Hi Sebb,

I haven't seen any activity on this issue in a while.
Are there further improvements or changes you would like me to make, or is the 
patch ready to be committed?

Thanks,

Mirko


 Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder 
 and decoder
 ---

 Key: CODEC-158
 URL: https://issues.apache.org/jira/browse/CODEC-158
 Project: Commons Codec
  Issue Type: Improvement
Affects Versions: 1.7
Reporter: Mirko Raner
Priority: Minor
 Attachments: CODEC-158.patch, CODEC-158.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 Currently, there are no common interfaces that extend both the encoder and 
 the decoder interfaces. This makes it hard to deal with a codec as a single 
 entity and requires separate treatment of encoder and decoder parts.
 For example, let's say you want to develop a storage abstraction that uses an 
 encoding. Right now, you would need to write
 class Storage
 {
 @Inject Encoder encoder;
 @Inject Decoder decoder;
 //...
 }
 In practice, encoder and decoder need to match, and most likely both encoder 
 and decoder would be bound to the same implementation, like Base64 or 
 URLCodec. Because of the lack of a common superinterface they need to be 
 specified separately. There are some classes like BaseNCodec that can be used 
 to unify some of the encoders and decoders, but they are too specific and 
 restrictive.
 Ideally, I would like to write:
 class Storage
 {
 @Inject Codec codec;
 //...
 }
 Assuming that combined encoder/decoder classes like Base64 would implement 
 that Codec interface, this could be directly bound to a combined 
 encoder/decoder implementation.
 It would be nice if these interfaces were added and the existing codec 
 classes (BaseNCodec, Hex, QCodec, QuotedPrintableCodec, URLCodec) could be 
 modified to implement these new interfaces.
 I'm happy to contribute a patch if there is interest in this feature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CODEC-158) Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder and decoder

2012-10-16 Thread Mirko Raner (JIRA)

[ 
https://issues.apache.org/jira/browse/CODEC-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13477611#comment-13477611
 ] 

Mirko Raner commented on CODEC-158:
---

Can someone integrate this patch?
Please let me know if you have any further suggestions how we can improve this 
contribution.


 Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder 
 and decoder
 ---

 Key: CODEC-158
 URL: https://issues.apache.org/jira/browse/CODEC-158
 Project: Commons Codec
  Issue Type: Improvement
Affects Versions: 1.7
Reporter: Mirko Raner
Priority: Minor
 Attachments: CODEC-158.patch, CODEC-158.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 Currently, there are no common interfaces that extend both the encoder and 
 the decoder interfaces. This makes it hard to deal with a codec as a single 
 entity and requires separate treatment of encoder and decoder parts.
 For example, let's say you want to develop a storage abstraction that uses an 
 encoding. Right now, you would need to write
 class Storage
 {
 @Inject Encoder encoder;
 @Inject Decoder decoder;
 //...
 }
 In practice, encoder and decoder need to match, and most likely both encoder 
 and decoder would be bound to the same implementation, like Base64 or 
 URLCodec. Because of the lack of a common superinterface they need to be 
 specified separately. There are some classes like BaseNCodec that can be used 
 to unify some of the encoders and decoders, but they are too specific and 
 restrictive.
 Ideally, I would like to write:
 class Storage
 {
 @Inject Codec codec;
 //...
 }
 Assuming that combined encoder/decoder classes like Base64 would implement 
 that Codec interface, this could be directly bound to a combined 
 encoder/decoder implementation.
 It would be nice if these interfaces were added and the existing codec 
 classes (BaseNCodec, Hex, QCodec, QuotedPrintableCodec, URLCodec) could be 
 modified to implement these new interfaces.
 I'm happy to contribute a patch if there is interest in this feature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CODEC-158) Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder and decoder

2012-10-04 Thread Mirko Raner (JIRA)

[ 
https://issues.apache.org/jira/browse/CODEC-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13469207#comment-13469207
 ] 

Mirko Raner commented on CODEC-158:
---

Correct, binary compatibility will not be affected.
Regarding the duplicate BinaryCodec class, here are some alternative names 
(sorted according to my own preferences, most preferred one first):

- BinCodec (consistent with Codec suffix but breaks naming scheme related to 
its encoder/decoder)
- BinaryEncoderDecoder (breaks Codec suffix scheme, but consistent with regards 
to the prefix)
- CommonBinaryCodec
- IBinaryCodec (uses 'I' prefix for interface, which is not really used by 
Apache Commons)

I'm open to any other suggestions as well.
The two additional alternatives that come to mind are (1) rename 
org.apache.commons.codec.binary.BinaryCodec (a breaking API change; probably 
not a good idea), and (2) remove the BinaryCodec interface without a 
replacement (essentially trading in functionality for clarity).

Please let me know in which way I should fix this problem and I will submit an 
updated patch.


 Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder 
 and decoder
 ---

 Key: CODEC-158
 URL: https://issues.apache.org/jira/browse/CODEC-158
 Project: Commons Codec
  Issue Type: Improvement
Affects Versions: 1.7
Reporter: Mirko Raner
Priority: Minor
 Attachments: CODEC-158.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 Currently, there are no common interfaces that extend both the encoder and 
 the decoder interfaces. This makes it hard to deal with a codec as a single 
 entity and requires separate treatment of encoder and decoder parts.
 For example, let's say you want to develop a storage abstraction that uses an 
 encoding. Right now, you would need to write
 class Storage
 {
 @Inject Encoder encoder;
 @Inject Decoder decoder;
 //...
 }
 In practice, encoder and decoder need to match, and most likely both encoder 
 and decoder would be bound to the same implementation, like Base64 or 
 URLCodec. Because of the lack of a common superinterface they need to be 
 specified separately. There are some classes like BaseNCodec that can be used 
 to unify some of the encoders and decoders, but they are too specific and 
 restrictive.
 Ideally, I would like to write:
 class Storage
 {
 @Inject Codec codec;
 //...
 }
 Assuming that combined encoder/decoder classes like Base64 would implement 
 that Codec interface, this could be directly bound to a combined 
 encoder/decoder implementation.
 It would be nice if these interfaces were added and the existing codec 
 classes (BaseNCodec, Hex, QCodec, QuotedPrintableCodec, URLCodec) could be 
 modified to implement these new interfaces.
 I'm happy to contribute a patch if there is interest in this feature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CODEC-158) Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder and decoder

2012-10-04 Thread Sebb (JIRA)

[ 
https://issues.apache.org/jira/browse/CODEC-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13469272#comment-13469272
 ] 

Sebb commented on CODEC-158:


I would be OK with any of those; prefer the ones starting with Bin because they 
will more likely appear in IDE auto-complete lists.

This suggests another possibility: BinaryCodecI (better sorting version of 
IBinaryCodec).

 Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder 
 and decoder
 ---

 Key: CODEC-158
 URL: https://issues.apache.org/jira/browse/CODEC-158
 Project: Commons Codec
  Issue Type: Improvement
Affects Versions: 1.7
Reporter: Mirko Raner
Priority: Minor
 Attachments: CODEC-158.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 Currently, there are no common interfaces that extend both the encoder and 
 the decoder interfaces. This makes it hard to deal with a codec as a single 
 entity and requires separate treatment of encoder and decoder parts.
 For example, let's say you want to develop a storage abstraction that uses an 
 encoding. Right now, you would need to write
 class Storage
 {
 @Inject Encoder encoder;
 @Inject Decoder decoder;
 //...
 }
 In practice, encoder and decoder need to match, and most likely both encoder 
 and decoder would be bound to the same implementation, like Base64 or 
 URLCodec. Because of the lack of a common superinterface they need to be 
 specified separately. There are some classes like BaseNCodec that can be used 
 to unify some of the encoders and decoders, but they are too specific and 
 restrictive.
 Ideally, I would like to write:
 class Storage
 {
 @Inject Codec codec;
 //...
 }
 Assuming that combined encoder/decoder classes like Base64 would implement 
 that Codec interface, this could be directly bound to a combined 
 encoder/decoder implementation.
 It would be nice if these interfaces were added and the existing codec 
 classes (BaseNCodec, Hex, QCodec, QuotedPrintableCodec, URLCodec) could be 
 modified to implement these new interfaces.
 I'm happy to contribute a patch if there is interest in this feature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CODEC-158) Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder and decoder

2012-10-04 Thread Gary D. Gregory (JIRA)

[ 
https://issues.apache.org/jira/browse/CODEC-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13469295#comment-13469295
 ] 

Gary D. Gregory commented on CODEC-158:
---

I fear this kind of band-aid will make adding generics an even more complicated 
task and harder on any kind of SC/BC. Well, the way I see generics (see my 
previous comment and the link to the branch with generics in it) would break BC 
anyway IIRC.

If we could agree on what a generic version of codec looks like, issues like 
this one would partially fall out nicely. 

I do not think we should fiddle with the hierarchy in 1.x. IMO, rearranging the 
H should be done in the context of adding generics.

 Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder 
 and decoder
 ---

 Key: CODEC-158
 URL: https://issues.apache.org/jira/browse/CODEC-158
 Project: Commons Codec
  Issue Type: Improvement
Affects Versions: 1.7
Reporter: Mirko Raner
Priority: Minor
 Attachments: CODEC-158.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 Currently, there are no common interfaces that extend both the encoder and 
 the decoder interfaces. This makes it hard to deal with a codec as a single 
 entity and requires separate treatment of encoder and decoder parts.
 For example, let's say you want to develop a storage abstraction that uses an 
 encoding. Right now, you would need to write
 class Storage
 {
 @Inject Encoder encoder;
 @Inject Decoder decoder;
 //...
 }
 In practice, encoder and decoder need to match, and most likely both encoder 
 and decoder would be bound to the same implementation, like Base64 or 
 URLCodec. Because of the lack of a common superinterface they need to be 
 specified separately. There are some classes like BaseNCodec that can be used 
 to unify some of the encoders and decoders, but they are too specific and 
 restrictive.
 Ideally, I would like to write:
 class Storage
 {
 @Inject Codec codec;
 //...
 }
 Assuming that combined encoder/decoder classes like Base64 would implement 
 that Codec interface, this could be directly bound to a combined 
 encoder/decoder implementation.
 It would be nice if these interfaces were added and the existing codec 
 classes (BaseNCodec, Hex, QCodec, QuotedPrintableCodec, URLCodec) could be 
 modified to implement these new interfaces.
 I'm happy to contribute a patch if there is interest in this feature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CODEC-158) Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder and decoder

2012-10-04 Thread Sebb (JIRA)

[ 
https://issues.apache.org/jira/browse/CODEC-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13469406#comment-13469406
 ] 

Sebb commented on CODEC-158:


Sorry, but I don't see how this has anything directly to do with generics.
Nor does this enhancement seem to me to be a band-aid.

 Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder 
 and decoder
 ---

 Key: CODEC-158
 URL: https://issues.apache.org/jira/browse/CODEC-158
 Project: Commons Codec
  Issue Type: Improvement
Affects Versions: 1.7
Reporter: Mirko Raner
Priority: Minor
 Attachments: CODEC-158.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 Currently, there are no common interfaces that extend both the encoder and 
 the decoder interfaces. This makes it hard to deal with a codec as a single 
 entity and requires separate treatment of encoder and decoder parts.
 For example, let's say you want to develop a storage abstraction that uses an 
 encoding. Right now, you would need to write
 class Storage
 {
 @Inject Encoder encoder;
 @Inject Decoder decoder;
 //...
 }
 In practice, encoder and decoder need to match, and most likely both encoder 
 and decoder would be bound to the same implementation, like Base64 or 
 URLCodec. Because of the lack of a common superinterface they need to be 
 specified separately. There are some classes like BaseNCodec that can be used 
 to unify some of the encoders and decoders, but they are too specific and 
 restrictive.
 Ideally, I would like to write:
 class Storage
 {
 @Inject Codec codec;
 //...
 }
 Assuming that combined encoder/decoder classes like Base64 would implement 
 that Codec interface, this could be directly bound to a combined 
 encoder/decoder implementation.
 It would be nice if these interfaces were added and the existing codec 
 classes (BaseNCodec, Hex, QCodec, QuotedPrintableCodec, URLCodec) could be 
 modified to implement these new interfaces.
 I'm happy to contribute a patch if there is interest in this feature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CODEC-158) Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder and decoder

2012-10-03 Thread Sebb (JIRA)

[ 
https://issues.apache.org/jira/browse/CODEC-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13468459#comment-13468459
 ] 

Sebb commented on CODEC-158:


Thanks!

Does not seem to affect binary compatibility (according to Clirr).

However, it is very awkward having an interface and implementation of the 
interface with the same class name, so I think the BinaryCodec interface needs 
to be renamed.

Otherwise one has to do something like:

BinaryCodec bc = new org.apache.commons.codec.binary.BinaryCodec();
or
org.apache.commons.codec.BinaryCodec bc = new BinaryCodec();
or even
org.apache.commons.codec.BinaryCodec bc = new 
org.apache.commons.codec.binary.BinaryCodec();

These are ugly and tricky to read.

 Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder 
 and decoder
 ---

 Key: CODEC-158
 URL: https://issues.apache.org/jira/browse/CODEC-158
 Project: Commons Codec
  Issue Type: Improvement
Affects Versions: 1.7
Reporter: Mirko Raner
Priority: Minor
 Attachments: CODEC-158.patch

   Original Estimate: 1h
  Remaining Estimate: 1h

 Currently, there are no common interfaces that extend both the encoder and 
 the decoder interfaces. This makes it hard to deal with a codec as a single 
 entity and requires separate treatment of encoder and decoder parts.
 For example, let's say you want to develop a storage abstraction that uses an 
 encoding. Right now, you would need to write
 class Storage
 {
 @Inject Encoder encoder;
 @Inject Decoder decoder;
 //...
 }
 In practice, encoder and decoder need to match, and most likely both encoder 
 and decoder would be bound to the same implementation, like Base64 or 
 URLCodec. Because of the lack of a common superinterface they need to be 
 specified separately. There are some classes like BaseNCodec that can be used 
 to unify some of the encoders and decoders, but they are too specific and 
 restrictive.
 Ideally, I would like to write:
 class Storage
 {
 @Inject Codec codec;
 //...
 }
 Assuming that combined encoder/decoder classes like Base64 would implement 
 that Codec interface, this could be directly bound to a combined 
 encoder/decoder implementation.
 It would be nice if these interfaces were added and the existing codec 
 classes (BaseNCodec, Hex, QCodec, QuotedPrintableCodec, URLCodec) could be 
 modified to implement these new interfaces.
 I'm happy to contribute a patch if there is interest in this feature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CODEC-158) Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder and decoder

2012-09-27 Thread Sebb (JIRA)

[ 
https://issues.apache.org/jira/browse/CODEC-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13465218#comment-13465218
 ] 

Sebb commented on CODEC-158:


It might well be useful to have a common super-interface, so if you have some 
code you can provide, please attach it to this issue.

 Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder 
 and decoder
 ---

 Key: CODEC-158
 URL: https://issues.apache.org/jira/browse/CODEC-158
 Project: Commons Codec
  Issue Type: Improvement
Affects Versions: 1.7
Reporter: Mirko Raner
Priority: Minor
   Original Estimate: 1h
  Remaining Estimate: 1h

 Currently, there are no common interfaces that extend both the encoder and 
 the decoder interfaces. This makes it hard to deal with a codec as a single 
 entity and requires separate treatment of encoder and decoder parts.
 For example, let's say you want to develop a storage abstraction that uses an 
 encoding. Right now, you would need to write
 class Storage
 {
 @Inject Encoder encoder;
 @Inject Decoder decoder;
 //...
 }
 In practice, encoder and decoder need to match, and most likely both encoder 
 and decoder would be bound to the same implementation, like Base64 or 
 URLCodec. Because of the lack of a common superinterface they need to be 
 specified separately. There are some classes like BaseNCodec that can be used 
 to unify some of the encoders and decoders, but they are too specific and 
 restrictive.
 Ideally, I would like to write:
 class Storage
 {
 @Inject Codec codec;
 //...
 }
 Assuming that combined encoder/decoder classes like Base64 would implement 
 that Codec interface, this could be directly bound to a combined 
 encoder/decoder implementation.
 It would be nice if these interfaces were added and the existing codec 
 classes (BaseNCodec, Hex, QCodec, QuotedPrintableCodec, URLCodec) could be 
 modified to implement these new interfaces.
 I'm happy to contribute a patch if there is interest in this feature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (CODEC-158) Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder and decoder

2012-09-27 Thread Gary D. Gregory (JIRA)

[ 
https://issues.apache.org/jira/browse/CODEC-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13465224#comment-13465224
 ] 

Gary D. Gregory commented on CODEC-158:
---

Somewhat related is the generification of codecs, for example 
https://svn.apache.org/repos/asf/commons/proper/codec/branches/generics

 Add Codec, StringCodec, and BinaryCodec interfaces that extend both encoder 
 and decoder
 ---

 Key: CODEC-158
 URL: https://issues.apache.org/jira/browse/CODEC-158
 Project: Commons Codec
  Issue Type: Improvement
Affects Versions: 1.7
Reporter: Mirko Raner
Priority: Minor
   Original Estimate: 1h
  Remaining Estimate: 1h

 Currently, there are no common interfaces that extend both the encoder and 
 the decoder interfaces. This makes it hard to deal with a codec as a single 
 entity and requires separate treatment of encoder and decoder parts.
 For example, let's say you want to develop a storage abstraction that uses an 
 encoding. Right now, you would need to write
 class Storage
 {
 @Inject Encoder encoder;
 @Inject Decoder decoder;
 //...
 }
 In practice, encoder and decoder need to match, and most likely both encoder 
 and decoder would be bound to the same implementation, like Base64 or 
 URLCodec. Because of the lack of a common superinterface they need to be 
 specified separately. There are some classes like BaseNCodec that can be used 
 to unify some of the encoders and decoders, but they are too specific and 
 restrictive.
 Ideally, I would like to write:
 class Storage
 {
 @Inject Codec codec;
 //...
 }
 Assuming that combined encoder/decoder classes like Base64 would implement 
 that Codec interface, this could be directly bound to a combined 
 encoder/decoder implementation.
 It would be nice if these interfaces were added and the existing codec 
 classes (BaseNCodec, Hex, QCodec, QuotedPrintableCodec, URLCodec) could be 
 modified to implement these new interfaces.
 I'm happy to contribute a patch if there is interest in this feature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira