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

    Tuesday, March 27, 2012

    IDE test server overview

    One of the goals of EDT is to let you test your applications without having to configure and deploy to your target environment. However, we must also use care not to alter the behavior of the application when in test mode.

    The IDE test server (based on Jetty) is a major player in this regard, allowing you to invoke services from a Rich UI client without deploying them. Not only will the test server run the service right out of the EGL source project, it'll also automatically manages itself by updating configurations when files such as your deployment descriptors change. You don't even start the server yourself - it's started up when needed, and runs in the background. By the way, the server runs in debug mode, so you can set breakpoints in the service and step through the code.

    Now, there are some situations where the server needs to be restarted for changes to take effect. You'll be prompted if this happens, and given the choice to terminate the server now or let it keep running. The most typical case is when the Java debugger's hot code replace fails (e.g. you modified a part but the generated Java code contains a type of change that the Java debugger does not support "swapping in", such as a new global field).

    I mentioned previously that the server is started automatically, and an important addendum is that the server instance has a "base project", which dictates the classpath, the list of available deployment descriptors, etc. When invoking a service, one of the following rules is used to determine the "base project":
    • When invoking a dedicated service, the project of the main Rich UI handler is the base project.
    • When invoking a REST service, the project containing the service is the base project.
    This allows us to best match the deployed environment. If you open the Debug perspective, the Debug view will list all the test server processes. The process name will indicate the "base project" of that particular server, and there is only one server process per base project. You can use this information to terminate a specific project test server. (Once killed it'll get started back up automatically the next time it's needed.)

    Before I go, a couple tips:
    • When invoking a dedicated service, make sure the project containing the service is on the Java Build Path of the Rich UI project.
    • To invoke a service in a RESTful way, the service must be listed as a REST service in the deployment descriptor, otherwise it will not be exposed as a REST service (this is to match the deployed application's behavior). Then to use the test server instead of trying to invoke the deployed service, use the following workspace URI format for your REST binding: workspace://myServiceProject/myPackage.myService. If you use the 'http://' URI format then the test server will not be used.
    • If you're using JNDI database access in your services, you can benefit from connection pooling (which provides a significant performance boost) simply by defining an Apache Tomcat runtime at Window > Preferences > Server > Runtime Environments. Otherwise it'll still work, but will run slower.
    And if you're a developer looking to extend EDT, the test server can also be extended to support new concepts (information on this can be found on the wiki).

    -Justin

    Tuesday, March 20, 2012

    EDT 0.8 Milestone 3 now available

    The third and final milestone build for EDT 0.8 is now available for download. Check out the new and noteworthy page to learn more about this milestone.

    To install EDT 0.8 Milestone 3, you'll need to add the Milestone Build site to your Available Software Sites list under the Help>Install New Software menu option. We suggest you call the site "EGL Development Tools milestones". The site URL is: http://download.eclipse.org/edt/milestones/1.0/

    Once the milestone site has been added (which you may have done for a previous milestone), using Help>Check for Updates should find the newest milestone build.

    With this milestone, we've completed all the new function being added to EDT 0.8. We're pretty excited about the content! We'll be testing over the next few weeks. We welcome you to help the test effort! If you find a bug, you can open it in Bugzilla.

    As always, we welcome your feedback and questions on the EDT forum.

    Changes to the String type in EDT .8

    In EDT .8, the String type has been changed from a Value type to a Reference type.  (More information on Value types and Reference types can be found on the EDT Language Overview Wiki page) .  In general, this change will not have an impact on existing EGL code, but it is possible for existing functions to behave differently at runtime if they specify a parameter of type String, and do not specify an explicit modifier (i.e. 'in', 'inout', etc).

    In EDT, the default modifier for a Value type function parameter is 'inout', which means that the original value is passed to the function parameter, instead of a copy, and any changes made to the parameter in the function will be visible to the caller of the function.  For example:


    function func1()
      var1 int = 2;  // int is a Value type
      addOneFunction(var1); 
      // var1 is now 3
    end

    function addOneFunction(param1 int)
      param1 += 1;  // Add one to param1
    end


    In EDT, the default modifier for a Reference type function parameter is 'in', which means that a copy of the value is passed to the function parameter, and any changes made to the parameter in the function will not be visible to the caller of the function.  For example:


    function func1()
      var1 Decimal = 2; // decimal is a Reference type
      doNotAddOneFunction(var1); 
      // var1 is still 2
    end

    function doNotAddOneFunction(param1 Decimal)
      param1 += 1;  // Add one to param1
    end


    Now that Strings are Reference types in EDT, code that used to rely on the default behavior of the 'addOneFunction' will produce different results, similar to the 'doNotAddOneFunction' function, if an explicit modifier is not specified.  For example:


    function func1()
      var1 String;
      modifyString(var1); 
      // In EDT .7, var1 would be "Modified String"
      // In EDT .8, var1 will now be ""
    end

    function modifyString(param1 String)
      param1 += "Modified String";
    end


    To resolve these issues, you can add an explicit modifier to the function parameter:

    function modifyString(param1 String inout)


    Additional information on Reference types and Function Parameters
    When a reference type is passed to a function parameter using the 'in' modifier, a copy is made by allocating new memory for the parameter that points to the same memory as the value being passed to the function.  If you assign the parameter a new value, only the memory allocated for the parameter is updated to point to the memory used by the new value. 

    When a reference type is passed to a function parameter using the 'inout' modifier, the parameter essentially maps to the same memory as the value being passed into the parameter.  If you assign the parameter to a new value, the value passed into the function is updated as well, since the parameter represents the same memory as the original value.

    -Brian

    Tuesday, March 6, 2012

    I say Snippet...Snippet Good

    One of the goals of the EDT project is to provide a large collection of source code examples, known as snippets, that show how to complete various tasks in EGL. These code samples can be very useful for someone that has never written an application in EGL before, and they can help experienced EGL developers remember how to write an infrequently used operation, or educate themselves on previously unused parts of the language.  The current collection of EGL snippets can be found on the EDT Code Snippets wiki page, which is conveniently broken down into sections on; EGL native types, user defined types, statements, database access, services, and Rich UI development. 

    While most snippets are only a few lines long, and describe how to use a particular statement or type found in the EGL language, there are some snippets that describe higher level concepts that are often used in a typical EGL application.  An example of a small snippet is the following, which shows how to declare a new Dictionary with some initial values:

    http://wiki.eclipse.org/EDT:Declaring_data#Values_of_type_Dictionary

    An example of a larger snippet, which shows how to load multiple rows of values from a database, can be found in the section on working with a database:

    http://wiki.eclipse.org/EDT:Working_with_a_database#Getting_multiple_rows_with_one_statement
    While there is a lot of content on these pages, there is always room for more!  If you have a suggestion, feel free to post a comment to this blog entry, and we can see about adding it to the collection.  Better yet, if you're an Eclipse member, you can add the snippet yourself using the instructions found on the snippet page.  Once you see how easy it is to add a new snippet (I added one to the Dictionary section while writing this blog entry and with Devo songs running through my head), you will hopefully find yourself adding many new snippets to share with the EDT community.

    Brian

    Tuesday, February 28, 2012

    EDT 0.8 Milestone 2 now available

    The second milestone build for EDT 0.8 is now available for download.  Check out the new and noteworthy page to learn more about this milestone. In particular, we've added support for JNDI and IBM i.

    To install EDT 0.8 Milestone 2, you'll need to add the Milestone Build site to your Available Software Sites list under the Help>Install New Software menu option. We suggest you call the site "EGL Development Tools milestones".  The site URL is: http://download.eclipse.org/edt/milestones/1.0/

    Once the milestone site has been added (which you may have done for Milestone 1), using Help>Check for Updates should find any new milestone builds. For more information about what's coming in the next milestone of EDT 0.8, see the EDT 0.8 Planning page.

    As always, we welcome your feedback and questions on the EDT forum.

    Two down, one to go!