![]() |
|
Published 1997-09-01 Printer-friendly version
This session introduced us to a new concept, coined 'OOP-Lates' by presenter Ross A. Santos. Ross has been an early (and vocal) advocate of the benefits of Object Oriented Programming (OOP), and his presentation put forth his vision of how OOP and Clarion Templates can be combined into a whole greater than their various parts.
Ross is Executive Vice President of X-Gen, LLC; makers of RichX, a full featured word processing OCX which just happens to be heavily object oriented and which comes with a template set which interfaces with the RichX object - do we see a pattern here?<G>
Ross's presentation really covered two areas - an explanation of OOP-Lates, and a more general discussion of OOP, which included two simple example objects for formatting strings and parsing, addresses. The examples were then wrapped in a template to produce an OOP-Late. Ross also used the examples to demonstrate certain OOP programming practices which he favors (and which we'll discuss in greater depth later on).
Ross defined OOP-Lates as follows:
"OOP provides the mechanics for defining processes and data through natural code organization. Templates provide a method to create code, over and over, reducing programming redundancy. But, neither is nirvana. However, when married, these two technologies form one of the most powerful code generation and management tools available: OOP-Lates."
In discussing the benefits and drawbacks of OOP and Templates, he broke it down like this:
OOP - Reduced code, better maintenance and the ultimate in code re-use.
Templates - Reduced coding, dictionary based generation creating the fastest database RAD solution available.
OOP - Requires coding and the knowledge of how things fit together to be productive.
Templates - Creates unnecessary code and can be too specific for generic use.
And his solution? (Bet you see it coming...)
"Defining objects to replace redundant in-line code and then Wiring these objects together through "smart" and "flexible" code generation - effectively marrying the best of both technologies to gain the biggest bang for the buck... OOP-Lates"
And what do OOP-Lates consist of? Classes, Templates, Data and Processes (contained in the Classes) and finally, Interfaces and Wrappers (the exposed bits of the Classes which you use to interact with the Data and Processes in the Class).
Ross used a pair of simple classes to demonstrate how he implements OOP-Lates. The first example was written to allow for special formatting of strings (phone numbers) in cases where the standard CW picture format fails (for example, it blanks a string if the data doesn't match what it expects). The second example allowed a user to type an address into a text box, which it then parsed out and placed the resulting address components into separate fields (and vice versa). A pair of simple templates completes the package, allowing you to set up your program's interaction with the object without resorting to any hand coding.
If you are interested in downloading these examples, they will be made available AFTER DevCon gets over (and Ross gets home) on the X-Gen web site: http://www.x-gen.com
NOTE: These are EXAMPLES to be used as an instructional aid in your quest to understand OOP, Objects and Templates (OOP-Lates). They work, but do not have a lot of the error checking, etc., which would be required to have them do production work...
Copyright © 1999-2008 by CoveComm Inc. All Rights Reserved. Reproduction in any form without the express written consent of CoveComm Inc., except as described in the subscription agreement, is prohibited.
Clarion Magazine ISSN 1718-9942
One year: $189
(includes all back issues since '99)
Renewals from $139
Two years: $289
Renewals from $239