Open Menu

Synergex Blog


Beauty and the Beast

By Richard Morris, Posted on June 22, 2012 at 2:28 am

With every advancing version of Synergy/DE we are better armed to tame the beast!  For me one of the biggest beasts in a commercial application is a record lock.  This beast will appear without warning, leave no trace of its being, and always instils rage in the innocent users of the system who encounter it.

Although locking records is a fundamental requirement of any application it is always difficult to explain to a user who has been sat there for ten minutes with a “record locked” message flashing on the screen that “the system is functioning correctly”.  All they want to do is move forward and finish the task in hand.

So who has that rouge record locked?  Which line of code is actually causing the lock?  Is the lock valid?  How long has the lock been there?  If we could answer these questions then life would be so much easier.  So how can we tame the record lock beast?  With Synergy 9.5.3b of course!

If you attended the DevPartner conference in either Chicago or York then you would have seen my presentation “Hooked Line & Sinker”.  During the session I presented the new (and extremely cool) IO Hooks class that allows you to hook methods to the various events that occur around SDBMS data access.  For example you can register methods that are executed every time a record is read, stored, updated or deleted.  And given this capability I demonstrated the beautiful Synergy DBMS Lock Viewer.  By assigning my LockRecorder class to every file opened in update mode (a single line code change to my standard file open routine) I was able to record lock information in a central “lock manager” control file.  The Synergy DBMS Lock Viewer program I wrote then reads this file and displays lock information.

And the real beauty was just today.  Having modified a customer’s application to utilise the LockRecorder class I was able to run the Lock Viewer:

And immediately identify who was locking which records in which programs and how long the locks had been there.  It’s beautiful to just sit and watch the lock information appear and then clear – and when they don’t clear we call the culpritJ.  The usual response was “I just nipped out to get a cuppa”.  Maybe not the users fault, but now I know where to look in the program to see if I can prevent the lock being required.

If you are interested in the example code you can use the “Knock Knock Who’s Locked” tutorial which steps you through the whole process of creating the LockRecorder class and monitoring the lock manager control file.  The tutorial, along with all conference tutorials, can be downloaded from http://tutorials.synergex.com/.


Synergy .NET Without Purchasing Visual Studio

By Steve Ives, Posted on June 20, 2012 at 1:16 pm

It occurs to me that we may have forgotten to tell you about something important … sorry! Of course if you were at either of the recent Synergex DevPartner conferences then you will already know this, but if not then “listen up” because this could save you some money!

The development environment for Synergy .NET is provided by Microsoft Visual Studio. For Synergy 9 we support Visual Studio 2010 Professional or higher. If a developer wants to develop with Synergy .NET then they would install Synergy/DE and Visual Studio 2010, and then install “Synergy Language Integration for Visual Studio” (we call it SLI because it’s less of a mouthful) to add all of the Synergy .NET capabilities and templates alongside the other Microsoft languages like C# and Visual Basic. Many developers already have Visual Studio 2010 so this isn’t a problem … but what if you don’t?

Well … good news! In addition to purchasing Visual Studio 2010 there is also a free solution. It’s called Visual Studio 2010 Shell (Integrated) and you can download it directly from Microsoft. Basically the Integrated Shell is a bare bones version of Visual Studio, with all of the other languages stripped out. It’s not much use on its own, but if you install it and then install SLI … hey presto you have a full Synergy .NET development environment!

If you do decide to try this out then please remember that Synergy .NET requires Visual Studio 2010 Service Pack 1, so you’ll need to install that after installing Integrated Shell, but before installing SLI.

You can download the files that you’ll need from these locations:

Visual Studio 2010 Shell (Integrated)

http://www.microsoft.com/en-us/download/details.aspx?id=115

Visual Studio 2010 Service Pack 1

http://www.microsoft.com/en-us/download/details.aspx?id=23691

By the way, when Synergy 10 is released later this year you will have a choice of two development environments. We’ll continue to support Visual Studio 2010, but we’ll also support Visual Studio 2012 … and there is an Integrated Shell available for it too, but the requirements are a little different. There is also something called Visual Studio 2012 RC Shell (Isolated), and you have to install that before you can install the Integrated Shell.

Visual Studio 2012 RC Shell (Isolated)

http://www.microsoft.com/en-us/download/details.aspx?id=29927

Visual Studio 2012 RC Shell (Integrated)

http://www.microsoft.com/en-us/download/details.aspx?id=29912

By the way, it appears that the Visual Studio 2012 RC Integrated Shell installation may have a problem. I found that it reported errors about missing components when I tried to install it. I also found that if I did a reboot between installing Isolated Shell and Integrated Shell – the errors went away!

If you do decide to play with Synergy 10 (the beta will be out very soon now) and Visual Studio 2012, and we really hope that you all will, remember that Visual Studio 2012 is currently release candidate. When the final product ships later in the year there will be new Isolated and Integrated shells to download and install.


Microsoft Surface

By Steve Ives, Posted on June 18, 2012 at 8:01 pm

Get ready … here comes the big push! Microsoft today announced a new Windows 8 based tablet platform that they are calling “Microsoft Surface” (strange choice of a name, they already had a product with that name and it was literally the size of a table!), and they are boldly claiming that it will rival the almighty iPad. But then again they’d have to say that, otherwise people probably wouldn’t pay much attention!

surfaceDetails are still somewhat “sketchy” but it appears that there will be two initial models, the “Surface for Windows RT” which uses an NVIDIA ARM processor, and the thicker and heavier “Surface for Windows 8 Pro” tablet which uses an Intel Core i5 (Ivy Bridge) processor and not surprisingly will include a significantly larger battery.

You can find Microsoft information about the new device here, and Engadget have a pretty good write-up that addresses the differences between the two models which you can find here.


Microsoft Removes Installer Project Templates from Visual Studio 2012

By Steve Ives, Posted on June 13, 2012 at 8:09 am

Microsoft has recently announced that the various “Visual Studio Installer” project templates that were included in Visual Studio 2010 will NOT be included in Visual Studio 2012. These project templates are used within Visual Studio 2010 to build Windows Installer setup packages for .NET applications.

I’m writing this post because one of the 2012 tutorials that was published during our recent DevPartner conferences was based on using these these project templates; it showed developers how to build an installation package for a simple windows application. I wanted let customers know that the specific mechanism taught during the tutorial will not work in future versions of Visual Studio.

Bear in mind, however, the end result of the tutorial is a “standard” Windows Installer MSI package, and many of the techniques and concepts presented are still very much applicable to building any Windows Installer packages using other products.

Unfortunately there will no longer be any free tools for building installations included with Visual Studio, so developers will likely have to select one of several third-party products (e.g. InstallShield) to build their installation packages.


Synergy/DE On-Line Tutorials

By Steve Ives, Posted on at 7:24 am

During the 2011 Synergex Conferences we introduced several self-paced tutorials that allowed developers to work through various programming scenarios in order to learn new development techniques or become familiar with new Synergy/DE features. In all we published sixteen tutorials last year, and the feedback that we received from customers was very positive.

Because of the success of the tutorials in 2011 we decided to repeat the process for the 2012 DevPartner conferences, introducing another sixteen tutorials covering a wide range of subjects. Again the feedback from customers has been extremely positive.

During the conferences we provided a Virtual Machine pre-configured with the required development tools and data files, but we also wanted to make the tutorials available to a much wider audience, so I am delighted to announce that the tutorials are now available on-line at http://tutorials.synergex.com.

On this web site you will find a brief description of each of the tutorials, as well as information about any prerequisites for each tutorial. Most of the tutorials are completed either in Workbench or Visual Studio, so generally you’ll need a Windows system with a recent version of Synergy/DE (some tutorials require the very latest version), Visual Studio 2010 SP1, and Synergy Language Integration for Visual Studio. There is a requirements page on the web site that goes into much more detail.

The tutorials are downloaded and accessed via a tutorials client application which can be downloaded and installed (via Click-Once) by clicking the install button on the Download page.

Once you installed the tutorials client application it will present a list of the available tutorials. A globe icon to the right indicates that the tutorial has not been downloaded, and a hard drive icon indicates that the tutorial has been downloaded to your system.

Once you have downloaded a tutorial you can double-click on it to view the instructions for the tutorial. If the tutorial includes pre-configured Workbench workspaces or Visual Studio solutions then toolbar buttons provide quick access to those items.

The sixteen tutorials from 2011 are available immediately, and the sixteen new tutorials from the 2012 conference will become available on-line on Thursday 14th June.

We hope that you enjoy the tutorials and find them useful.

Synergex Professional Services Group


I Command Thee

By Richard Morris, Posted on June 12, 2012 at 7:10 am

At the DevPartner conference in Chicago (http://conference.synergex.com) we announced an open source project called Symphony Framework.  The Symphony Framework project is a Synergy .NET based set of libraries that assist with the migration of traditional Synergy cell based and UI Toolkit applications to a native .NET Windows Presentation Foundation (WPF) desktop application.  The concept of the Symphony Framework is to simplify the Model-View-View Model (MVVM) design pattern and make it easy to migrate your traditional Synergy code.

An important aspect of any program is responding to user requests.  In a UI Toolkit program this is typically based on menu entries – even ones that don’t exist and are signalled in code using M_SIGNAL().  A WPF desktop application is no exception and commanding is an important aspect of the program.  In the MVVM model you utilise an interface called ICommand.  This interface provides for three very important elements.  Firstly, a hook, or entry point to be executed when the command is processed.  Processing a command can be assigned to the click of a button on the UI, it could be the navigation event around a list, or even a line of code in your program.  Secondly the ICommand model enables a status enquiry point –where the bound UI control can interrogate the command object and determine if it is enabled for execution.  Generally a UI control bound to a command object will render itself differently depending on the executable state of the command.  For example a button will appear greyed out and not clickable.  And thirdly is the ability to notify the UI control that the executable status of the command has changed, which causes the interrogation of the command object to determine is executable state.

The Symphony Framework exposes a number of command types, the easiest to use is the GenericCommand, which can be found in the Symphony.Conductor.Commands namespace.  This class utilises the ICommand interface and makes coding commands very simple.  You can create individual command objects or one generic command.  Here is an example of defining a generic command within your View Model class that can be bound to any number of UI control.

Firstly, reference the correct namespace:

Now create a private class member:

Now expose a public property which we can bind out UI control to:

Note in this code that if the private mCommand class field is null we create an instance of the GenericCommand class and assign it.  We also define the logic to execute when the command is processed.  Now we can write the event handler:

Notice the routine signature.  The “parameter” string argument will be set to the value you assign to the bound command in the UI.  As an example, here we are defining three buttons which all data bind to the Command property:

By using the CommandParameter attribute we can assign the required “operation” to each bound command.  Now we can extend the logic in our event handler routine:

This example shows you how to easily utilise the GenericCommand class within the Symphony Framework.

There are many more examples that you can review from the Examples Explorer which is available when you install the full Symphony Framework.  If you are interested in looking at the Symphony Framework code and becoming part of the development community search www.codeplex.com for “Symphony Framework”.


CodeGen 4.1 Released

By Steve Ives, Posted on June 7, 2012 at 12:48 am

Recently I announced that our code generator, CodeGen, had been published on CodePlex for everyone to use. Today I am delighted to announce that we have released a new version of CodeGen which includes some significant new features.

It is now possible to generate code which is based on information drawn from multiple repository structures, which makes it possible to generate many more types of routines and classes than ever before.

Also we have added the ability to launch code generation based on a repository file definition. CodeGen will make any structures that are assigned to the file available to the template when generating code.

We’re now starting planning for the next release. CodeGen can already be used to generate code for Synergy Language, C#, Visual Basic and Objective-C, and one of the features we’ll be adding in the next release is data type mappings and new field loop tokens for the Java language.

For more information about CodeGen refer to the CodeGen site on CodePlex, which you will find at http://codegen.codeplex.com.


LinkedIn Passwords Hacked

By Steve Ives, Posted on June 6, 2012 at 7:27 pm

It is being widely reported today that password information from the social network site LinkedIn has been compromised. It is currently unclear at whether matching username information (email addresses) has also been compromised.

I STRONGLY recommend that LinkedIn users change their passwords as soon as possible. And if you are in the habit of using the same password on multiple web sites, many of which use an email address as a username, then I would recommend that you change your password on those other sites also.


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