Open Menu

Synergex Blog


All Hooked Up. (Circa 1957, Elvis Presley)

By Richard Morris, Posted on July 19, 2011 at 9:25 am

Back in the day, Elvis Presley shook up a bit of a stir when his gyrating hips and dulcet tones came over the airways onto our little black and white TVs (so I was told, I’m not old enough!).  Today, Synergex is defining a development that will shake the Synergy world when it’s released with an upcoming version!  And it’s a development that we’ll all be hooked on.

In the specification phase at the moment is the ability to “hook” user definable logic against operations within the SDBMS file IO system.  This proposal offers the ability to perform logic when any operations on any SDMBS file (index or relative)  are executed.

For example, you can hook up a Synergy method that will be called “before” a record is read from a file, or before a record is stored into a file.  A method can be hooked up and executed when a record lock is encountered, records deleted or updated.

The possibilities are truly endless.  You could use this capability to debug your applications.  For example, you may have a system that occasionally encounters corrupt data – and you have no idea when the data got corrupted.  By implementing pre-store and pre-write event hooks you could validate the data and log to a file if it’s not valid.  Because it’s a Synergy method, in the calling stack, you can use routines like MODNAME to record the full stack trace and pinpoint the problem.

Implementing hooks for the pre-store and pre-update events can allow you to ensure that default data is correctly set.

Hooking up post-events could allow you to record modifications to your SDBMS data that you wish to replicate somewhere – in a third party relational database for example.  Or you could actually record the data being sent to a file for transaction/logging purposes.

All hooks will be on a per-channel basis, so if you currently have a generic file open routine you’ll be well placed to begin to implement this new exciting capability.  If you don’t, now’s the time to start thinking of adding one!

One thing to remember, performance!  Once you have bound a hook to an event then every operation of that type will cause your logic to be executed, so keep the code concise, specific and efficient!!

This development, for me, is on a par with the .NET API – it’ll open up a whole new world of possibilities.  I can’t wait to get hold of the alpha release so I can blog about it, and watch out for the early videos showing you the full power of this great new development.  And the best bit is that it’ll be supported on ALL platforms, so you won’t have to be a .NET guru to take full advantage!  I can already feel an SPC session in the making.

I’m hooked, line a sinker!


The Final Chapter

By Richard Morris, Posted on December 17, 2010 at 6:00 am

Using Synergy in all aspects of a new WPF based development is really quite exciting.  But when you start to bring in code that was written many years ago you really begin to see the power of a truly cross platform capable development environment.

The task I started while working with White Knight was to create a simple application that managed the communications with their customer base – basically a very simple CRM system.  The brief was to have a great looking windows desktop application and write it in Synergy – oh, and use all their existing library routines, data layout include files and database files.

And the solution, if you’ve followed my earlier blogs, was to utilise the new 9.5 release of Synergy.  With Synergy 9.5 we have the Visual Studio Integration which, in a nut shell, is Synergy language inside the powerful Visual Studio development environment.  Using this environment we can craft our user interface utilising WPF controls and Synergy language to bind to our data classes.  So, that’s the UI sorted.

Using the Synergy .NET API I can continue to use my existing Synergy language routines to load my new WPF UI Library, and manage the data communication between my program and the UI controls using WPF’s powerful data binding techniques.  So that’s the existing program logic and data access sorted.

And the results:

A fully functional UI, all written in Synergy and XAML (the WPF portion of the UI) managing our SDBMS data and Synergy business and validation logic. 

So what about your application?  If it’s in need of a bit of a user interface upgrade, download the latest 9.5 release of Synergy and let your imagination run wild.  You’ll be surprised just how much you can do in a short space of time. 

As we head towards the end of 2010 we’ve already started our plans for SPC2011 – watch this space for details!  I’m really excited about the prospect of presenting these great new capabilities that Synergy offers.  I can’t believe how quickly this year has gone by.  I hope you all have a great holiday season and here’s to a bright WPF New Year!


The .NET Rollercoaster

By Richard Morris, Posted on November 24, 2010 at 1:28 pm

Sometimes my job feels like I’m on a rollercoaster with some great highs and some scary lows, and the adrenaline rushes between the two. Version 9.5, complete with the Visual Studio integration with Synergy, was officially released yesterday. I’m sure I was not the first one, but I was straight to the resource centre at www.synergex.com to download and install 9.5. The installation went without issue and we were ready to begin to build our CRM application.

The first task was to rebuild our existing Synergy routines using the Synergy 9.5 DBL compiler. This new version has tightened things up even more and the compiler found another subscripting error which was duly fixed! Things were looking great – the rollercoaster car was slowly making its assent.

The next step was to build our Visual Studio projects and run the new CRM application. The builds completed and the car was teetering on the brink. But what goes up must come down. With that stomach in the mouth feeling the car came spiralling down from the dizzy heights. Our CRM didn’t run quite as we’d hoped. Now don’t get me wrong. I’m extremely impressed with the release of 9.5 and the integration with Visual Studio. Just the ability to build code written when Bill Gates was a lad in this environment is testimony to the strength of Synergy. But this is a brand new release and I’m pushing it to the limit. This is no “Hello World” development!

Now the customer wants a new CRM, and I’m determined to complete the job using Synergy. And so a new plan was hatched. Why can’t we use Synergy/DE and Workbench to build the program to host our new UI? We can use the .NET API to achieve this, and we know all the existing routines work because they have been executing the code for years. So straight away we have half of the application in Synergy, written and working. Given that the problems we were having with the Visual Studio side of 9.5 centred on arrayed fields, changes that have been made to the way error trapping works, and the debugger, why not build our WPF UI using Synergy. And this side of the Visual Studio integration worked for us all day without issue. Building simple class files to expose our Synergy data as .NET types was a breeze with the code snippets available. Some of this code could, I guess, be code generated, but to be honest generating code can strangle the flair of the developer. Plus we only wanted to expose selected fields and manipulate the format of the data to suit our needs.

We soon had our data classes built and the application was returning data ready to expose to our new WPF UI. And this is our task for tomorrow. The car is well and truly back on track and heading for the exciting twisty section of the ride. And I’m still only programming in Synergy. There is not a single line of C# or VB.NET!

So, should you wait before you try 9.5? Certainly not! Download it, install it, and start to build not only your code but your dreams of that new slick looking application – and all in Synergy. I’ll post the results of all our hard work at the end of the week. Please keep all hands and feet within the car and hold on tight to the hand rail. You’re going to love the ride!


RSS

Subscribe to the RSS Feed!

Recent Posts Categories Tag Cloud Archives