International Developer Logo Last Updated 19.11.08 at 11.48
 
TUTORIALS

InterSystems: Caché me if you can!


  19.12.06

So here sits your problem, facing you. You have an existing program, which works (more or less) on SQL tables. You’d like to rewrite or extend it in something more object-oriented and preferably faster. How? Thankfully, InterSystems has read your mind. Leon Brooks opens up the technology crystal ball.

 

InterSystems has produced an object-oriented database (especially including Java) which knows how to operate as a traditional SQL database as well, and they’ve benchmarked it as being 6x–20x faster than large SQL industry leaders.

 

Caché me if you can!

Now for some providers, the benchmarking would come as no surprise, but we’re talking large industry leaders here, people with a reputation of performance and for leading-edge solutions to seriously big problems. Part of the advantage is in sheer, raw performance, because the database, Caché, has been designed – as the name hints – to cache the data it’s fetching.

Part of the advantage is the object orientation, since Caché can re-organise its internals to better suit the object paradigm far more freely than a standard SQL-only database might.

Let’s create and populate a two-part form, such as an order or an invoice. Doing this relationally involves creating two tables, one for the form proper and one for the lines upon it, and populating those as best we can.

 

if (flag = “New”) {

                insert into formbase (date, serial) values(Today, :newFormNumber)

                insert into formline (parent, qty, code) values(:newFormNumber, Quantity, PartNo)

}

 

Now, let’s do this object-style:

 

if (flag = “New”) {

                aForm = new Form

                aForm.date = Today

                aForm.serial = newFormNo

                aLine = new aForm.Line

                aLine.qty = Quantity

                aLine.code = PartNo

                aForm.Save()

}




   Previous Page  1 2 3 Next Page   

HAVE YOUR SAY
This article is rated  Rate this article