Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

EGL (programming language)

From Wikipedia, the free encyclopedia
icon
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "EGL" programming language – news ·newspapers ·books ·scholar ·JSTOR
(January 2017) (Learn how and when to remove this message)
EGL
(Enterprise Generation Language)
DeveloperIBM
LicenseEclipse Public License
Websitewww.eclipse.org/edt/

EGL (Enterprise Generation Language), originally developed byIBM and now available as the EDT (EGL Development Tools)[1]open source project under theEclipse Public License (EPL), is a programming technology designed to meet the challenges of modern, multi-platform application development by providing a common language and programming model across languages, frameworks, and runtime platforms.

Overview

[edit]

The language borrows concepts familiar to anyone using statically typed languages likeJava,COBOL,C, etc. However, it borrows the concept ofstereotype fromUnified Modeling Language (UML) that is not typically found in statically typed programming languages. In a nutshell, EGL is a higher-level, universal application development language.

EGL is similar in syntax to other common languages so it can be learned by application developers with similar previous programming background. EGL application development abstractions shield programmers from the technical interfaces of systems and middleware allowing them to focus on building business functionality.EGL applications and services are written, tested and debugged at the EGL source level, and once they are satisfactorily functionally tested they can be compiled into COBOL, Java, orJavaScript code to support deployment of business applications that can run in any of the following environments:

Code examples

[edit]

Program

[edit]

An EGL Program part is a generatable logic part with one entry point. Each Program part contains a main() function, which represents the logic that runs at program start up. A program can include other functions and can access functions that are outside of the program. The function main() can invoke those other functions. Program functions are composed of a set of EGL statements, variables, and constants.

ProgramHelloWorldconstGREETINGstring="Hello,";functionmain()myNamestring="John";sayHello(myName);endfunctionsayHello(nameStringin)SysLib.writeStdOut(GREETING+name+"!");endend

Record

[edit]

An EGL Record part defines a set of data elements. In this example, a record with the nameCustomerRecord is defined with 6 fields.

RecordCustomerRecordtypeBasicRecordcustomerNumberINT;customerNameSTRING;customerAddr1STRING;customerAddr2STRING;customerAddr3STRING;customerBalanceMONEY;end

EGL has a specialized type of record calledSQLRecord 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 recordEmployee is bound to a table (or view) namedEmployee.

Service

[edit]

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.

packagecom.mycompany.services;serviceEmployeeServicefunctiongetEmployees()returns(Employee[])recordsEmployee[0];// define an empty array of recordsgetrecords;// retrieve records from the databasereturn(records);// return the recordsendfunctionaddEmployee(empEmployeein)returns(boolean)tryaddremp;return(true);onException(exAnyException)return(false);endendend
  • In EGL, code is organized in packages (likeJava (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

[edit]

The main component of a Rich UI application is a Rich UI handler part. These parts are generated into JavaScript.

packagecom.mycompany.ui;importcom.mycompany.services.Employee;importcom.mycompany.services.EmployeeService;importdojo.widgets.DojoGrid;importdojo.widgets.DojoGridColumn;handlerEmployeeViewtypeRUIhandler{initialUI=[grid],onConstructionFunction=start,cssFile="main.css"}gridDojoGrid{behaviors=[],headerBehaviors=[],columns=[newDojoGridColumn{displayName="First Name",name="FIRSTNAME"},newDojoGridColumn{displayName="Last Name",name="LASTNAME"},newDojoGridColumn{displayName="Salary",name="SALARY"}]};functionstart()svcEmployeeService{};callsvc.getEmployees()returningtodisplayEmployees;endfunctiondisplayEmployees(retResultEmployee[]in)grid.data=retResultasany[];endend

Web 2.0 with EGL

[edit]

In December 2008, IBM introduced new technology, EGL Rich UI, to simplify the creation ofWeb 2.0-stylerich web applications. This technology simplifies development by hiding the complexities ofAjax,JavaScript,REST, andSOAP from the developer, which enables them to focus on the business requirement and not on the underlying technologies.

Commercial products

[edit]

EGL programming tools are available as an Eclipse-based[2] commercial product, theRational Business Developer and also in the EGL edition ofRational Developer for System z.

EGL is a target language for modernization of legacy applications because of the language semantics affinity with procedural languages and legacy4th generation languages:

  • a set of conversion tools available within theRational Business Developer product provide automated the conversion from older and stabilized IBM andInformix4th generation languages
  • a set of IBM service offerings and complementary products (Rational Migration Extension for Natural, Rational Migration Extension for System i, Rational Migration Extension for CA-products) provide the ability to convert fromSoftware AG Natural,IBM RPG, CA Cool:Gen and CA Ideal/Datacom to EGL

Tools for searching large EGL code bases, comparing individual EGL files for changes, and detecting duplicated code are available from Semantic Designs[3]

References

[edit]
  1. ^EDT (EGL Development Tools)
  2. ^Eclipse
  3. ^"Semantic Designs". Archived fromthe original on 2011-07-16. Retrieved2010-08-13.

Further reading

[edit]

External links

[edit]
Software
Programming languages
Frameworks and
development tools
Operating systems
Licenses
Related
Retrieved from "https://en.wikipedia.org/w/index.php?title=EGL_(programming_language)&oldid=1313000589"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp