Object-Oriented ABL Techniques

This group will serve as a focal point for discussions, examples, and projects intended to help people utilize the object-oriented language features which became available in OE10.1. The intention is to:
1) Develop established object-oriented design principles in a way that is consistent with a 4GL;
2) Provide OO-based contributions to OERA-compliant architectures; and
3) Assist in the utilization of OO techniques in the context of existing procedural code.
Contributions to this purpose will include white paper discussions, code fragments illustrating techniques, and complete model components to use in building applications.


OEUnit - Unit Testing Framework

=============================================================================

Update:
Project moved to GitHub. Feel free to fork and make changes, and I will endeavour to integrate any pull requests.



Screenshot: OEUnit results from running a simple test case.Screenshot: OEUnit results from running a simple test case.


CollectionClasses and iterating a List

Hey Thomas, can you take a look at this and tell me if this is how you intended for iteration through a List to be done? The objects symbols and childScopes are List objects.

  METHOD PUBLIC VOID addSymbolsDeep(TABLE symbolRecord BIND):
    DEF VAR symbol AS CLASS Symbol NO-UNDO.
    symbols:getNthElement(0).
    DO WHILE symbols:hasNextElement():
      symbol = CAST(symbols:nextElement(), Symbol).
      CREATE symbolRecord.
      ASSIGN
          symbolRecord.symbol = symbol
          symbolRecord.progressType = symbol:getProgressType()
          .

Pdf include

Hi Guys,


OO classes in subversion

I've just uploaded the OO class stuff into subversion, so all the changes and enhancements that are coming can be integrated ;)

The subversion link is svn://oehive.org/oosockets/trunk

Let's see all those updates ...


OO Sockets in OpenEdge

A set of classes and programs to allow you to use client and server sockets in the Openedge ABL


Blood, sweat and oo tears

Man. What a day. I made the stupid mistake of crowing about how I'd written a OO class to use sockets, and how I could post the code. Well, I did have the code, but thought that it would be a good idea to add XML as a messaging type.

Yikes. That was not such a good thing :)

However, it's all done now, and you can download and play from http://www.oehive.org/node/1205.


OO Socket Sample Code

Using sockets with the 4gl and classes is an "interesting" exercise. This book contains examples of how to use classes and sockets for a client and server system. There are examples of how to use the client to connect to a web page and download the source. There is also a client / server system that uses XML to pass messages between the server and clients.

General Principles


The Transformation Triangle

Transformation Triangle: For use in Transformation Triangle pageTransformation Triangle: For use in Transformation Triangle page


Object Attribute Setter and Getter

I was playing with OOP/ABL in v10.1A, when I noticed my class unnecessarily growing because of repeatedly creating set/get methods. Some OOP language I've seen has one liner setter/getter. I thought there should be a way of having "one-liner" (well, not really) as well for 10.1A. :-)

So here goes..enhance if you must..

  /* =====================
      here's the meat!!! 
      includes/SetGet.i
     
      1 - variable name
      2 - data type
      ===================== */
     
  DEFINE PROTECTED VARIABLE {1} AS "{2}" NO-UNDO.
 
  METHOD PUBLIC "{2}" get{1}():

Reflection API in Progress 4GL

Hello! In our application we need some classes to be created only once. I will implement these classes as singletons (with the help of the static keyword in 10.1.C)


METHOD PUBLIC STATIC CLASS CLSBETaskUserBase getInstance():
IF NOT VALID-OBJECT (clsBEModel) THEN
clsBEModel = NEW CLSBETaskUserBase().
RETURN CAST (clsBEModel, CLSBETaskUserBase).
END METHOD.


Phase 2: Stereotypes for Enterprise Architect

To load the Profile into Enterprise Architect, start by loading the datatypes for OpenEdge found here.

To install each set of desired stereotypes, open a project in EA, select Tools from the menu, select Import Reference Data, browse for the downloaded file, select, highlight the dataset for "Stereotypes for OpenEdge Database" or other label as appropriate, and press button to complete. To avoid having to do this for every project, do the addition in EABase or other suitable base project from which new projects will be derived.


OpenEdge Datatypes for Enterprise Architect

As of version 7.1, Enterprise Architect does not come supplied with datatype definitions for OpenEdge. There is a Utility provided by PSC under PSDN Community which includes these datatypes along with other functionality, but there are some issues with that implementation. (Also see this) That Utility does not currently provide the option for loading the datatypes separately from the stereotypes that are also in that Utility and these stereotypes are at variance with the proposed UML Profile for ABL.

Therefore, an XML file is provided here for independently loading datatypes appropriate for use with the proposed Profile. These datatypes should be suitable for any use of EA with OpenEdge. They are provided as open source and so may be customized to taste by any user. We will note differences between the implementation in the Utility and the present implementation as appropriate. All reference to "Utility" refers to the one provided at the links on PSDN Code Share above (also available here).


Create and Configure an ODBC entry for use with Enterprise Architect

The following assumes that Enterprise Architect is being used on a Windows platform.

1. Select the Windows Control Panel | Administrative Tools | Data Sources (ODBC) option. The ODBC Data Sources Administrator window displays. Select the System DSN tab.

2. Click on the Add button. The Create New Data Source dialog displays, enabling you to add a new DSN.

3. Select the DataDirect/OpenEdge SQL or other appropriate Progress driver from the list. The name varies by version.

4. Click on the Finish button. The DSN Configuration dialog displays.


MDG Technology for use with Enterprise Architect

This article is derived from a PSDN library entry called "ARCH–6: UML Modeling with Enterprise Architect" by Phillip Magnay
Last updated Oct 24, 2007 9:12 AM
Click here for the article on the originating website
The original article may have images (or other links) that are not visible on The Hive

Associated with the presentation in this library entry were some demonstration files including some MDG technology to allow reading and writing .df files from within Enterprise Architect. These have been gathered here to make it easier for people to find this regularly requested technology.


Problem with _osprint.p reporting

Hi guys,

I have a problem with printing using _osprint. I does print but the first 9 or 10 characters
of the output is not printed on the paper. What I mean is, if you try to see, those characters
are printed off the paper. Here's how i called it..

RUN adecomm\_osprint.p ( INPUT hWindow,
INPUT vCh_path,
INPUT 25,
INPUT 1 + 2 + 8,
INPUT 0,
INPUT 2,


#
Syndicate content