data storage: object! vs. XML
[1/5] from: norsepower::uswest::net at: 23-Oct-2000 0:13
I'm working on a news site management system and I can either save the data
in text files as object! expressions or as XML.
Which would be the better choice? I'm pretty new to this and I'm not quite
sure what advantages I gain by saving the data as XML (esp. RSS grammar)
since the XML must be parsed into objects anyway.
Thanks.
-Ryan
[2/5] from: joel:neely:fedex at: 23-Oct-2000 14:02
Hi, Ryan,
[rebol-bounce--rebol--com] wrote:
> I'm working on a news site management system and I can either save the data
> in text files as object! expressions or as XML.
>
> Which would be the better choice? I'm pretty new to this and I'm not quite
> sure what advantages I gain by saving the data as XML (esp. RSS grammar)
>
Flexibility. As a vendor-independent standard, XML provides a format that
you can use with a large variety of software and tools.
Readability. Although there is a bit of training involved, anyone who can
read HTML can learn to read XML very quickly. (More quickly than they can
learn to read REBOL objects, IMHO.)
Scalability. If at some later date you decide to store your data in a
database, it's likely to require less effort to get the data back out into
XML format than into REBOL objects. In fact, some database vendors are
getting quite noisy about their willingness to support XML.
> since the XML must be parsed into objects anyway.
>
Is this a requirement of your app?
I've done quite a bit of work using XML as the external data format, just
reading and parsing the XML and then using a library of functions/objects
to traverse the resulting block structure, without actually converting the
XML to objects.
-jn-
--
; Joel Neely [joel--neely--fedex--com] 901-263-4460 38017/HKA/9677
REBOL [] do [ do func [s] [ foreach [a b] s [prin b] ] sort/skip
do function [s] [t] [ t: "" foreach [a b] s [repend t [b a]] t ] {
| e s m!zauafBpcvekexEohthjJakwLrngohOqrlryRnsctdtiub} 2 ]
[3/5] from: rchristiansen:pop:isdfa:sei-it at: 23-Oct-2000 15:26
> > since the XML must be parsed into objects anyway.
> >
<<quoted lines omitted: 3>>
> to traverse the resulting block structure, without actually converting the
> XML to objects.
Not fully decided on this yet. I imagine a parsing engine which would
create the objects from the XML, creating reusable code in RAM
instead of re-parsing the XML again-and-again, depending on my
needs. Parsing the XML into objects would increase flexibility, no?
-Ryan
[4/5] from: gparks:ixl at: 23-Oct-2000 17:11
I think there's a compatibility issue to consider. I was recently in a
vendor's class using a graphical tool to describe migrating multiple legacy
databases into their product, and all the views, queries etc. This entire
scheme was saved as XML. I thought that was kinda neat. Obviously would
allow the most uses by other systems. IMO that's the whole reason behind a
keyword
="value" markup language. Again, IMHO.
[5/5] from: al:bri:xtra at: 24-Oct-2000 20:25
Ryan wrote:
> I imagine a parsing engine which would create the objects from the XML,
creating reusable code in RAM instead of re-parsing the XML again-and-again,
depending on my needs. Parsing the XML into objects would increase
flexibility, no?
That sounds like a good plan.
Andrew Martin
Still reading XML for Dummies...
ICQ: 26227169
http://members.nbci.com/AndrewMartin/
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted