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!