** 1 page review / 865 words ** Inside ObjectGEM Mark Wherry looks at this undiscovered jewel for GEM based software development... Programmers write programs to communicate with the operating system using the Application Program Interface (API) layer. Most APIs are written from the perspective of a procedural language such as C, Pascal, or BASIC (with the notable exception of the BeOS API). Calling the API directly within the program usually means that you have to start every project more or less from scratch. Object orientated programming (OOP), developed at Xerox's famous Palo Alto Research Center (PARC) during the seventies, addressed the problem of re-using code and this led to "application frameworks", sometimes referred to as "new APIs". Application frameworks differ from libraries - both include pre-written time saving routines but an application framework also handles the running of the program. This means you don't have to create long event loops or write your own handlers for common user actions. ObjectGEM is an application framework developed by Thomas Much since 1992 and is used to program the Texel spreadsheet application. ** OG_TEXEL.GIF here ** Thomas originally released ObjectGEM as shareware but became disheartened and disillusioned by the lack of support so he's generously released it as freeware in an effort to generate some interest. The main reason ObjectGEM hasn't enjoyed wider support is probably because ObjectGEM is written for Pure Pascal - an object orientated version of Pascal published by ASH. Programmers with preconceived ideas about Pascal should take into account Pure Pascal is based upon Borland's best selling PC based Turbo Pascal and is the only commercial object orientated language available for the Atari platform. ** PURE_PAS.GIF here ** WhOOPs! It turns out that while most of us are comfortable starting with a procedural language, programming with objects is far more natural because we tend to think of tasks at a higher level than we would program them in C, BASIC, or pascal. Objects are instances of classes, which are merely a data type that encapsulates data and the functions that manipulate that data. For example, if you're writing a program to manage bank accounts, "bank account" would be the class, and "Mark's bank account" would be the object. The bank account class can contain many items of data such as the name, address and balance of the account holder. It can also contain many functions or procedures, referred to as methods, that can be applied to that data, such as "new account", "set balance" and so on. So instead of using variables globally within the program, they are encapsulated within the appropriate class which immediately offers two benefits. Firstly, managing values is now much easier and cleaner, and secondly, if all the attributes are self-contained we can re-use this object in other programs. Back in ObjectGEM a typical class would be a window which contains all the handling routines needed for window management including redrawing, moving, iconification and so on. When we tell ObjectGEM we are using a new window, we are creating an instance of the window class which contains, or inherits, all of the necessary code. OOP also enables programmers to override inherited functions with our own code and this ability is essential for the framework to work correctly. For example, although a window class provides a redraw routine it doesn't provide any code because it doesn't know what we want to draw in the window. By replacing the redraw code with our own routine ObjectGEM calls this automatically. Think of ObjectGEM as a skeleton (the framework) onto which you put the flesh (your code) and the body becomes your unique application. Application frameworks are essentially a collection of classes. ObjectGEM includes pre-written classes which include handling for windows, non-modal dialogs, buttons, check boxes, radio buttons, edit fields - including special password edit fields, toolbars, text windows, string collections, and much more. ObjectGEM even includes a selection of useful procedures and functions for animated mouse pointers, INF file management, pointers, string handling, and so on. Closing the deal I'm so impressed with ObjectGEM and this method of programming I've completely rewritten GEMTrade using ObjectGEM and Pure Pascal and despite only a passing acquaintance with Pascal it took less than a week! Using ObjectGEM has put the fun back into my Atari programming - I can concentrate on the main challenge and leave ObjectGEM to add a sparkling finish and save valuable development time in the process. ** BC ** Email: mark@ataricomputing.com ** /BC ** ** boxout ** Where to get it The current ObjectGEM release is v1.5, although in early 1999 version 2.0 should be released complete with English hypertext - courtesy of the TransAction Crew. For more information keep an eye on Thomas's and my own web pages at: ** BC ** http://www.snailshell.de http://www.cix.co.uk/~mark_wherry/ ** /BC ** For more information about Pure Pascal check out the ASH web pages at: ** BC ** http://members.aol.com/ashinfo/ ** /BC ** ** /boxout ** ** OG_TEXEL.GIF ** Texel is an excellent showcase for ObjectGEM which provided the toolbars, bubbles, tabbed dialogs, list boxes and much more ** PURE_PAS.GIF ** Here's Pure Pascal, with its own desktop environment, displaying the complete source code for Hello World using ObjectGEM. It looks complicated at first glance but all the routines to handle windows, iconification, automatic-shutdown, keyboard shortcuts and so on are added automatically by ObjectGEM