Open Menu

Synergex Blog


Mr Numpty’s hair stood on end. It must be the static!

By Richard Morris, Posted on August 26, 2010 at 8:09 am

One fine day (well, it was raining – it is the UK after all), not too long ago (yesterday), there was a man called Mr Numpty (names changed to protect the innocent).  Mr Numpty was a seasoned Synergy developer and wrote Toolkit applications in his sleep (amazing what Workbench can do for you these days).

This one day, Mr Numpty was browsing the spc.synergex.com web site for the early bird registration form when suddenly his big red support phone rang.  It has a unique ring tone and a strange light appears in the sky, which can be easily seen on the lovely grey storm clouds forming outside his window.  Mr Numpty says to himself “this must be very important” and reaches for his cloak.  Picking up the phone, a rather bemused voice, which he recognises immediately as his uncle, ‘Uncle Joe’, says;

“Numpty my man, things they be strange. My list is looking great, but my data’s in a rage.”

“Is it the new product browser?” asks Mr Numpty.

Uncle Joe replied;

“It is indeed, that’s the one.  ‘Been using it all day, ‘cos it’s so much fun.  The windows are great, and the tabs are a hit.  But when I print, the results are not that great!”

“OK Uncle Joe I’ll take a look” replied Mr Numpty.  He looked through the code but could not see any errors.  He ran the program, and clicked on the tab.  Uncle Joe was right.  The list looked great with all the right data.  Printing from here worked also and the results were fine.  Confused, Mr Numpty pondered and scratched his head.  He scratched so hard his hair stood on its end. From the corner of his eye he caught sight of himself in the mirror.  Wow he thought. My head looks funny. I must be fully charged with static!

Ping!  Suddenly he remembered a dim and distant UI Toolkit training course, and the voice of a PSG consultant began to haunt him… “Remember the golden rule: The list processor first updates the current non-window data area, processes the request, then returns the current non-window data!”  So something must be corrupting my non-window data, but only sometimes. 

Taking a closer look at his list routine he noticed his problem.  The data being passed to the list processor was defined as ‘stack’.  This means that each time the routine is called the data area is created, and the contents undefined.  Calling the routine for the first time creates the list, which is correctly loaded from the load method.  By clicking on other tabs means we leave the list routine.  Clicking back on the tab containing the list causes the list record area, defined as stack data, to be created with the contents undefined.  When this is then passed to the list processor the non-window data will be updated with this undefined data.  Visually, everything will look fine, but the data used by the program will be corrupted.

Taking inspiration from his static hair style, Mr Numpty changes the record declaration to ‘static’ and his program now fully works.  He updates Uncle Joe’s computer.

“Numpty my man, it all looks swell.  Now can we filter and sort the columns as well?”

Mr Numpty thought for a moment, “I’m not sure how to do that, but it sounds like a great idea.  Now where was I?”  Mr Numpty continues to complete the spc.synergex.com early bird application form, wondering if this year’s conference will give him the knowledge to give his uncle the features he wants.


Blunt Pencil?

By Richard Morris, Posted on August 2, 2010 at 10:22 am

I guess all jobs have their perks. This week visiting the office in California, in July, is certainly one of mine. OK, so being stuck in an air conditioned office all week is not exactly lapping up the sunshine, but today is Saturday and I’ve been loaned a bike!  Now, when I say bike, let me explain. It’s kind of like a laid back Harley Davidson Fat Boy with thick tires, wide handle bars and a thick padded seat. That’s where the resemblance with a Harley ends I’m afraid. There is no chrome laden chassis, or thumping V-twin engine, just two pedals, powered by my spindly and pale English legs! It’s certainly no wheelie machine either. Actually it’s quite a cool ride, just totally out of place against all the racing style cycles I found myself among while cycling along the great American River towards Folsom Dam. But I mind not. Those spandex and lycra clad enthusiasts take it far too seriously! I was simply out for a great ride through some stunning scenery.  

So, MP3 player blasting in my ears I boldly set off on my adventure. I made sure it was only the guys on the ultrafast slick racing bikes that overtook me, but the trouble was, everyone seemed to be on a slick racing bike, honest! I still can’t explain how the walkers got past me though. I’m sure they were taking short cuts!

Undaunted, I pedelled on. Some of the downhill sections of the cycle track may well have been enjoyed at slightly more than the 15 mph speed limit – no, not me officer! Some of the rather tight corners were taken pedal down (similar concept as knee down, just at a more sedate pace). Big smiles all round.

And then the inspiration came to me! My MP3 player has a very varied collection of tunes from many different decades and genres. I regularly add new CD’s to see if I like what I hear. One new song had a lyric from which my inspiration was born. “Like a pencil, old and blunt, I’m writing in a bolder font”. I thought, "ya, how true!".  There is nothing worse than trying to be artistic with an old blunt pencil that smudges as you scribe. So, is this what I’m trying to do with Toolkit? Recent posts on Synergy-L continue to highlight the challenges we all have with fonts and colours, trying to make our applications look cool, modern and saleable.

So maybe it’s time to sharpen our pencils, utilise the new capabilities in Synergy 9, and begin to incorporate new slick UI’s into our existing applications. This is my focus for SPC2010 in October. I’ll present the tools and techniques we can all use to implement new, modern interfaces within our existing and proven Synergy applications.

My adventure is over now and I’m back in the office. Now, where is my pencil sharpener?  It’s time to give ChronoTrack a new lick of paint.

Not convinced? Then why not rise to this challenge…  Send me all the code and data required to build and run a sample element of your application and, in return, as long as you’re at the conference, I’ll demonstrate your same code running with a modern UI. And did I mention that it doesn’t have to be a toolkit application?

Glossary of terms. Wheelie: The act of raising the front wheel of your bike, in a controlled manner, while propelling your bike forward at high speed. In my case: always unintentional and usually with painful and expensive results! Knee down: The art of skimming your knee close to the tarmac while engaging a perfectly executed cornering manoeuvre. In my case: falling off!


Application Design Model

By William Hawkins, Posted on November 24, 2009 at 4:39 pm

During the past few years, the process of designing an application has gone through another revolution of terms.  When I started out in computing, data was in records and you wrote programs that have subroutines to perform repetitive tasks.  Then there was the short-lived  foray into 4GL’s,  More recently with the introduction of OO-based languages,  we had to learn about data in structures, instance objects, methods, enumerations and a whole host of new terms. At the same time, we got into client/server and N-tier application design.  Mostly, these were just variations on what we were already familiar with, although making the most out of the new terminology can require a new way of thinking.  In the past few years, the way you design applications has sort of been through another evolution.  I say “sort of” because what’s happened is that some new terms have entered common usage.  One of which is design patterns.  Design patterns are just what they say, a pattern that you use when designing an application.  They define/redefine some of the practices that we have been following for years.   Two design patterns I want to highlight are MVC and MVVM.

MVC is Model-View-Control.   This is where the Model (business logic & data) is separated from the View (what you see) and the Controller (dispatch logic).  The Controller monitors both the Model and View components, and acts as the communicator between these two components.  When you are using a well- designed UI Toolkit application, you’re probably using a MVC design.  If you have your real business logic abstracted away from the UI Logic (which UI Toolkit doesn’t really help you implement), you have the Controller logic separated from your View, which is part of the MVC pattern.  At a very simplistic level, the Synergy UI Toolkit List processor is the controller part of a MVC pattern, the load method is the Model and the list window is the View.  The UI Toolkit code is partially agnostic to the actual data being processed – you just pass it the data as a parameter and the forms processing inside UI Toolkit takes care of the rendering of the data on screen.   In a recent project, I created wrappers for the Synergy UI Toolkit logic in order to implement a formal MVC design, such that almost all of the logic required to drive the UI was abstracted into standard routines. So as far as the application developer was concerned, all they had to provide were the window scripts that defined the View, and the various business logic routines that were registered with the Controller.

MVVM is Model-View-ViewModel.  This is a variation of the MVC, where the controller is replaced by the ViewModel.   The ViewModel component instantiates instances of the Model component and it exposes public properties that the View component consumes. In a MVVM design, the Model is oblivious to the ViewModel and the View, and the ViewModel is oblivious to the View.  MVVM seems to be the design pattern of choice for WPF applications, and was used by Microsoft when they developed Expression Blend.  Because the View is separate to the ViewModel and Model components, it’s really easy to apply a new skin to an application that is implemented with this design.   Synergy applications have been moving in this direction since the release of xfNetLink/xfServerPlus, so it’s a natural evolution to consider this design practice when updating the UI of an application.

In addition to the two I mentioned there are other variations in application design patterns (e.g. MVP). In the course of reading up on the various application design models, I came across a reference to a blog by Josh Smith on The Code Project, where he states “If you put ten software architects into a room and have them discuss what the Model-View-Controller pattern is, you will end up with twelve different opinions.” In a lot of cases, you’ll have an in-house design pattern that you’ve been using for years, but as you continue to develop your Synergy application, you should consider reassessing all the available design patterns to determine which pattern is the most appropriate for future-proofing your application.


ChronoTrack goes virtual!

By Richard Morris, Posted on November 20, 2009 at 11:36 pm

Did you attend SPC2009?  If you did then you’ll know all about ChronoTrack.  If you didn’t, ChronoTrack is an application that the PSG team developed to showcase the latest technologies available to Synergy developers.  It’s a UI Toolkit application that’s had a face lift!  It’s a cool, slick web site, oh, and a mobile app, and did I mention the system tray monitor and dashboard?  It uses the latest OO capabilities within Synergy and enhances the user experience by hosting .NET WinForms.  It exposes Synergy data through traditional functions via xfServerPlus/xfNetLink.NET to both a Web Service and fully functional Web site.

One customer, who attended SPC2009, was so impressed with the new capabilities of Synergy that ChronoTrack demonstrated they wanted to present it to their team!  So, I set the recorder going and recorded a ten minute overview video.  And what was the customer’s response?  “Perfect, I’ll be presenting this at next week’s steering committee!”

Fancy a peek?  Take your virtual tour of the ChronoTrack Windows application at http://media.synergex.com/chronotrack/ChronoTrackInAction.html.

There’ll be more videos available soon – just working on topics.  If you have any requests, please let me know by commenting against this blog.

And remember, ChronoTrack is available on CodeExchange, so if you want to see the code-behind, log in to the Synergy resource centre, click the CodeExchange link and search for ChronoTrack.

 

 


RSS

Subscribe to the RSS Feed!

Recent Posts Categories Tag Cloud Archives