Devoxx 2011 - Day 4 (cnt.)

Here are two talks reviews from Jan which didn’t made it into our last blog. (But this was not the only hangover this week ;-). Tomorrow we will wrap up things with some personal statements about the whole show. Sorry, for day 5 we didn’t managed to write a single review. Devoxx visitors might guess the reason ;-)

# “Are you talking my language? MPS” by Vaclav Piech and Maxim Mazin (Jan)

This session introduced MPS, a DSL & code generation concept with corresponding IDE implemented by JetBrains (the company behind IntelliJ).

At first several applications already built with MPS (e.g. YouTrack) were shown, afterwards the speakers introduced the idea behind it. MPS is an open source project and stands for Meta Programming System - the basic idea is better leverage of DSLs andusage of their abstraction for standard languages like Java. MPS provides capabilities to build an own DSL on top of any programming language and add it a META layer with tool support by the MPS IDE. Before compilation, MPS translates the code written in the DSL into your target language, e.g. Java. This process was shown by demonstrating an unless-loop (which does not exist in Java) which got translated to an if-statement before execution and other examples (e.g. asynchronous for thread creation). MPS comes with several built-in DSL’s for Java and other languages, e.g. for better collection handling, closures(!) and lots more.

Most impressive was the representation of a decision table in the IDE, which got translated to a proper if/else construct. This means, on source code level you fill a (graphical) table which is much more readable and intuitive than the corresponding if/else construct. The concept is not limited to Java, MPS can be used to provide a DSL layer on top of each language (Groovy, JS, C…). Another use case was presented to show the flexibility of MPS: A workflow rule editor inside of YouTrack, which offers a DSL for rules definition, later on even DSLs for web and database development. The session closed with a showcase, where a company had used MPS to create a DSL on top of C for more safe and easier programming of embedded devices - very impressive!

Wrapping it up, this was a very interesting talk - although I would hesitate to add another layer to application development for a single project. The code generation templates must be developed - could be ugly, if bugs in code generation auto-generate bugs. ;)

“Socializing your Spring applications” by Josh Long (Jan)

Josh Long from SpringSource started his talk with some basics about collaboration and social interaction in the web. API’s are everywhere, quite each service provider has an HTTP or REST API, but integrating with several of them is painful since you have have to wrestle with different concepts and authentication/authorization mechanisms (while most use OAuth).

OAuth

OAuth is an open standard for authorization used by most API providers to ensure proper authorization when accessing functionality over public API’s. The process to obtain an access token is a painful and quite complex process - although OAuth 2.0 (spec not yet finalized, but already partly implemented and used) tackles this and eases OAuth usage. Spring Social was build as an abstraction layer for exactly this topic.

Spring Social

Spring Social enables connectivity with API service providers and comes with a bunch of subprojects for

  • Facebook
  • Twitter
  • LikedIn
  • GitHub

being the most popular ones.

At this point, the talk went deep into the details of configuration and usage of Spring Social to access services and provide authentication/authorization to Facebook and Twitter. The Spring-typical template stuff is provided as known from other Spring projects, although the configuration effort looked slightly more complicated than in standard stuff as Spring-JDBC or Spring-JMS, but I assume this is context-related.

Social Spring Integration

The last part of the session introduced the social network support in Spring Integration. I did not know that Spring Integration already has default endpoints for XMPP, ATOM/RSS and Twitter (built on top of Spring Social) which can be used for social media interaction inside Spring Integration. A quite cool use case was shown where an incoming polling adapter was configured to poll a twitter account periodically for updates inside Spring Integration.

The talk was interesting for everyone who wants to get more familiar with options to ease the interaction with social networks in the Java eco system.

Author: Roland Huß
Categories: devoxx, development
Monitoring-Workshop 2017 12./13.9. Düsseldorf