BasicRecord customerNumber INT; customerName STRING; customerAddr1 STRING; customerAddr2 STRING; customerAddr3 STRING; customerBalance MONEY; end EGL has a specialized type of record called SQLRecord that is used to exchange data with a relational database. record Employee type sqlRecord { tableNames =[["Employee"]], keyItems =[EMPNO]} EMPNUMBER string{ column = "EMPNO", maxLen = 6}; FIRSTNME string{ sqlVariableLen = yes, maxLen = 12}; MIDINIT string{ isSqlNullable = yes, maxLen = 1}; LASTNAME string{ sqlVariableLen = yes, maxLen = 15}; DEPT string{ column = "WORKDEPT", isSqlNullable = yes, maxLen = 3}; PHONENO string{ isSqlNullable = yes, maxLen = 4}; HIREDATE date{ isSqlNullable = yes}; end In this example, the record Employee is bound to a table (or view) named Employee. Service An EGL Service part contains public functions meant to be accessed from other applications or systems. In this example, a service with two functions is defined. package com.mycompany.services; service EmployeeService function getEmployees() returns(Employee[]) records Employee[0]; // define an empty array of records get records; // retrieve records from the database return (records); // return the records end function addEmployee(emp Employee in) returns (boolean) try add remp; return (true); onException (ex AnyException) return (false); end end end In EGL, code is organized in packages (like Java (programming language)) The first function, getEmployees, returns an array of records populated from the records in a database. The second function, addEmployee adds a new record to the database and returns a true or false depending on whether the record was added successfully. RUIHandler The main component of a Rich UI application is a Rich UI handler part. These parts are generated into JavaScript. package com.mycompany.ui; import com.mycompany.services.Employee; import com.mycompany.services.EmployeeService; import dojo.widgets.DojoGrid; import dojo.widgets.DojoGridColumn; handler EmployeeView type RUIhandler { initialUI = [ grid ], onConstructionFunction = start, cssFile = "main.css" } grid DojoGrid { behaviors = [ ], headerBehaviors = [ ], columns = [ new DojoGridColumn { displayName = "First Name", name = "FIRSTNAME" }, new DojoGridColumn { displayName = "Last Name", name = "LASTNAME" }, new DojoGridColumn { displayName = "Salary", name = "SALARY" } ] }; function start() svc EmployeeService { }; call svc.getEmployees () returning to displayEmployees; end function displayEmployees(retResult Employee [ ] in) grid.data = retResult as any [ ]; end end Web 2.0 with EGL In December 2008, IBM introduced new technology, EGL Rich UI, to simplify the creation of Web 2.0-style rich web applications. This technology simplifies development by hiding the complexities of