Alexis Smirnov
Thinking about software




Tuesday, April 29, 2003
 

John Lam wanted to hear about people who work with code-generation techniques, so I though I’d talk a bit about our solution to a particular problem we had:

 

First, a bit of context: For the past couple of years we’ve been developing a product based on CLIPS inference engine. As with most inference-engine based systems, the data structure is defined as an ontology. We’ve used CLIPS language to define the ontology and rules around it. The data structures defined in CLIPS were loaded in memory and represented as  regular object model (using COM) to allow data entry and data display.

 

We’re now looking to persist application’s data in a database to provide the data to other applciations. One of the first questions we have to address is to decide how to design the database schema. Once we understood how to map CLIPS constructs to relational world, the actual converting of CLIPS data structures into their relational representation seemed like a good job for an automated tool. We wanted to automate the process because we wanted to quickly react to changes in ontology.

 

After thinking about our particular problem in more general terms, we’ve decided to convert CLIPS data structures into XSD. With a newly generated .XSD we can now create strongly-typed DataSets that would correspond to ontology data structures. Sweet! The only thing missing was the ability to create a new database schema from .XSD. I was surprised to find out that only Oracle supports this feature. So I’ve put together a utility called xsd2db that would work with SQL Server. A colleague of mine have extend it to support Jet engine too. We’re likely to be adding support to Teradata quite soon.

 

Here’s more about the motivations of xsd2db.

 

John asked for stories of “code generation”. I don’t know if my story qualifies as such. After all what we’re trying to abstract out are representations of data structures by unifying them via XSD.


    


Subscribe to "Alexis Smirnov" in Radio UserLand. Click to see the XML version of this web page. Click here to send an email to the editor of this weblog.
Site Statistics
© Copyright 2003 Alexis Smirnov.


Last update: 5/6/2003; 5:43:43 PM.

April 2003
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      
Mar   May

Aug 2002