Monday, April 30, 2012

What's cooking in the EDT kitchen? - April 30

This is the second weekly blog post designed to let you know what's coming in the next version of EDT.  In case you missed it, read last week's post.

Here's what's been happening:


IDE Usability
  • Refine the EGL ARchive (EGLAR) spec 
  • Update searching and indexing for EGLARs
  • Implement a read-only editor for files in EGLARs
  • EGLARs containing built-in types now include source code
Extensibility
  • Modularize the generators and runtimes
  • Prototype extensible validation
Language
  • Compiler support for foreach loop on arrays
  • Compiler support for 'super' (to access an overridden function or field, or a super-type's constructor)
Other
Matt

Thursday, April 26, 2012

Accessing your database with JNDI

For those not familiar with Java Naming and Directory Interface (JNDI), it's a mechanism in Java for looking up named "things", which can be anything you want. How it works is you define something on the server (for this blog entry, it's a data source for accessing a database), give it a name, and then you can retrieve this object in your application to perform some task with it (such as, use the data source to connect to a database). Not all runtime environments have a JNDI environment defined; batch Java typically doesn't, but application servers do (so use JNDI with your service but not with your program).

When developing a SQL application, there are two main benefits to this design:
  • The application doesn't need to know how to get to the database.
  • Most data sources support connection pooling, which has significant performance improvements over always obtaining a new connection in your application.
There are two types of authentication for JNDI:
  • Container-based: the credentials are stored in the JNDI definition on the server and applications do not provide any credentials. This is the most common choice, and thus the default setting.
  • Application-based: the application must provide the credentials.
    Note: Not all data sources support application-based authentication! Apache Tomcat's default data source implementation, for example, will throw an error if you try to use it.
So, how do you use JNDI in your EDT application? The best way is to use a resource binding. By default, we will enable JNDI for the SQL resource binding:


The JDNI settings are visible when you select an SQL resource binding in the Deployment Descriptor editor. You can change the name of the data source of the type of authentication that will be used.

The code that you write does not care how the connection is being obtained, those details are left to the deployment descriptor. A quick snippet for connecting to a database and adding a new row:

ds SQLDataSource = SysLib.getResource("binding:DerbyConnection");
add newRecord to ds;

Normally the JNDI configuration in your deployment descriptor is only used by the client application for obtaining the data source from the server, however if you are deploying to Apache Tomcat then we will also define the data source for you. If you are deploying to any other server type, you will need to define the data source on the server yourself (refer to the server's documentation for how this should be done). The reason we cannot do this for any type of server is that there is no standard for how to define the data source, the standard only covers how to access defined objects; every server does it differently.

I'll leave you with a tip: the IDE test server does support JNDI, but if you want to add connection pooling support to it then all you need to do is define an Apache Tomcat runtime at Window > Preferences > Server > Runtime Environments to take advantage of Tomcat's connection pooling support.

-Justin

Monday, April 23, 2012

What's cooking in the EDT kitchen?

As we're incubating the EGL Development Tools (EDT) project, we want to keep everyone informed of our progress. We just finished EDT 0.8.0 (see our earlier post), and have started work on EDT 0.8.1.

We're trying to make it easier for more people and companies to use and contribute to the EDT community. You can find high-level plans on our wiki, or query Bugzilla for a low-level view which shows all of the enhancements currently planned for 0.8.1, though the list will grow during the lifetime of the release. (You can add the Target Milestone to the results using the Change Columns link below the list.)  We realize reading through Bugzilla query results isn't everyone's cup of tea, so we'll also post a weekly progress report (like this post) on the blog to help answer to the question "What are they working on?"

At the moment, we're working on the first of three milestones for the 0.8.1 release. The three main themes of this release are:
  • IDE usability - EGLAR support, source code analysis
  • Extensibility - improved extensibility of the compiler, generators, runtimes, and the deployment process
  • Language - implement more of the language in our generators and runtimes
Here's the list of what we worked on last week. It's meant to be short and sweet, so I don't mention the names of the developers, provide links to Bugzilla, or include estimates of when unfinished work will be done. Also, every week we're fixing defects, answering questions on the forum, writing documentation, etc. so I'm not going to mention those things here.

IDE Usability
  • Design and review the specification for EGLAR support
  • Read RBD's code for EGLARs
  • Investigate EGLAR project explorer
Extensibility
  • Prototype validation extensibility
  • Investigate runtime modularization: split runtimes into functional segments, generators add what is required during generation or deployment
Language
  • Added compiler support for bitwise operators and new types (bytes, time, limited string)
  • Update to content assist for the new types
  • Compiler support for foreach loop on arrays
  • Added bitwise operators, time and limited string types in Java
  • Added a validation check about passing nullable values
  • Work on JavaScript debug's label support
  • Wrote a design for EGLDoc (like Javadoc for EGL)
  • Investigate changing the compiler to keep comments (necessary for EGLDoc)
Other
  • Investigate integrating with new mobile technologies
We hope these weekly reports will help you stay informed about what's cooking in the EDT kitchen and spark your interest to join the other EDT chefs, or at least try out the resulting dish, I mean downloads.

As always, we look forward to hearing from you on the EDT forum.

Matt

Thursday, April 19, 2012

Updating to EDT 0.8 plus some tips

If you have an earlier version of EGL Development tools, either EDT 0.7 or a 0.8 milestone or nightly build, or if you don't have EDT at all yet, then we recommend you get the official EDT 0.8 build. So how do you do that? Well, there's a few ways.

One way is to download the EDT 0.8 all-in-one build from the download page. The all-in-one builds include the Java EE edition of Eclipse 3.7 and the EDT plugins. All you do is unzip and start Eclipse.

If you want to update an existing Eclipse or EDT, another way to get EDT 0.8 is to use the update site url: http://download.eclipse.org/edt/updates/1.0. Be sure this site is checked in the Available Site list under the Help>Install New Software menu. If you added the nightly or milestone sites, uncheck those. When you select the site, EGL Development Tools (EDT) 0.8.0 should appear in the list.

EDT update

And now the tips:

To use the 0.8 level of the Rich UI widgets and Dojo (based on Dojo toolkit version 1.7.2), create a new EGL Web 2.0 project and those projects should be automatically brought into your workspace. You can then retarget the EGL build path for any of your projects to the use these updated dependency projects.

As mentioned in the last blog announcing EDT, there's a few syntax changes that may require you to update your project code, including service definition and binding.

The samples have also been updated to version 0.8. You can get the samples from EDT's Documentation page, http://eclipse.org/edt/#doc. The samples are a good way to learn how to use the various widgets and overall functionality of EGL.

We hope you'll try out EDT 0.8.

Stay tuned for what's coming in EDT 0.8.1.

Theresa, EDT User Experience and Design

Friday, April 13, 2012

EGL Web Developer Tools version 0.8 is available...

... and with it, a proposed motto: "Ease of coding, ease of thought."

Here are some highlights of what's newly available:
  • The service-access mechanism is more uniform. When you develop a Rich UI application, you invoke an EGL dedicated service by fulfilling a two-step process that is characteristic of the language:

    1. Define a binding variable; for example:
         myBindingVar HttpProxy;
    2. Embed the variable in an action statement; for example:
         call MyServiceType.myFunction("abc")
              using myBindingVar
              returning to myResponseHandler
              onException myExceptionHandler;

    The two-step process is in effect not only for service access, but for database access, too. 
  • When you run the EGL deployer to prepare a service for Apache Tomcat, EGL configures the database JNDI detail for you, hiding the complexity.  
  • The IDE has more function:
    • You can use a wizard to write back-end logic for maintaining a database. Your investment? A few keystrokes, a few clicks.
    • You can use a wizard to create an external type. In this way, you can more easily reuse Java code in your application. And you can still use a manual process to create an external type from Java or JavaScript code.
  • You can configure the call statement to invoke code synchronously. Here's an example:
   result int;
   myString String = "abc";
   conn IBMiConnection? = 
         SysLib.getResource("binding:someEntry");
      try
         call MyHostProcedure(myString) 
            using conn
            returns (result);
      onException(exception AnyException)
         //handle exception
      end  

For now, the synchronous call statement is available only to invoke an IBM i program from EGL code that is generated to Java.
  • Did I mention support for IBM i?  We even provide a way to access an IBM i program from a Rich UI application.
  • Rich UI itself is improving:
    • To provide better download performance, we've reduced the size of the downloaded code and are switching to Asynchronous Module Definition, which is a standard technology for loading code on the web.
    • Support for Dojo is based on Dojo toolkit version 1.7.
    • Arbitrary data of any type can be stored and accessed by a Rich UI widget, for a more logical pattern of data assignment and use.
The technology is gaining value, whether you need to write spiffy web apps, access enterprise data, or do both. Why not take a closer look?

    Monday, April 9, 2012

    EDT @ EclipseCon 2012


    Last week I attended EclipseCon 2012 in Reston, Virginia, to present the EDT project as part of the Eclipse Hot New Product Showcase. While the EDT project did not win the award for Hot New Product, I did get a chance to talk to a lot of people about EDT, EGL, EDT Web Developer Tools, and Eclipse. If you have not had a chance to attend an EclipseCon, I would highly recommend making the trip.

    To prepare for my trip to EclipseCon, I worked with the team to create a handout that provides an overview of the EDT project. We felt that it was important for the handout to highlight two specific areas of the project; 1) an overview of EGL as a language and the goal of the EDT project to provide an extensible IDE for EGL, and 2) an overview of our first extension, which we have been calling EDT Web Developer Tools.  It was not easy to try and condense all of the information related to these topics onto two pages, but in the end I think we managed to make everything fit.

    In addition to providing the best information in the limited space available, we also felt that the handout should use the same graphical theme as the EDT project web site. We enlisted Rebecca, a graphics designer at ClearBlade, who helped us get the handout just right. Thanks, Rebecca!

    If you get a chance to look at the EDT Overview handout, let us know what you think! Is there anything that you would add or remove? There's a lot of content in EDT now and lots of ideas for the future, so we hope to get people as excited about it as we are.

    I enjoyed the sessions and talking to people EclipseCon. Thanks to the folks who stopped by the EDT table to hear what the EDT project is all about. As always, we would love to hear what you think about the project, so feel free to post a comment to this blog, or on the EDT Forum.

    -Brian