Other programming languages are no stranger to code re-use, so why should EGL be any different? ClearBlade's EGL Green Code modules provide expedited code, design, documentation, and testing of common application requirements. Our first GreenCode module is a reusable Messaging System
for use by JSP or TUI applications. The module provides dynamic messaging driven by a relational database table, and is shared in the EGL Exchange.
ClearBlade GreenCode Messaging System
Following is the description and usage instructions located in MessagingSystemLib.egl:
DESCRIPTION:
This messaging system retrieves the message text from the database corresponding to the passed in message code. The retrieved text is then expanded with the passed message inserts (up to 5) and passed back along with the message type. The message can contain up to 5 inserts delimited by ~1, ~2, ~3, ~4, ~5.
INTERFACE:
record MessageRec type basicRecord
messageCode string;
messageType char(1);
messageText string;
messageInsert string[5];
end
USAGE:
messageRec.message_code = "MSGCODE";
messageInsert[1] = "insert 1";
buildMessage(messageRec);
messageText = messageRec.messageText;
messageType = messageRec.messageType;
*** Copyright (c) ClearBlade LLC 2008 ***
Comments and experiences, as well as seeing a few collaborative contributions on reusable code from others, would be great to see. The module and database are located in the
EGL Exchange .