Open Menu

Synergex Blog


New select classes are a home run

By synergexadmin, Posted on September 23, 2009 at 4:18 pm

Early last week, I was given a copy of the beta build of Synergy/DE 9.3.  My task was to do some testing of one the exciting new features it includes: The Select classes.

Now, testing isn’t always fun, and it can be frustrating trying to figure out if a bug is really a bug, or just a problem born of having no clue what I’m doing.  This time, however, any minor problems I encountered were completely overshadowed by the sheer awesomeness of the new classes.

The Select classes provide a SQL-like syntax for communicating with Synergy databases, and it’s amazing just how simple they are to use.  Once I had a basic understanding of how they worked, I was able to compress a simple READS loop – complete with “filters” and error checking – into a single line.

Consider the following code, which loops through active customer records and prints out the customer number, name and last sales date of anyone with no sales for more than a year:

    repeat
        begin
        reads(ch_cusmas,cusmas)  [err = eof]     if (cusmas.status .ne. ‘A’); If customer is not Active, ignore it
    nextloop
        if (cusmas.last_sale.year < lastYear)
        call printLine
    end
eof,    etc…

The basic syntax and usage of the Select Class is:

    foreach myRecord in @Select(@From[, @Where][, @OrderBy])
    doSomething

And so, using the Select classes, I condensed everything into:

customers = new From(ch_cusmas,cusmas)
noNewSales = new Select(customers,(where)status.eq.’A’ .and. last_sale.year < lastYear)
foreach cusmas in noNewSales
    call printLine

(I actually condensed the first three lines into just one foreach statement, but the result is a line of code that doesn’t fit nicely into a blog entry, and therefore becomes more difficult to read.)

The syntax is neat, but it’s not the best part; the really cool stuff is happening under the hood.  The actual database I/O layer is now handling all of the “filter” logic, and it’s doing it faster than a regular READS loop can handle.  In fact, during my tests, a filtered return of around 18,375 records showed a performance benefit that ranged from 11 to 21 percent.  Now, that’s a small data set and we’re only talking about milliseconds, but it demonstrates a performance boost nevertheless – and that’s for a local application, running against a local database.  The savings over a network connection to a remote database (i.e., xfServer) is likely to be enormous, as the I/O layer on the server is now doing the filtering, rather than returning the data to the client to handle.

Other features include the OrderBy class, which (as expected) sorts the returned data in either ascending or descending order based on the key being read.  The classes also provide for a sparse record population, in which only the fields needed by the application are actually returned.  There are even methods available to get at each individual record returned in the set, write back to the file, etc.

The fact that an update to Synergy/DE 9.3 is all that’s required is impressive as well.  There’s no need to perform any database conversions, or add additional services or products; the Select classes work right out of the box.

The Select classes represent a significant addition to the language, and I can imagine a time in the not-too-distant future when they become the primary Synergy database access mechanism.  My hat’s off to the Synergex development team; it appears that they’ve hit this one out of the park.


The message is the same; it’s just the words that have changed

By William Mooney, Posted on September 2, 2009 at 4:24 pm

I dropped my daughter off at her first day of high school this week and got caught up in a “get back to business/summer’s over” mentality–get to the office, sharpen my pencils, and focus on what’s really important.

First order of business: Blogging. It’s been weighing on my mind that I haven’t posted in a while, and as I mentioned previously, I’ve been anxious to talk about our new tagline, Advancing Applications. Partnering for Success.

Our tagline for years was “Take Part in Creating Success.” These five words were plastered on everything we sent out. The concept was to convey to our customers, employees, and vendors that we are only successful when our customers are successful. I polled some Synergex new-hires for candid comments, however, and learned that they found the tagline confusing – i.e., who was taking part in whose success? We slowly backed away from the mantra to the point that we got rid of it all together.

This troubled me. Taglines articulate a company’s vision and empower people – employees, customers, vendors – to make decisions in line with the company’s overall objectives. (Think FedEx when they were just an overnight service – Surely “When it absolutely, positively has to be there overnight” empowered their employees to make that happen, at whatever cost, without having to ask permission first.) So, we recruited some Mad Men types (in our case Mad Women) to help us find a way to convey the original message without the confusion. We white-boarded ideas around customers, products…everything. We finally chose “Advancing Applications. Partnering for Success.”

That’s it. Our application of the Law of the Little Shovel. Our existence is based on these simple words: “Advancing Applications” because that’s what we’ve been doing since the early days of helping customers migrate from one platform to another; to today’s customers who want to implement new Windows user interfaces and Web front ends, or integrate data with Oracle and SQL Server, hand held apps, and a lot more. And “partnering for success” because we recognize that we are partners with our customers.

Our role extends much farther than providing products and services to help customers advance applications. It means coming up with ideas and ways to help them succeed – from designing new logos for them, to sending out mailings to help them get new business, to training their support departments on new technology — simply, partnering with them however we can to ensure their continued success.

So, armed with my sharp pencils and little shovel, empowered by the vision present and clear, I am eager to help my partners advance their applications to ensure success. Please call on me to let me know how we can help you.


Don't miss a post!

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Recent Posts Tag Cloud Archives