www.bsiag.com
 

Snipmatch: a solution for configuring scout properties from the java editor?

Scout comes with powerful tools in the Scout perspective. You have a logical representation of your application in the “Scout Explorer” view and a “Scout Object Properties” view where you can set or change a property for the selected object. A modification in the property view updates the java code and a code modification is reflected in the property view. This allows the developers to work as they want.

Scout Property View

The problem is that power users are not using this property view very often. The explanation is simple: using the view breaks the flow when you are typing code in the java code editor. You need to switch to the mouse, find your current object in the scout explorer and set the properties in the other view.

When you know the name of the getConfigured method you want to set, then you are quicker if you stay in the java editor. The problem is that what the JDT is offering by default is not really what you need in this case. Lets see how Snipmach can help.

With the JDT

If you are in a column’s inner-class you might want to define it as editable. You need to override the getConfiguredEditable() method and return true instead of the default false.

The JDT can help: enter “getCondiguredEdit” and press control space:

Jdt CTRL Space

This works well, but the result is not as efficient as it could be:

Jdt result

My problems are:
* I really do not need the “(non-Javadoc) comment” block.
* The cursor is not at the correct position; It would be preferable to have the cursor in the line of the return statement.
* In this specific case I do not need to call the super implementation at all.
* And the TODO statement makes sense in a lot of cases, but not here.

With Snipmach

Snipmatch can help too. I have defined snippets to handle those cases. They are shared in this git repository. In my column, press CTRL + Alt + Space + the search filter set to “edit”, I can find the snippet I am looking for:

Snipmatch CTRL+Alt+Space

Now when I press enter, there is a big difference with what the JDT override assist function provides:

Snipmatch result

The cursor is where it should be. In the Snippet’s definition, I have defined as first choice the value that will be most likely used at this point (in this case true because the default in AbstractColumn is false). The result is really straight forward.

Just to be clear, I am not complaining about the JDT doing a bad job. We are comparing a generic feature coming out of the box in the JDT and another approach where someone needs to configure the possible snippets. It is normal to have a better user experience with a specific tool because it is a specific use case.

What is missing in snipmatch?

The snippets do not have any metadata to define a context. The consequence is that the search engine is only based on the keyword entered by the user in the search box. It would be nice to be also able to influence the search result depending on the cursor position. I have commented Bug 435632. Let’s hope that the code recommenders team will propose something going in this direction to improve the user experience.

Scout Links

Project Home, Forum, Wiki, Twitter

New Eclipse Scout Homepage

Hi Eclipse Scout Users,

we think it is time for a new Eclipse Scout homepage. The old one is quite outdated not up to date anymore.

Therefore we created a design contest for a new state of the art homepage. It’s been a few days and now we have 3 designs we think are pretty awesome. Since Scout is open-source and a community project, we want to know your opinion. What do you think is the design which represents Scout the best?

Design #1

Design #2

Design #3

 

Vote here!

Please give your vote until Friday, 18th July 2014.

Thank you very much!

Git + Gerrit workflow

I often have to explain the git and gerrit workflow, used by the eclipse scout team, to developers that are used to centralized source control system like svn. One of the big differences is that writing something into the main repository (what svn users know as svn-commit) is composed of multiple steps in the Git+Gerrit workflow.

I created this picture, to represent the workflow:
Read the rest of this entry »

Snipmatch: a better template engine for the Eclipse IDE

I have always liked code templates that can be inserted in the code. In my opinion an IDE providing this functionality helps me to really be efficient when I code.

Few month after having started at BSI (the company behind the scout project), one of my first blog posts on the internal company blog was about the template engine. I wrote about adding a template to instantiate a ScoutLogger. I described how it works and the necessary steps in the preferences dialog to add the scout logger..

BSI Internal Blog

At the Eclipse DemoCamp in Zurich, Marcel Bruch presented “Snipmatch – a better template engine”. Snipmatch will be released along with the Luna release. I was really impressed and I wanted to give the tool a try.

Installation:

Since Snipmatch is released with the Luna release train, it is really simple to install it:

  • Open the “Install new software” dialog (Help menu)
  • Work with the Luna update site: http://download.eclipse.org/releases/luna
  • Set the filter to “Snip” and you will find the desired item.

install snipmatch

Maybe we should add Snipmatch to our Eclipse distribution “Eclipse for Scout developers”. Do not hesitate to leave acomment if you have an idea on this topic.

Usage:

You need to learn a new shortcut: CTRL + ALT + Space (or to bind the feature to another key combination).
This opens a small text field where you can search for a specific template.

snipmatch

Adding new snippets:

Adding new snippets is as simple as with the old template engine. Open the “Snippets” view and click the “Add” button. A Snippet editor is opened. You should enter some metadata and some source for the snippet. The syntax is the same as with the old template engine (see JFace template language). To start writing templates, I also like the approach “look for inspiration in the existing examples”.

snipmatch editor

From what I understood the Code Recommenders team is working on an improved editor. It will provide syntax highlighting, validation and content assist.
There will also be an easy way to create templates directly from your java code editor . Simply select the relevant code and choose“create a new snippet” from the context menu. I think this will help the community to create useful snippets.

Sharing snippets:

In my opinion, one of the killer features of Snipmatch is the ability to share templates in an easy way.Snippets are stored in a git repository. Sharing them is as simple as pushing a text file into a git repository. In order to consume the shared snippets, your team needs to set the URL of the git repo in the preferences dialog. (Preferences Dialog > Code Recommenders > Snipmatch).

snipmatch for scout - git repo

The code recommenders project has prepared a git repo hosted by the eclipse foundation to collect and share snippets. I am sure they will greatly welcome gerrit changes for new snippet contributions.

For the Scout project I have forked this repository at GitHub. I am not sure how we should handle the “Scout specific” snippets. Let us experiment on this fork and we can decide later if it makes sense or not.

Scout Links:

Project Home, Forum, Wiki, Twitter

Eclipse Luna: Scout Cloud Apps

scout_cloud

This article describes the initial cloud support that was added to Eclipse Scout with the Luna release. In the text below, we first motivate our efforts in this area and describe the approach chosen for the Scout framework. Then, the abstraction layer to implement access to distributed caching and messaging is discussed. And finally, we list the necessary requirements for Platform as a Service (PaaS) offerings and provide an overview of suitable public PaaS provider.

 

 

Motivation

Since 2006, when Amazon started its Web Services (AWS) offering, the cloud market has become a growing multi billion dollar market. Following customer demand, many software vendors start to provide their products on a Software as a Service (SaaS) basis. For organisations developing in-house applications, the usage of Platform as a Service (PaaS) offerings can help to significantly reduce time and costs to develop, deploy and operate applications. This is especially true for startup organisations, that need to focus their efforts on their product and the time to market for new features and critical bug fixes. In addition, many PaaS offerings support dynamic scaling by adding additional server nodes when the load on the existing infrastructure increases.

We are convinced that the trend to move applications to the cloud has only begun, and will grow even stronger in the future. With the Luna release we targeted public PaaS providers for Scout’s initial cloud support. This should minimize developers efforts to build scalable Scout applications and to actually run such application in the cloud. And because we know that you won’t be happy to rewrite your application when you need (or want) to change your PaaS provider in the future, Scout’s cloud support works as independent of any specific PaaS as possible. Exactly according to the spirit of Scout’s long term strategy.

 

How to scale Scout Applications

The classical way to scale web applications is to add/remove application server nodes depending on the actual load on the current nodes. Communication between the application’s clients to the server are running over a common load balancer that is distributing the requests from clients to the available server nodes. And the server nodes are accessing a common database infrastructure to store and retrieve data that is relevant to the specific application.

This is exactly the scenario that is supported by the initial Scout cloud support shipped with the Luna release train. As shown in the figure below, a Scout application may now work with a dynamic number of application servers operating behind a common load balancer. The load balancer then distributes incoming client requests to the next available application server. The individual servers then use a common infrastructure to access a distributed cache, the message queue and the data base.

scout_cloud_architecture

Read the rest of this entry »

Eclipse Democamp in Zurich on June 23rd

democamp_zrh_2014_header

We are happy to invite you to attend the 3rd Eclipse Democamp in Zürich on June 23rd. In addition to a large number of excellent speakers and interesting topics, the democamp also features an optional hands-on Scout tutorial before the actual democamp.

Here is our current Agenda:

democamp_zrh_2014_agenda

I’m especialy looking forward to see Sharky flying through an ETH lecture hall

democamp_zrh_2014_sharky

And, thanks to our sponsors, we can again host the democamp at the centrally located main building of the ETH Zurich, enjoy food, beer and have a good time :-)

democamp_zrh_2014_sponsors

 

Eclipse Scout Luna – Milestone M6 – two community driven changes

We announced early this year that we had changed our versioning policy. The milestone 6 of the Luna release train is the first having 4.0.0-SNAPSHOT as version number. As usual, with every new milestone some bugs were fixed and new features were introduced.

Eclipse Luna M6 splash screen

This blog post focuses on two new runtime features introduced with this release. They were influenced by Scout users outside of the company BSI. After having gathered the ideas, proposals were presented in the Scout forum to find out about the opinions of other users. The discussions have shown that there was a great interest in the community. Therefore, the proposed ideas had been implemented. This pattern is healthy for an open source project and we hope that it will continue like this.

Read the rest of this entry »

Meeting with Eclipse Scout users

The Scout team recently had the opportunity to meet its community at two conferences. The EclipseCon in San Fransico, USA and the Javaland in Brühl, Germany.

EclipseCon 2014

It is always a pleasure to attend the EclipseCon. It is great to see friends and colleagues of the Eclipse community, to meet new scout adopters and to talk to people that show an interest in what we are doing.

Eclipse Scout Booth (EclipseCon US 2014)

Thomas and Judith presented the new Luna feature on how Eclipse Scout can be used in the Cloud. For this, the Scout Framework has been modified to be able to synchronize Scout sessions across multiple nodes and to handle client notification consistently in such a setup. Great care has been taken to prevent a lock-in on a specific PaaS provider (CloudBees, Amazon WebServices, Cloud Foundry…). For more details, check out this article on TechTarget.

These changes are a good example for the primary goal of Scout: you should be able to focus on your business logic. Technical changes to the setup should not require you to rewrite your application. Instead, the framework should provide meaningful ways to handle such changes as far as possible. For the new cloud support feature this means that the application code remains independent of the fact that the server is running on a local server, on in-house server clusters or an external PaaS infrastructure. The only thing that needs to be changed is the final packaging of the target platform. Depending on the target, the generic services appropriate for that specific platform are included in the WAR file to be deployed.

Eclipse Scout in the cloud (EclipseCon US 2014)

JavaLand 2014 (Germany)

JavaLand is a new conference organized by the different JUGs member of the iJUG federation (JUGs from the German speaking countries). For this first edition, 800 people attended the conference.

On the first day, one of the 7 tracks was dedicated to Eclipse. The Eclipse foundation has selected talk to give an overview from what currently happens in the Eclipse world (JavaFX, internet of things, long term support…).

With the Scout team we happy to take this opportunity to start to present Scout to an audience of Java developers that do not typically attend Eclipse events. We quite liked what we saw and learned at Javaland. So it’s very likely that Scout will start to show up regularly on Java conferences.

Eclipse Scout booth (Javaland 2014)

“Ignore Issues on Multiple Criteria” in SonarQube

I am currently helping a customer to setup a configuration of his SonarQube instance in order to monitor the code of a Scout Application. SonarQube is a great tool to monitor code quality continuously and to fight against technical debt.

SonarQube Logo

We started with the default set of rules (called “quality profile” in SonarQube). This was done because we trust the SonarQube team that knows what is important when it comes to the quality of a Java project. Additionally, the source code that we consider to be acceptable should not be marked with any violations when analyzed with SonarQube. On new projects, if you cannot maintain a zero warning state, over the time nobody will look at the error dashboard anymore. The team treats each new violation as false positive, and at the end the quality of the code will decrease.

We had a problem with rule squid:S00112. This rule ensures that generic exceptions are not thrown. This is a good principle, but we got violations of this rule in each Activator classes in our code.

Read the rest of this entry »

Dynamic Working Sets: another way to define working sets

While working with the workspace containing the Scout demo applications, I have a lot of projects inside. The Scout Explorer presents a logical representation of each application. However, to access some files (like the MANIFEST.MF file) you have to use the Package Explorer View.

Explorer Views

A possibility is to group the projects corresponding to one demo application into a separate working set.

Of course you can work with PSF files (we have started to propose PSF files for each application), but there are still a lot of manipulations needed to import them correctly into the workspace. (See our current how to Download and Run Locally the Scout Demo Application).

During the last EclipseCon Europe I was told that a couple of good tools were provided by the CDO project. Dynamic working sets is one of them. It allows to define rules, to assign projects into a working set. Rules are based on predicates describing the project (name, pattern, nature, builder, file …) and logical operator predicates (and, or, not…).

Read the rest of this entry »