Sunday, May 23, 2004

Persisting Can be Painful

We are considering changing from an OLE Structured Storage based file format to an XML based file format our flagship product. OLE Structured Storage has served us well, but we are starting to hit walls, especially with versioning and backward/forward compatibility. Yes, forward compatibility!

The product, mainly C++, has objects that save and load their state using a storage system. The storage system is IStorage/IStream and all of the objects know it. That's a minor problem that can be fixed. The bigger problem is the fact that the object hierarchy defines the structure of the file stream. That means any change to the object hierarchy changes the structure of the file stream. Or, any significant change in the object model (version 1.0 to version 2.0) makes it very painful for v2.0 to read v1.0 files. Why the headache? Since each object is responsible for saving/loading is own piece, an object in v2.0 may need to remember what it looked like in v1.0. Even worse, what if an object in v1.0 no longer exists in v2.0? It can get pretty ugly.

A different product, still in development, uses a system that abstracts way the "how" of the persistent storage. The objects that make up the business logic can save and load their state using an abstract storage interface. It has implementations for persisting to binary streams, SQL databases and XML streams. Its not revolutionary, COM's IPersist has allowed developers to do this kind of thing for years. However, we find ourselves primarily using the XML storage more than the others. In fact, we use it for more than persisting to files. We use it for copying state to clipboard and maintaining our Undo/Redo system as well. But I am getting ahead of myself.

I was reading a post by Chris Pratley where he talks about Word, RTF and XML:

RTF is used for this purpose instead since it is easier to deal with than Word binary for apps other than Word (remember that is why we created it - it stands for Rich Text interchange Format). The new XML format is designed for exactly that purpose - and it is easier to work with than RTF. You can create the WordML doc (or even a minimal subset) on a server using XML tools, then send the XML to Word on the client and Word will load it up. If you're missing a lot of the Word specific stuff, that's OK - Word will fill in the missing bits with defaults. In fact, you can skip generating the doc on the server if you want - just generate an XML data file in your own schema and provide an XSLT for Word to use when opening the file. That pushes a lot of the processing onto the client.
An idea for how to get past some of our versioning issues started to form:
  1. What if our objects persisted to XML?
  2. What if each version only cared about the structure of its XML?
  3. What if we used XSLT or XQuery to convert one version's XML to another?

In my mind, forward compatibility (an old version opening a newer version's file) would be hard. Backward compatibility would be easier. Just transform the old XML to the current version's structure and load it. We could allow newer versions to save files in an older version's XML structure. That would be one way of handling forward compatibility. We are researching this concept to see where it can take us.

13 Comments:

At 7:16 PM, Blogger Adi said...

Oes Tsetnoc one of the ways in which we can learn seo besides Mengembalikan Jati Diri Bangsa. By participating in the Oes Tsetnoc or Mengembalikan Jati Diri Bangsa we can improve our seo skills. To find more information about Oest Tsetnoc please visit my Oes Tsetnoc pages. And to find more information about Mengembalikan Jati Diri Bangsa please visit my Mengembalikan Jati Diri Bangsa pages. Thank you So much.

 
At 6:52 AM, Blogger polo shirts said...

History of polo ralph lauren. Polo fashions had its humble beginnings in 1968 when tie salesman Ralph Lauren gave it a kick start. By 1969 he had a boutique polo ralph lauren factory stores within the Manhattan department store Bloomingdale's. ... Brands and luxury standard. Since Ralph Lauren's first brand, Polo Ralph Lauren, was launched, the company has expanded to include a variety of luxury brands such as Polo Golf, Polo Denim, Polo Sport. You can buy cheap Ralph Lauren Clothing at Ralph Lauren outlet.Also We provide polo shirts
Ralph Lauren polo shirt, 50% OFF! polo ralph lauren outlet online is your best choice!In 2006, polo ralph lauren outlet became the first designer in Wimbledon's 133-year history to create official uniforms for the tournament. As part of this year's event, which starts next week, polo ralph lauren sale will introduces the first ... determination to maintain and enhance the values for which our two brands are famous throughout the world. The rugby ralph lauren brand brings to Wimbledon the look of timeless elegance, drawing on our rich history and traditions

 
At 5:24 AM, Blogger mary said...

In 2003, dsquared2 clothing received the “La Kore” award, considered the “Oscar” of the Italian fashion world, as dsquared clothes the Most Original Designers. Then in October of 2003 Dean and Dan Caten were named "Men of ljcflsgjkdk dsquared t shirts the Year" by GQ Magazine USA as the Best Breakthrough Design Team. In 2006, competing dsquared shirts among a slate of fashion designers renown for originality, Dean and Dan won the prestigious Spanish award Dsquared2“Aguja de Oro” (“Golden Needle”); for the occasion, the brothers designed an outfit that will remain on display at the Museo del Traje in Madrid.

 
At 1:15 AM, Blogger glenda regan said...

Juicy Couture Clothes

juicy couture Tracksuit

Tommy Hilfiger Clothes

Tommy Hilfiger Shirt

Tommy Hilfiger Polo

Dsquared Clothes

Dsquared Shoes

 
At 6:36 AM, Anonymous Anonymous said...

Cuisinart TOB-195
Acne Conglobata
Acer 11.6 Netbook
500 payday loan
acne inversa
VIZIO M261VP
checkmate payday loans
Cuisinart TOB-195
Cuisinart TOB-195
Cuisinart TOB-195
Cuisinart TOB-195
Cuisinart TOB-195
Acne Conglobata
Acne Conglobata
Acne Conglobata
Acer 11.6 Netbook
Acer 11.6 Netbook
Acer 11.6 Netbook
500 payday loan
500 payday loan
acne inversa
VIZIO M261VP
VIZIO M261VP
VIZIO M261VP
checkmate payday loans
checkmate payday loans
checkmate payday loans

 
At 10:42 PM, Blogger maxnewser said...

The Oakley Frogskins line has mnbgqhj in particular become a hot favorite with popular celebrities and fashion savvy people. Adding a pair of Oakley Frogskin to a great outfit is an easy way to Cheap Oakley Sunglasses class up what you're already wearing. Celebrities have long hid behind Oakley Jawbone the dark shades of their Oakley sunglasses, and many possess up to ten pairs or more. There is a huge selection of Oakley Jawbones styles, prices and features out there C it's difficult to choose which pair is best.

 
At 7:49 AM, Anonymous professional writing company said...

It seems that forward compatibility is harder to achieve than backward compatibility because a system needs to cope gracefully with an unknown future data format or requests for unknown future features.

 
At 6:53 AM, Anonymous top custom essay writing service said...

I agree with you 100%. The idea of this post is just brilliant.

 
At 2:06 AM, Blogger Dan Sun said...

Persisting can be very painful :) Every person should have to make decisions onhis/her own. It is very important. Order a psychology essay on this topic using this online top custom essay writing service.

 
At 5:03 AM, Anonymous Custom-Essays-Online.com said...

If a person doesn't want to do some things, then they're absolutely unnecessary. Why to press. Even my essay on psychology which I ordered at Custom-Essays-Online.com says about it.

 
At 11:45 PM, Blogger angelacooper839 said...

We find ourselves primarily using the XML storage more than the others. Buy English Literature Essays

 
At 8:58 AM, Blogger Aditya said...

Genuinely I just read through it again yesteryear and yet We numerous head to fix it and today I wanted to study it again ever again considering that it is somewhat well written.
apk games app download
download kik messenger
popcorn movie apk
downlaod king root apk
pou mod apk downlaod

 
At 4:37 AM, Anonymous essay-experts said...

Do you want toget rid of your writing worries?

 

Post a Comment

<< Home