Smart or Dumb
Published April 16th, 2005 in Progress, Smart Objects
A couple of years ago, a project I was contracting on took the decision to implement the next release using ADM2 / Smartobjects. I had no influence in making that decision and, frankly, wasn’t too excited by the idea. I’d flirted with ADM1 a few years before that and had pretty much made up my mind that Smartobjects weren’t up to much. This also seemed to be the concensus opinion amongst the luniaries on the PEG at the time, so I was quite happy in my preconceptions. However, a customer is a customer and if that’s the method they wanted to use then, it was time for me to learn the ADM properly.
So, we rolled up our sleaves, we went up the learning curve and got to grips with the ADM, customised some of the functionality and then started building our own Smartobjects, some simple and some very powerful. Like the sub-classed version of the browser which uses overlayed checkboxes to allow users to quickly update logical fields. The system went live, was well received and moved into the maintenance phase. The systems architecture moved on to something more akin to the OE reference architecture and SDOs were left behind.
So, now we’re up to date, and we’ve left Smartobject behind, right? We’ll. actually, not quite. We’ve left the data side of ADM2 behind, that is the SDOs / SBOs, the viewers, the browsers and the update panels. The UI side of ADM2, however is another story entirely. Every new window we create is a Smartwindow, or at the very least a sub-class of the Smartwindow. There are no data related Smartobjects involved, but the windows all end up full of Smartframes, SmartFolders, SmartChoosers, Hyperlinks and other non-data related smartobjects.
We benefit from the standardisation that smartobjects bring to the GUI code – standard hooks for initialisation and destruction, standard paging mechanisms and interface routines for setting and retreiving attributes. We benefit greatly from an object model which can be customised, extended and sub-classed. We benefit from being able to drop on standard widgets with complex functionality without having to involve third party, closed source Active X controls, and we gain all of these benefits without using any of the data aware Smartobjects.
There are some great, third party, free UI controls out there which have been implemented using nothing but the 4GL and wrapped up as Smartobjects, and they can be literally dragged and dropped into any Smartcontainer. The gold standard is Michael Carroll’s Smartpack which contains 10 different feature rich, GUI Smartobjects including replacements for the Smartfolder and Toolbar objects, a %complete style progress bar, tri-state checkboxes and a pop-up calendar. There’s also Sébastien Lacroix’s Treeview Smartobject and my own, much simpler Hyperlink Smartobject, both of which are also free.
So, in summary, don’t think that you have to jump in with both feet to the ADM2. You can, and in my opinion should, consider using only the GUI side of ADM2 and should see real benefits from doing so. Let’s put it this way, if I were starting a new GUI project tomorrow, then I’d be using Smartwindows.