-Re: Is there any reason why the private instance methods of BinInterSedes shouldn't be made protected static?
Gianmarco De Francisci Mo... 2012-04-06, 18:36
+1, I see no problem in moving them to package visibility.
I wouldn't make them public though as the serialization format is subject
On Fri, Apr 6, 2012 at 18:42, Dmitriy Ryaboy <[EMAIL PROTECTED]> wrote:
> I think you can safely pull out such functionality into a general helper
> On Fri, Apr 6, 2012 at 9:29 AM, Jonathan Coveney <[EMAIL PROTECTED]>
> > https://issues.apache.org/jira/browse/PIG-2632
> > I'm working on a way to use code generation to generate custom Tuples
> > the Schema is known. There is a serialization benefit because you can
> > write your primitives and objects directly without having to write the
> > 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
> > 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 bytes and Strings and such.
> > 2012/4/6 Gianmarco De Francisci Morales <[EMAIL PROTECTED]>
> >> Well, those methods are really specific to the serialization format
> >> by BinInterSedes.
> >> How do you envision those methods to be used by other classes without
> >> the public ones?
> >> Which classes are you thinking about?
> >> Cheers,
> >> --
> >> Gianmarco
> >> On Fri, Apr 6, 2012 at 08:48, Jonathan Coveney <[EMAIL PROTECTED]>
> >> > 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
> >> >
> >> > Thoughts? Any pitfalls I am missing?
> >> >