How would you explain the mechanism of handling transactions in EGL business
component of EGL?
- Transactions begin automatically as needed. EGL has system functions SysLib.commit and SysLib.rollback so you can end your transactions. They affect all work done by your program that happens to be under transaction control. You can commit/rollback changes to databases, certain files and WebSphereMQ queues, and sometimes work done by other programs that your program called. Commits and rollbacks happen automatically in some cases, for example if a program ends due to an error there is an automatic rollback.
- Generated Java invoked by an EJB will use the EJB's transaction. (EGL version 6.x can generate EJBs that wrap EGL programs. This is not available in EGL 7.0 but is available in EGL 7.1. EGL will do a single-phase or two-phase commit, depending on the environment you're running in. See the EGL v7.1 doc on SysLib.commit and SysLib.rollback and EJB wrappers for more information.
Reference Links:
commit(),
rollback()
How would you explain the mechanism to begin a transaction in EGL code ensuring that the transactions are propagated to multiple components?
- By setting the sqlCommitControl build descriptor to NoAutocommit in the EGL Build file, when JSFHandlers begin a unit of work, it does not commit or rollback until it completes although,any/all EGL logic parts invoked from the JSFHandler can commit or rollback.
- Note that in the case of a JSFHandler the run-unit ends implicitly when the JSFHandler Forwards (in EGL) or returns control to the .JSP page.
Reference Links:
JSF handler part,
Working with SQL statements
Are declarative and programmatic transactions feasible in EGL programs?
- Declarative/Programmatic transactions refer to the Spring Java framework. The EGL Buildfiles SQLCommit setting is the equivalent where: Declarative transactions require that you set: AUTOCOMMIT off, and use the sqllib.beginDatabaseTransaction() API and explicit commit/rollbacks are issued. The Spring frameworks Programmatic Transactions are the equivalent of setting AUTOCOMMIT to YES wherein a commit/rollback occurs at the end of each rununit.
Reference Links:
beginDatabaseTransaction()
How are isolation levels supported in EGL?
- Explicit control over SQL isolation is provided in two ways:
- By coding isolation level clause in embedded SQL statements
- By setting the isolation level in the sqllib.Connect().
- You can explicitly connect to a database using the SQLLib.connect system function, or implicitly connect using values specified in the build descriptor. For explicit connections the isolation level can be specified as an argument to SQLLib.connect. For implicit connections you get your JDBC driver's default isolation level.
Reference Links:
connect()
If an EGL developed application is deployed in a clustered environment, what is the support for it? In this scenario, please explain the support for session replication across all clusters in the environment.
- Clustering and session replication are supported through standard j2ee mechanisms.
- Classes are serializable.
- The session object can also be stored in a DB2 database if that is the chosen route to session replication. If not, the standard load balancing and session replication procedures apply.
How do I build and embed a common component for performing an operation on every user request. (i.e something similar to Servlet filters).
- You can create and use servlet filters if you choose to do so. The Faces Servlet acts as the controller in the jsf web implementation and as you would in any other j2ee compliant web app you can add servlet filters to intercept the request and response and modify data being passed back from a page.
Can Ajax be embedded inside EGL generated code?
- AJAX Refresh, Submit and External request control is supported in JSF and EGL. The only EGL’s language element necessary is: j2eelib.getQueryParameter().
Reference Links:
Rational Business Developer v7.1 / EGL Tutorial - EGL/JSF Web Development Powerpoint - shows how to use AJAX with EGL and JSF pages
Can a third party caching library be plugged into EGL code?
- Caching is typically overused and unnecessary in most cases. Functionality like DB caching (DB2) often makes it completely unnecessary. Caching data on the server side of a web application typically overloads the system and is only found to be issues as applications go into production. CICS applications have been performing optimally for years without caches, and in most cases J2EE applications do not require it. Caching of DB accesses is a left over from client server days when the cache existed on each client. Doing this in a web environment on the server side adds way too much state when we should be heading towards implementations which are stateless.
Can java code generated from EGL be edited? If yes, please explain the mechanism to retain the edited code for future code generation cycles.
- Generated code should never be edited. For any specific custom-Java requirements EGL supports externalTypes to Java classes. These are very easy to use, and the preferred way to access support that is not provided natively by EGL.
Reference Links:
Rational Business Developer v7.1 / EGL Tutorial - Foundation Language Powerpoint Slides - shows how to code EGL externalTypes
What is the JDK version of Java code generated by EGL?
- EGL 7.x requires Java 1.4 or higher.
Are there logging features supported in EGL, similar to log4j? Is it possible to use log4j API's in EGL without having a java wrapper class?
- Yes it is possible to use log4js since you will be calling out from EGL to log4js APIs using external types. EGL also has system functions SysLib.startLog (to open a log file) and SysLib.errorLog (to write to the log file).
Reference Links:
Rational Business Developer v7.1 / EGL Tutorial - Foundation Language Powerpoint Slides - shows how to use LOG4J and start/errorLog built in functions
What is the mechanism to handle and traverse back through exceptions across each layer?
- Exceptions are bubbled up from the logic parts (libraries, services etc) to the jsf handler, therefore any exceptions that are thrown can be caught and handled at any of these layers. Furthermore there are three levels of messages that can be obtained from these exceptions. Users can also create and throw their own exceptions with custom messages.
Reference Links:
Rational Business Developer v7.1 / EGL Tutorial - Foundation Language Powerpoint Slides - details the try/onException facility in EGL.
Does data access code in EGL have support for caching mechanisms or mapping tools? Is it possible to use frameworks like Hibernate/TopLink in EGL?
- The EGL runtime provides a robust mechanism to handle things like UOW and connections. In addition to understanding the metadata required to map db tables to EGL sql records. You also have I/O verb level support for cursor and result set handling. Thus there is no support for external framework like Hibernate which are used to make life easier for the traditional java programmer who does not have access to the advantages provided by EGL, and has to manually code all the scaffolding.
Reference Links:
Rational Business Developer v7.1 / EGL Tutorial - Foundation Language Powerpoint Slides - has a deep SQL section, and demonstrates most of the languages functionality
At times, to restrict the over burden of system, threads need to be created in a controlled fashion. Is this supported by EGL code? Please confirm the mechanism for it.
- No. EGL is single threaded and you cannot create multiple threads syntactically through the language. This was expressly created for the procedural programmer (cobol/RPG) etc and the whole idea is to keep things simple. We have not seen any performance issues thus far.
Can the presentation layer of EGL code be embedded with external reports software?
- There are data graphing tools integrated into the JSF components. See the EGL-JSF.PPT for examples of using this. Additionally, you can integrate Jasper reports into presentation layer in a number of ways. Example: From a .JSP page, users could select data rows, and fire off a call to a Jasper to create a PDF out of the data, or chart, and open that PDF in a popup page, etc.
Reference Links:
Rational Business Developer v7.1 / EGL Tutorial - EGL/JSF Web Development Powerpoint,
Rational Business Developer v7.1 / EGL Tutorial - Foundation Language Powerpoint Slides - shows how to create BIRT reports and call them from EGL, and how to use the JSF Chart Component
Is it possible to utilize third party libraries for PDF/chart generation in an EGL application, without having Java wrapper class?
- You will have to again use external types to access these APIs and there could be limitations depending on what is expected as parameters by the methods being called.
Reference Links:
Rational Business Developer v7.1 / EGL Tutorial - Foundation Language Powerpoint Slides - shows how to code EGL externalTypes
Does the presentation layer generated by EGL have multi language support?
- EGL provides an elegant mechanism for supporting Localization, based on the integrated use of Java resource bundles and integration with calls to return the users locale.
Reference Links:
Rational Business Developer v7.1 / EGL Tutorial - EGL/JSF Web Development Powerpoint - show in-depth how to code for the various scenarios (localizing strings, localizing, labels, localizing error messages). EGL also leverages the <f:loadBundle> tag in JSF that allows users to access key value pairs for fields in the page and use the standard mechanism to change the messages based on locale.
XML parsing is made elegant by XPath queries. Can EGL generated code supports XPath type queries in XML?
- EGL does not have an inbuilt XML parser, but third party API’s can be utilized through External Types.
Reference Links:
Rational Business Developer v7.1 / EGL Tutorial - Foundation Language Powerpoint Slides - shows how to use EGL with Xpath queries
Does EGL code support all types of Web Services(RPC/document) with all possible encodings(document/literal)?
- EGL supports creating RPC style Web Services only at this time. The user may choose to either document/literal wrapped (default) or rpc/literal encoding. EGL can consume either RPC style or Document style Web Services. For consumption, rpc/literal, rpc/encoded** (SOAP), document/literal, and document/literal wrapped.
Reference Links:
Rational Business Developer v7.1 / EGL Tutorial - Foundation Language Powerpoint Slides - shows how to create and consume EGL local and web services, and how to consume 3rd party Web Services (through WSDL files)
If an EGL application needs to invoke a Web Service and WSDL file of the target webservice provided, can a webservice client be generated using EGL code?
- Yes. A wizard is provided that takes a WSDL file and produces an EGL Interface part and any required EGL Record parts. Users then invoke Web Service operations using Interface functions. Optionally a Web service binding for the Web Service is added to the EGL Deployment Descriptor.
Reference Links:
Generating EGL Web services - shows how to create and consume EGL local and web services, and how to consume 3rd party Web Services (through WSDL files)
What is all the encryption algorithm supported by EGL?
- EGL has no built-in function to encrypt or decrypt text, but ExternalTypes could be used if you want to hook up with a third-party Java encryption class. During generation, EGL encrypts plaintext passwords (for databases and remote called programs) using the TEA algorithm. TEA is used to encrypt human-readable passwords in the generated code. For real security, passwords shouldn't be hard-coded anywhere. EGL supports many different ways to invoke programs on remote systems. Some of these protocols include SSL encyption of the data passed to/from the called program.
- In addition, for EGL system function, you can use a crypto: prefix on the password fields. When this is used, the function decrypts the password automatically using the TEA algorithm. EGL provides a PasswordEncrypter utility to do the encryption that is run outside the workbench. Search on PasswordEncrypter in the online helps for instructions on how to use this utility
Reference Links:
Encrypting passwords
- Through external type you can support any encryption mechanism
Please confirm a mechanism in EGL to realize all the patterns in J2EE and also few core patterns like factory, singleton, command & decorator.
- J2EE patterns these are very low level and are handled in EGL through a combination of runtime frameworks and coding conventions - JSF handles the controller and view stuff. EGL Services handle the service layer. Implement Session facades as EGL services or programs. Transfer objects are the parameters to the service functions that do automatic handling of XML transformations if necessary. Data access handled as a separate layer through EGL Libraries. Factory is typically not necessary because EGL uses metadata to tell the compiler to create the appropriate implementation code for the target environment. Framework based approaches cannot do this so they have to resort to things like Factory to get different implementations. Facade is just another service or program, and so is Command.
Is there a mechanism to invoke a system from EGL in asynchronous fashion using pub-sub mechanism?
- EGLs support for Websphere MQ. Additionally, EGL offers startCmd() which can begin an asynchronous process although not pub-sub.
Reference Links:
startCmd(),
Rational Business Developer v7.1 / EGL Tutorial - Foundation Language Powerpoint Slides - Shows how to use startCmd()
How do I ensure the traceability from requirement to design and code? As UML class diagrams look a bit irrelevant in EGL context, Which tool supports the bidirectional traceability in EGL process?
- There is Model Driven Development tooling ,that allows users to specify UML class diagrams which can then be UML Class diagrams are the equivalent of EGL sqlRecords.
After application development, if a developer identifies a memory leak. Should it be fixed in EGL code or in generated Java code?
- In the EGL code. The generated Java should never be modified. The generated .Java will have a comment that is the EGL line that produced the Java code providing trace-ability back to the EGL statements. If memory leaks are encountered in the generated Java code, then these should be reported as problems to IBM.
Reference Links:
Generation Guide
To develop a EGL application, what is the ideal machine configuration for developers?
- The same configuration as that for Rational Application developer. 1-2 gigs of RAM, atleast 20 GB hard drive, with enough swap space (1.5 gigs is ideal)
Method names from Java API’s are keywords in EGL 6.0.11. “add” is a method in Java Collection API. When using this method in EGL v6.0.11, the EGL code does not compile. Is this problem fixed in EGL v7.0?
- There is a property named javaName on the ExternalType that allows you to specify the actual java name for the method while the method name used in EGL will be an alias javaName A string (enclosed in quotation marks) containing the name of a variable or function whose name must be aliased in EGL. The usual reason for such an alias is that the Java name is an EGL reserved word, as in the following example: Function nextElement() { JavaName = "next" };
Reference Links:
Rational Business Developer v7.1 / EGL Tutorial - Foundation Language Powerpoint Slides - shows how to code externalTypes, including externalTypes that utilize the JavaName property
Also, “user” is a keyword in EGL. Using this word as a column or table name in our Database becomes impossible. The database design had to be changed to accommodate EGL in the POC. Is this problem fixed in EGL v7.0?
- The column name can be anything you want it to be. If there is a name clash it will occur with the variable name in the data item or record item definition which can be changed to be a different name than the column name. There is no need to change the database design
Reference Links:
Rational Business Developer v7.1 / EGL Tutorial - Foundation Language Powerpoint Slides - shows how to work with SQL that contains reserved words
* Another way of saying this is the field name in the SqlRecord is an arbitrary name. The field in the record contains a property that gives the column name. By default the field name and the column name are the same when using the wizards/SQL Retrieve, but that is not a requirement. For example, the following EGL source is valid for a field in a SqlRecord:
- MyCustomer string {column=”CUST.custno}
- This relationship/mapping will be maintained between the field/host variable name and the column name when the implicit SQL statements are used and when the SQL statements are added when developing explicit SQL statements.
Reference Links:
SQLRecord stereotype
Is EGL v7.0 capable of propagating external API exception stacks? This was absent in EGL v6.0.11. We may have to use external API’s of rules engine, logging, unit testing etc., do these exceptions raised by these API’s propagate correctly to the EGL v7.0 layer?
- Yes, use externalTypes to do this.
Does EGL v7.0 have inbuilt support for commonly used frameworks like the JUnit testing framework, log4J logging framework etc?
- You can use external types to call out, but since junit will call into generated java this is neither ideal nor recommended (since this requires you to understand the generated java). You
are not coding in java and hence using java test frameworks is not the way to go here. You could consider using Rational Functional Tester which allows you to test in both interactive and batch mode. In addition, a preferred option is to code the test framework in EGL itself which would be a good long term solution.
If the UI design involves Tabs on screens, and defined a business rule for enabling and disabling of the same, does EGL have an inbuilt support for handling this design?
- EGL fully supports this and so does JSF. You can enable and disable using simple attributes that are browser agnostic from EGL and it will not affect performance.
Reference Links:
JSF Tab Controls,
Rational Business Developer v7.1 / EGL Tutorial - EGL/JSF Web Development Powerpoint - shows how to use the JSF Component tree and JSF dynamic properties to do this kind of dynamic U.I. work
If UI designs involve collapsing and expanding screens, how does EGL handle this design? This means, a part of the screen can be collapsed on click of a button and can be expanded on click of the same button.
- EGL has tree controls and other typical browser widgets that allow you to do a variety of things on the UI side.
Reference Links:
Using EGL/JSF Component Tree Statements to Determine Which Submit Button Was Clicked,
Rational Business Developer v7.1 / EGL Tutorial - EGL/JSF Web Development Powerpoint - show how to use Tree controls, as well as JSF panel section controls to do this
In case UI design involves opening child windows, does EGL have in-built capability of capturing values from the child window and populating the parent window with the values from the child window?
- Yes, there is a "target" attribute that allows you to open a new window and javascript on the client side can then populate the parent UI component with the selected value.
Reference Links:
Using EGL/JSF Component Tree Statements to Determine Which Submit Button Was Clicked,
Rational Business Developer v7.1 / EGL Tutorial - EGL/JSF Web Development Powerpoint - shows how to create Popup (child) windows through JSF Panel-Group components, and through JavaScript popup pages
Doest EGL v7.0 have Apache as a test server for WebService testing?
Can checkboxes be used to single select in a datatable, instead of using Radio Buttons?
- You can substitute any/all controls in dataTables that are technically feasible (i.e. you can’t assign an array to a single element control, etc.).
Reference Links:
Dynamically Populating a RadioButton Set,
Rational Business Developer v7.1 / EGL Tutorial - EGL/JSF Web Development Powerpoint - shows how to substitute all the standard input control types in a dataTable
Please explain the mechanism to incorporate custom error messages while doing server side validations using EGL. For e.g., the inbuilt numeric validation method has a single error message which is used across the application. How can we customize error messages in similar methods? Please explain the mechanism with sample EGL code.
Reference Links:
Rational Business Developer v7.1 / EGL Tutorial - EGL/JSF Web Development Powerpoint - shows how to over-ride the product-default messages
The Build path in EGL does not pick up the external path specified. The jar file needs to be copied in the WEB-INF/lib folder. What is the process to have external build paths?
- This is a problem with the web tooling, not EGL. The tooling lets you put external jars nto the project's Java build path, but since they're not in WEB-INF/lib at run time the J2EE server can't find them. You can import them into WEB-INF/lib, add them to the EAR as utility jars, or reference them in the server's global classpath.
What is the mechanism to export an EGL project?
- We routinely import entire projects (through Project Interchange Files (PIFs) and project elements (source files and folders). In V7, project interchange files are found as an option under the Export->Other category.
What are the advantages of using record (EGL) over typical OR mapping layer like Hibernate/TopLink?
- There is minimal to no manual work for the programmer when using EGL. You have a lot of scaffolding work and setup work that is needed when using hibernate.
There is no industry benchmarking available for EGL. Is there any benchmarking available with IBM for parameters like performance, footprint generation, response time etc?
- There are informal studies on development gains using EGL. The Branham group study comparing .NET, RAD-Java/SDO/WDO was replicated and the time to develop the apps were compared to that using EGL. It took 251 minutes for RAD/Java, 221 minutes for .NET and 184.5 minutes using EGL. The application was an end to end implementation for insurance quote generation. Elements included web services, multiple database access within, transaction control, deployed on WAS 6.0
Reference Link:
ftp://ftp.software.ibm.com/software/rational/web/reports/Rational_EGL_Tools_Study_20080416.pdf
Can EGL generate a consistent look and feel on various browsers. How can this be achieved? Please explain.
- By defining .JTPL (template pages) – and by embedding standard JavaScript conditional logic in them.
Reference Links:
Creating JTPL (Template) Pages
We know pagination is possible in EGL by simply drag-drop of the control. But apart from that, how is caching supported? Moreover, when we talk about caching, the parallel should be drawn with Java/JEE and NOT with Cobol world. Please explain the mechanism to achieve this.
- One method is to open a cursor and using get absolute <index> statement in the pagination functions and then closing the cursor within the same method. All you will have to do is maintain the index depending on user action this index will be a session variable.
- You are able to write any data to the session so that is available for use after a page is displayed to the end user. Therefore, you could store arrays in Session and use/manipulate for pagination. Care would be needed to make sure that there would not be “too much” data kept in session that might affect performance.
What is the exception propagation mechanism when using ESB/Rule Engine?
- Currently an EGL generated web service can be deployed using an ESB and managed by it. There is no native support for ESB from within the EGL language yet.
Can design patterns be implemented in EGL. How can they be implemented?
- All have to be EGL libraries.
Can EGL handle runtime changes in navigation?
- Configurable Navigation can be done in Programs using Linkage option. DataItems can be used for changing the destination JSP file names depending on the scenarios. This functionality cannot be achieved using EGL libraries.
Reference Links:
Linkage options part
In case of a Build descriptor being deleted, what is the mechanism to restore it? Should a new Build descriptor be created and some of the values be set manually?
- Yes. A new build descriptor should be created, some values will be set by default whereas the others will have to be set manually.
Reference Links:
Editing build descriptor options,
Rational Business Developer v7.1 / EGL Tutorial - Foundation Language Powerpoint Slides - contains a section on creating a build descriptor for a project from scratch
When a new column(s) is added/removed to/from a table in the DB, it does not appear in the Data Access Application(DAA). What is a mechanism to resolve this issue?
- Metadata is not refreshed once created hence a workaround is required for the column to appear in the DAA. Developers will have to manually do the coding for this added/removed column(s) in the JSP as well as the libraries/programs. Another workaround can be to add/remove the column(s) from the generated query. The added column(s) will then appear in the DAA which can be dragged and dropped on the JSP.
Does EGL have an inbuilt property file reader?
- Use the getProperty() to read the property file.
Reference Links:
getProperty().
Rational Business Developer v7.1 / EGL Tutorial - Foundation Language Powerpoint Slides - contains information on getProperty as does the product documentation
What is the difference between sMash and RUI?
- In the end both RUI and sMash aim to support the same thing: data-driven web-hosted business applications. However, RUI and sMash aim for different developer skill sets:
- sMash targets systems developers who want to program "as close to the metal as they can". sMash focusses on "how" you want to do things. That is why Java developers automatically like the sMash solution. I guess you could say sMash is a box of Lego bricks with a blueprint, allowing your to completely build your own solution and programming model from scratch. Fundamentally, RUI itself only worries about building a UI that runs in a browser. If you look at it in just that way, RUI is a much better JavaScript. However, we also call services from RUI that might be done in EGL running on WAS. At that point, the solution starts to look a lot more like sMash.
- RUI is best at hiding the complexities of the underlying languages and runtimes (Java/PHP/SOAP/XML/JavaScript/Dojo). RUI targets business developers that want to solve business problems. RUI focusses on "what" you want to do. I always say that RUI is super glue, relying on existing programming models, runtimes, and platforms.
- RUI can build on top of sMash, which is what the RUI team is actively studying. RUI already runs on WebSphere and uses the current WAS capabilities.
When we develop EGL application, we have option of generating a build in either Java or Cobol. Does this mean source code or object code, because if it is object code, we will have to enhance the application in RBD/EGL for new requirements. Do we need to export the generated source/object module to mainframe or should there be a connection to the mainframe ( Z/OS).
- EGL generates source code for Java or COBOL. When you generate for COBOL EGL additionally generates: compile/link JCL, and there is a process implemented on your workstation to automatically upload the COBOL to a mainframe PDS (partitioned data set...or library). From there you'd the compile/link job a CLIST is file-tailored to include any zSeries options necessary for your environment.
Reference Links:
Rational Business Developer v7.1 / EGL Tutorial - Foundation Language Powerpoint Slides - contains deep section on COBOL generation
We have the batch build option for batch programs, is this specifically for java or can it be used to develop batch programs in cobol?
- Please see the below course section to find the specific build file options for COBOL generation.
Reference Links:
Rational Business Developer v7.1 / EGL Tutorial - Foundation Language Powerpoint Slides - contains deep section on COBOL generation
Does EGL support combo of CICS and IMS/DB or Cobol , DB and IMS/DC?
- Yes - EGL supports CICS/DL/1 COBOL batch and IMS D/C.
We do not see binary or packed decimal datatypes in EGL, would this affect the performance when converted to cobol?
- INT --> Binary (S9(4) Comp.. Decimal --> Packed Decimal S(9xx)v99) in COBOL.
EGL is a fourth generation language to provide independent environment development for Java and Cobol.
What are the other languages /environments it supports?
- EGL only supports COBOL, Java and JavaScript generation.
Does Java generated from EGL to run in WebSphere on system z has any difference in pages representation than the one that run on server?
- No difference whatsover - the EGL/JSF pages run the same on WebSphere across all platforms (from Windows to System z)
Can Java generated from EGL to run in WebSphere on system z call any webservice?
- In theory yes - but in practice, the WSDL spec is sometimes "loosely adhered to" - while WSDL is a standard, there are still some non-standard elements included in the WSDL (like unique .NET extensions).
- In general we can invoke any webservice that we can process the WSDL for and we have customers access non-EGL services from EGL clients
- The main restrictions we are aware of for incoming WSDL or at runtime are:
- Support relative file imports and includes in WSDL files
- SOAP 1.2
- access (if needed..and not all need this) to the soap header and the fault String.
- SOAP over JMS/MQ
Do you know any shops that have EGL generated Java that runs on system z?
Can service generated by EGL on system z (WebSphere) be called by others outside of system z?
- Yes - The whole Services architecture means that services deployed to WAS (or CICS for that matter) can be invoked by outside clients (whereever they run) as long as they know how to create a SOAP request.
Great stuff on one place !
I would like to know how well does RBD integrate with Jazz/RTC.
Especially integration of Jazz/RTC builds with EGLSDK/EGLPREP and build server running on host.
Is it possible to start build server from RTC and retrieve results back to RTC ?
Robert