[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re[2]: [lmi] Historical product files
From: |
Vadim Zeitlin |
Subject: |
Re[2]: [lmi] Historical product files |
Date: |
Tue, 25 May 2010 11:35:50 +0200 |
On Tue, 25 May 2010 03:13:26 +0000 Greg Chicares <address@hidden> wrote:
GC> > I did think about a slight variation on the same theme:
GC> > what about using a different tag name for historical stuff? E.g. have
GC> > something like this:
GC> >
GC> > <historical_item EffectiveDate="20020101">...</historical_item>
GC> > <historical_item EffectiveDate="20020201">...</historical_item>
GC> > <item EffectiveDate="2010-05-20">...</item>
GC> >
GC> > ? The obvious advantage is that you don't have to change anything in the
GC> > existing code because there would still be just a single "item". One
GC> > disadvantage is loss of some consistency but OTOH don't we actually want
to
GC> > treat the last item specially?
GC>
GC> Today, we'd want to treat it specially, and ignore the others.
GC> But eventually we'd want to choose among them at run time.
In this case it's probably indeed better to use consistent names for all
items.
GC> > Another, potentially more serious, disadvantage is that files will need
to
GC> > be edited (although only slightly, but still) and not just appended to
when
GC> > a new set of data is added. I don't know how big a problem would this be
in
GC> > practice.
GC>
GC> I don't think that's a big problem, and I don't believe we can
GC> (or should want to) avoid editing.
What I wanted to say was that just appending/adding/inserting data was
always easier and less error-prone than modifying/deleting/replacing the
old data before it, whether you do it manually or programmatically.
GC> For now, here's what Wendy and I decided to do. If we had:
GC> <some_interest_rate>0.06</some_interest_rate>
GC> last month, and the rate has become five percent, we'll change it
GC> more or less like this:
GC>
GC> - <some_interest_rate>0.06</some_interest_rate>
GC> + <!-- 20100401 <some_interest_rate>0.06</some_interest_rate> -->
GC> + <some_interest_rate>0.05</some_interest_rate>
You certainly realize this already but please notice that this means you'd
have to use sed or awk or some other text transformation tool instead of an
XML/XSLT processor to translate this into some other format later because I
don't believe any such tools can deal with the contents of the comments. So
this is not very good from the point of view of automating the conversion
later. Of course, maybe it's not very important if it has to be done
manually or with sed.
Regards,
VZ