Generating blog posts

  • Random
  • Archive
  • RSS
  • Ask me anything

UML to Java Generator 2.0

The version 2.0 of the UML to Java Generator is finally here! This new release of the generator comes at the same time as the new release of UML Designer.

In this new version of the generator, we are now compatible with the latest release of the UML project. The 1.x version of the generator is still being maintained and improved for those who cannot migrate to the new version of UML and the version 1.0.4 for Eclipse 3.7 has been recently released.

In the version 2.0, you will now have support for components.

image

If your model contains components, you can choose to generate regular Java project or Eclipse-based plug-ins and features for each of those components. Thanks to the exported interfaces and the required classifiers in your model, exported and imported packages will be computed.

image

You will also find a brand new launch configuration where you will be able to configure all the details of your generation much more easily than before. The launch configuration can now be saved in your workspace in order to be able to share it with the rest of your team.

image

We also have introduced support for nested classifiers along with bug fixes.

image

You can find the new version of the generator on the Eclipse Marketplace. If you want to have a look at its source code, you can find it on Github. For questions related to this generator, have a look at its dedicated forum. Don’t forget to suscribe to the RSS feed of this blog or follow me on twitter or google+ for the latest news on this generator.

    • #Eclipse
    • #UML
    • #Acceleo
    • #Java
  • 1 month ago
  • 1
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
Pop-up View Separately
Pop-up View Separately
Pop-up View Separately
Pop-up View Separately
Pop-up View Separately
PreviousNext

The new launch configuration of the UML to Java generator has just been contributed on Github. I believe that with this new launch configuration, the generator feels way more “professional” and it’s easier to manipulate. I am still unsure about the new design to let users customize the generated types so I have not integrated it in the “Type” tab yet.

There are still some improvements that need to be made to the generation, the non-regression tests have to be updated and the documentation must be polished after that the generator will be ready for its 2.0 release.

    • #Eclipse
    • #UML
    • #Java
    • #Acceleo
  • 5 months ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Having fun with Chrome’s APIs

While working on the future Acceleo tutorial that will occurred during EclipseCon 2012, I have to work with several javascript frameworks and with the API of the Chrome browser. Of course, as usual, it’s a nice opportunity to see what can be done with those.

I believe that I can use that opportunity to build a small extension for those who want to find Acceleo related content on internet quickly. I’ll have to work on the design and I hope that I will be able to integrate inside real time news, a good opportunity to have a look at Twitter APIs. Here’s a small screenshot of a first version realized in a few minutes.

    • #Acceleo
    • #Chrome
    • #EclipseCon
  • 1 year ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Quick and dirty maven repository for Acceleo

You want to use Acceleo jars in a stand alone project with maven? You don’t know how to host Acceleo jars in a maven repository? Well, it’s simple:

1- create a local maven repository

2- put Acceleo jars inside

3- push it on github :)

So while I’m waiting for the Eclipse Foundation to put the content of the release train online, I think that I’ll put everything needed for Acceleo on this repository. If you want to use it, have a look at this screenshot.

Right now there are only the jars of the latest build (I’ll have to see if I push the jars of the latest build automatically easily), but I’ll put the different stable release along with Acceleo dependencies. Of course, that’s a temporary solution but if you need a quick and dirty maven hosting solution, it works :)

    • #Maven
    • #Acceleo
    • #Eclipse
    • #Github
  • 1 year ago
  • 11
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

UML to Java Generator for Acceleo

With the transition to the latest release of Acceleo, new generators built with Acceleo 3 are coming on the Obeo Marketplace. Among those generators, you will be able to find the first release of the UML to Java generator. This generator will feature several improvements to the basic UI plugin traditionally generated by Acceleo.

Builder

As an answer to a popular request, this generator will include a dedicated builder and a nature that you can activate on any project. Once activated, this nature will create a dedicated properties file in which you will be able to define which “.uml” model should be “watched” and where the Java code from this model should be generated.

Launch Configuration

image

Regular UI plugin for Acceleo feature an action in the contextual menu to launch the generation. While it “does the job”, it does not provide any customization options to the generation and it can be better integrated in Eclipse. This generator will contain a launch configuration system to let people define multiple configuration for the generation.

image

In this launch configuration, you will, of course, be able to select all the “.uml” model that should be used during the generation and where the code should be generated but you will also have the ability to review and possibly edit the value of the properties used during the generation.

Programmatically

Of course, you can still call the generator programmatically from any Java application even outside of Eclipse.

For those who are interested in this generator or those improvements to the regular UI plugin for Acceleo, you can have a look at its source code available on Github.

This generator can be found on the Eclipse Marketplace and you can use it with the free UML designer.

Edit: more news about the upcoming 2.0 release of UML to Java generator.

    • #Acceleo
    • #UML
    • #Eclipse
    • #Marketplace
  • 1 year ago
  • 13
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Scala based Acceleo launcher

Scala is a great functional and object oriented programming language. It can be very easily integrated in a Java based application. When you create an Acceleo generator, Acceleo generates a Java class to launch your generation easily. You can use this class from any Scala based application without any difficulties but if you really want to have a pure Scala based application, why would you want to manipulate this Java class, why not replace it with Scala?

So while I was still playing with Scala, I’ve decided to create an Acceleo launcher and its matching UI plugin directly in Scala. For those who are not familiar with Scala, not only can you call Java code from Scala, you can also inherit from Java classes and much more. I invite you to have a look at this great language on its official website.

For those of you who were looking for an Acceleo generator to generate Scala source code, you should definitely have a look at this. If you just want to use Acceleo in a Scala based environment, you can find the source code of the Scala based Acceleo launcher and its UI plugin under the open source EPL licence on github.com.

For more information on Acceleo, you can follow me on twitter or google+.

    • #Acceleo
    • #Scala
    • #MDA
    • #Eclipse
  • 1 year ago
  • 3
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Scala generation with Acceleo 3.1

I started Scala few months ago and since then I’m loving it. At the beginning, I’ve started by creating basic Scala applications in order to learn the language and after that I moved to small prototypes that I will present and improve in the months to come.

Quickly I was impressed by the structure of the Scala language and I started to look for a Scala metamodel in order to study the concepts of this language. Without any surprise, I didn’t found anything except a few people who were also looking for a Scala metamodel. Well since I am familiar with modeling technologies, I had to try to create a metamodel of Scala by myself, and you know me, if I have a metamodel, I have to generate code out of it.

This generator uses a PSM to generate scala source code. You can create the Scala model with the good old tree based EMF editor. For those who want to have fun, you can also grab an evaluation version of Obeo Designer and try to create diagrams for Scala. In less than five min, you can already have a small class diagram editor.

I have mainly focus my work on an Acceleo generator that I’ve recently updated to be conform with the best practices defined for Acceleo and I also switched to the latest version of Acceleo released with Eclipse 3.7 Indigo in order to use some of the brand new features coming with Acceleo 3.1.

You can easily build the generator very easily, thanks to maven and tycho, with a simple command: “mvn clean package”. After that, you will have an Eclipse update site in order to deploy the generator in an Eclipse instance of your choice.

This generator can generate Scala classes, objects and traits as you can see on the following screenshots.

The metamodel, the generator and their source code are available on Github under the open source EPL licence, feel free to test, use or even fork them as you want. For more information on Acceleo, you can follow me on twitter or google+.

    • #Acceleo
    • #eclipse
    • #mda
  • 1 year ago
  • 1
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Acceleo Unit 0.1

It’s been a long time since I’ve worked on the unit testing framework for Acceleo. At that time, I had all the basis for the framework but I was missing some key elements and few hours of work to have a working prototype. Now that Acceleo 3.1 has been released, I had a bit more time to try and experiment and now I do have my working prototype.

First of all, it is still a prototype, as such it is still a bit raw and I have identify several new JUnit based annotations and some other utility operations that I should add to this framework in order to make it very easy for people to test their templates and queries. I also had to fork and override some key elements of the Acceleo engine in order to be able to access some elements of the OCL environment.

I would need new APIs in Acceleo in order to handle unit testing of queries. Since I didn’t want to have to touch any piece of code of Acceleo for this work, I didn’t create those APIs. Right now, I could easily evaluate any template containing a file block but with my fork of some Acceleo components I can now test all templates. As you can see in this screenshot of the unit test and the previous screenshot, I can test an Acceleo module compiled or not, in the workspace or in a plugin and with an EMF based model that also can be located pretty much anywhere too.

The method annotated ”modelElements” is a bit long, but it is because I am loading my UML model manually and then iterating on all the available model elements to select the first UML class. You could also use the method annotated “uriFragments” or the attribute annotated “uriFragment” to just give the uri fragments of the model elements that you want to test. So in the end, you can select by hand the model elements that will be used for the test or you can just give their uri and let Acceleo handle the rest. Finally it will even be available in stand alone without any dependencies with Eclipse.

I’ll have to discuss with the remaining members of the Acceleo dev’ team to determine how we could provide the necessary APIs for this framework but rest assured I have not forgotten this project and I know that some people out there are very interesting by it and I am planning on improving it a lot with some killer features. By the way, don’t forget to have a look at the new features coming with Acceleo 3.1 that has been released yesterday.

You can find more information on Acceleo on the Eclipse website, the Obeo Network or by following me on Twitter.

    • #Acceleo
    • #eclipse
    • #mda
  • 1 year ago
  • 2
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Using the Acceleo runtime in a Java project

Right now if you want to use the Acceleo runtime in a Java project you have to add the jars of the Acceleo runtime as external jars or even worst, you have to copy them in your Java project. In order to do that, you first have to find all the jars of the Acceleo runtime and their dependencies in your Eclipse installation folder. It is definitely not user friendly.

Looking for the Acceleo runtime dependencies ?

Anyone want to guess the dependencies of the Acceleo runtime ?

The Acceleo runtime will now be available directly from the Eclipse classpath configuration window.

From there you will be able to easily add the Acceleo runtime or even the Acceleo compiler as a dependency of your project.

This new feature will be available starting with Acceleo 3.1.0M7 along with the new syntax coloring preference menu and the OCL/Acceleo operations documentation in the Acceleo editor.

    • #Acceleo
    • #Eclipse
    • #MDA
  • 2 years ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Small details always count.

I was fixing a small bug in the new Acceleo project wizard when I had to create a new Java class. I am creating classes all the time and I am using the new class wizard from the JDT everyday, yet once again an invisible feature of the JDT struck me.

Creating a Java class lasts less than a second, yet the new class wizard of the JDT features a small progress monitor at the bottom. It’s one of those features that change the perception of the response time of the interface by the user. And this kind of things can change everything between a dialog box that takes 1s without responding to complete its task which seems slow and a small progress bar that appears for 1s and by the time you realize that a task is going on, its already over. You don’t know for sure what happened but you know that it was fast.

And one of the main advantage of open source is that if you want to know how they did it, you just have to look at the code. And since, just like last time, I knew where to look for this feature, the project wizard in Acceleo 3.1M7 will feature that small progress monitor.

    • #Acceleo
    • #Eclipse
    • #MDA
  • 2 years ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

From an Acceleo code generator to an Eclipse plugin

Acceleo helps you to create, improve, deploy and maintain easily a code generator. While most of users know Acceleo as an Eclipse plugin used to create a code generators, they tend to forget that the Acceleo runtime can also be embedded in other tools. You can use the Java launcher created by Acceleo to launch the generation of your main templates from any kind of Java application and you can also deploy your generator as another Eclipse plugin very easily. Today I would like to focus this post on the improvements made by Laurent and I on the deployment of Acceleo generators as Eclipse plugins.

First of all, you will have to start by creating your code generator. While doing so, you can see that Acceleo will create several files that will ease the deployment of the generator like “build.properties” and “build.acceleo”. Those files contains all the necessary informations to build the Acceleo project.

When you generator is ready to be deployed, you can create its Eclipse feature. In order to do that, you just have to create a new feature project and then you have to initialize it with your Acceleo project.

Then you can create the update site for this feature by creating a new update site project that will be responsible of the deployment of the feature created earlier. When your update site is done, you just have to click on the build all button. This action will compile your Acceleo modules and prepare them for their deployment.

Finally you just have to make your update site available to your customers. Then, they can install your generator from your update site like any other Eclipse plug-in. When the generator is installed, it is integrated seamlessly in the Eclipse environment. Your customers won’t even realized that Acceleo is used.

    • #Acceleo
    • #Eclipse
    • #MDA
  • 2 years ago
  • 2
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Improved properties files processing in Acceleo 3.1

I’ve just finished working on the new system to handle properties files that will be available in the next milestone, so let’s see what’s coming. In Acceleo, you can create a “.properties” file to store some properties that will be used during your generation. You can see in the following screenshot how to use a properties file in the current version of Acceleo.

There are several steps to respect in order to use a properties file:

  1. Change the “@generated” tag to “@notgenerated” in the javadoc of the method “getProperties()” in the Java class generated by Acceleo for your main module. Otherwise, any changes in the matching Acceleo module will override your modifications.
  2. Add the path of your properties file in the list returned by “getProperties()”. Follow the same convention for the path of the file as in the screenshot.
  3. Well, you have to create the properties file :)
  4. Finally, you have to use your properties in your generator

The main advantage of the properties file is to allow the creator of the generator to configure some details of the generation without modifying the generator. You could for example, have a property to determine if you want to generate the author of a class in the javadoc or to change your naming conventions, etc.

You also have access to a “properties” text area in the launch configuration of Acceleo. In Acceleo 3.0, this text area should not be used, as its behavior is buggy.

In Acceleo 3.1, I’ve improved this system with the help of Goulwen the leader of the EEF project. You can now use “getProperties()” or the text area of the launch configuration without any distinctions to enter the path of a properties file. This path can still be a project relative path like in the previous screenshot but you can also use the absolute path of the properties file (“/home/…./default.properties”). If you want to use a properties file with another kind of path, you can now override “getPropertiesLoaderService(AcceleoService acceleoService)” and you can create an AbstractAcceleoPropertiesLoaderService.

The basic implementation of this class will look for the properties file in your project of at the location of the given path. You just have to implement “alternatePropertiesLoading(String filepath): Properties” to look for the properties file by yourself and then return the matching “java.util.Properties” object. With this, you will be able to look for properties file in a bundle or next to your models with an Acceleo UI project, etc. If you want to handle by yourself the whole process you can override “initializeService(List<String> propertiesFiles)”.

These changes will be available in Acceleo 3.1 M6, available next week.

    • #Acceleo
    • #Eclipse
    • #MDA
  • 2 years ago
  • 1
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Syntax highlighting in folded code for Acceleo

If there is one thing that I’ve learned while using Eclipse and creating Eclipse plugins it is that the devil is in the details. The development team of the JDT is one perfect example of this expression and I’ve seen countless of time in the code of the JDT dozens of lines of code written in order to handle a barely visible feature that seems just natural. You know, those small details that you don’t even consider as a feature, because they are just… there.

One of those features stroke me yesterday, you may never have realized it but in the JDT, when you are using the code folding mechanism (by collapsing a block of code) the Java syntax highlighting is available in the hover pop up of the folded code. Since I encountered a similar problem while working on the highlighting of the pop up of the Acceleo documentation I knew where I had to look for in order to achieve the same feature in Acceleo. And since I knew how I could do it, well… I had to it of course :)

As such, the syntax highlighting process in the code folding pop up will be available in Acceleo 3.1 M6 next week.

    • #Acceleo
    • #Eclipse
    • #MDA
  • 2 years ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

New serialization option and performance improvements in Acceleo 3.1

Acceleo 3.1 will feature a new option that will allow our user to chose their type of compilation. Right now, Acceleo modules are compiled as XMI resources and in the next release of Acceleo, you will have the ability to compile Acceleo modules as Binary resources.

For those who are not familiar with the serialization process of EMF models, let see how it will improve your live. With the XMI resource serialization, the Acceleo module is serialized in a XML file. In case of problems, you can open or edit it in a simple text editor and you can always check easily the result of the compilation. It is very helpful to debug any problem that has occurred during the compilation, yet it has one major problem: it produce large files.

XMI Resource serialization

On the contrary, the Binary resource serialization will produce an “.emtl” file (a compiled Acceleo module) way smaller than with the XMI serialization but you can’t easily read this file in a text editor.

Binary Resource serialization

Starting with Acceleo 3.1, all Acceleo modules will be serialized as Binary resources by default. Those who want to keep the old serialization system will be able to do so in the properties of their Acceleo project. With this new setting, Acceleo modules will be way smaller and a bit quicker to load. As an example, the Acceleo modules used by the project EEF are 5 times smaller with Binary Resources and the full compilation of the EEF modules is 10% to 15% faster. This new feature will be available with Acceleo 3.1 M6 next week.

    • #Acceleo
    • #Eclipse
  • 2 years ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

Improved occurrences highlighting in Acceleo 3.1

A quick blog post to show the improved occurrences highlighting process that will be available in the next release of Acceleo.

And for those who don’t like this feature, you will now be able to deactivate it just like in the Java editor. You will be able to find these modifications in Acceleo 3.1.0 M6. By the way, for those who missed it, Acceleo 3.0.3 has been released. You can grab it from the Acceleo update site.

    • #Acceleo
    • #Eclipse
  • 2 years ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
Page 1 of 3
← Newer • Older →

Portrait/Logo

About

Stéphane Bégaudeau graduated from the Nantes University of Sciences and Technology and is currently working as an Eclipse Modeling consultant at Obeo in France.

He is the leader of Acceleo, a code generator created by Obeo and now developed in the Eclipse foundation. He also worked on the Mylyn Task Connector for Tuleap.

Twitter: @sbegaudeau
Google+: +stephane.begaudeau

Twitter

loading tweets…

Top

  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile
Effector Theme by Pixel Union