Re: [Simple-support] Extended @Version
Brought to you by:
niallg
|
From: Stefanato F. (K. 2) <fed...@cr...> - 2011-07-22 15:34:29
|
Yes, sure.
As far as I could figured out, enums are not currently supporting
versioning.
public MyClass {
@Version(revision=1.1)
private double version;
@Attribute
MyEnum myEnum;
//...
}
When MyEnum change one of its values from A_VALUE to ANOTHER_VALUE (i.e.
A_VALUE doesn't exist anymore), I got a serialization exception (it
obviously could not fit A_VALUE anymore in the enum), regardless the
fact that MyClass changed its version.
Hence, I suppose that @Version with target TYPE, should solve this issue
by annotating the enum.
@Version(revision=1.3)
MyEnum {
//...
}
Moreover, an enum can implement a @Version annotated empty interface and
easily be version-aware itself, I guess.
@Version(revision=2.0)
public interface XmlSerializable {}
MyEnum implements XmlSerializable {
//...
}
Please, let me know if I need to be more clear or I misunderstood
something.
Thanks.
Regards,
federico
-----Original Message-----
From: Niall Gallagher [mailto:gal...@ya...]
Sent: Friday, July 22, 2011 4:57 PM
To: sim...@li...; Stefanato Federico (KGRQ 2)
Subject: RE: [Simple-support] Extended @Version
Hi,
I am not sure I understand the question, could you elaborate?
Thanks,
Niall
--- On Thu, 21/7/11, Stefanato Federico (KGRQ 2)
<fed...@cr...> wrote:
> From: Stefanato Federico (KGRQ 2)
<fed...@cr...>
> Subject: RE: [Simple-support] Extended @Version
> To: "Niall Gallagher" <gal...@ya...>,
sim...@li...
> Received: Thursday, 21 July, 2011, 3:11 AM
> Niall,
>
> good to know that some enhancements on such topic are here
> to come!
>
> Sorry if I go back on versioning issues...
>
> I'm also facing a problem regarding enums versioning:
> switching to
> future @Version target type would also solve the
> mismatching of enum
> values over different version?
>
> Thanks again.
>
> Regards,
>
> federico
>
> -----Original Message-----
> From: Niall Gallagher [mailto:gal...@ya...]
>
> Sent: Thursday, July 21, 2011 11:45 AM
> To: sim...@li...;
> Stefanato Federico (KGRQ 2)
> Subject: Re: [Simple-support] Extended @Version
>
> Hi,
>
> Yes, this should be a very easy thing to do. I am planning
> a release
> soon for 2.6.1, I will take a look at addressing the
> @Version annotation
> in such a way.
>
> Thanks for the feedback.
> Niall
>
> --- On Tue, 19/7/11, Stefanato Federico (KGRQ 2)
> <fed...@cr...>
> wrote:
>
> > From: Stefanato Federico (KGRQ 2)
> <fed...@cr...>
> > Subject: [Simple-support] Extended @Version
> > To: sim...@li...
> > Received: Tuesday, 19 July, 2011, 4:40 AM
> > Hi Niall,
> >
> > the usage of @Version annotation is very powerful
> where -
> > as in my case
> > - the overall structure changes quite often.
> >
> > Unfortunately, the annotation works only at field
> level and
> > I need a
> > class - either concrete or abstract - to provide such
> field
> > (in
> > interfaces it doesn't work).
> >
> > It would be of great advantage if I could annotate a
> super
> > interface in
> > order to centralize the versioning management.
> > Something as:
> >
> > @Version(name="xml-version", revision="1.7")
> > public interface XmlSerializable{}
> >
> > Do you foresee any kind of extension in versioning
> > capabilities?
> > Otherwise, could you suggest me an equivalent
> strategy?
> >
> > Thanks in advance.
> >
> > Regards,
> >
> > federico
> >
> >
>
------------------------------------------------------------------------
> ------
> > Magic Quadrant for Content-Aware Data Loss Prevention
> > Research study explores the data loss prevention
> market.
> > Includes in-depth
> > analysis on the changes within the DLP market, and
> the
> > criteria used to
> > evaluate the strengths and weaknesses of these DLP
> > solutions.
> > http://www.accelacomm.com/jaw/sfnl/114/51385063/
> > _______________________________________________
> > Simple-support mailing list
> > Sim...@li...
> > https://lists.sourceforge.net/lists/listinfo/simple-support
> >
>
|