I think you can safely pull out such functionality into a general helper class.

On Fri, Apr 6, 2012 at 9:29 AM, Jonathan Coveney <jcove...@gmail.com> wrote:
> https://issues.apache.org/jira/browse/PIG-2632
>
> I'm working on a way to use code generation to generate custom Tuples when
> the Schema is known. There is a serialization benefit because you can just
> write your primitives and objects directly without having to write the byte
> type, since you know what it is. However, since that logic has to live in
> the generated code, it can't currently leverage logic in BinInterSedes
> because it is all private, and I don't want to go through write(DataOutput,
> Object, byte) for everything when the specific method I want already
> exists... which has led to me having to duplicate code for the
> serialization of byte[]s and Strings and such.
>
> 2012/4/6 Gianmarco De Francisci Morales <g...@apache.org>
>
>> Well, those methods are really specific to the serialization format defined
>> by BinInterSedes.
>> How do you envision those methods to be used by other classes without using
>> the public ones?
>> Which classes are you thinking about?
>>
>> Cheers,
>> --
>> Gianmarco
>>
>>
>>
>> On Fri, Apr 6, 2012 at 08:48, Jonathan Coveney <jcove...@gmail.com> wrote:
>>
>> > The vast majority don't use any state, and could be potentially useful to
>> > other classes that want to do serialization.
>> >
>> > I guess the other way to take it is that the logic of those classes
>> should
>> > be put into BinInterSedes, but this isn't always reasonable or desirable.
>> >
>> > Thoughts? Any pitfalls I am missing?
>> >
>>

Reply via email to