27 December 2013

Adopt OpenJDK

by Mani Sarkar

Presentation is available online here

Mani Sarkar basically spent some time evangelizing how work on the OpenJDK would benefit both us and the community. Personally I am a strong supporter of the open source community and software, but I don't think I need to elaborate why - those of you who have considered spending some time on open source projects probably already know the reasons why this is good for them and their careers.

Instead I will focus on some of the interesting points made in the presentation and summarize them:

  • What is OpenJDK?
    OpenJDK is the reference implementation of the Java Development Kit, project lead by by the various Java User Groups around the world. It is open source and mostly written in Java, but also C/C++, Assembly, Bash and Awk
  • What can you do with it?
    Since it is open source you can just download and play with it. The code is almost the same as the Oracle JDK, so you can use this to familiarize yourself with for e.g. the JVM, some of the internal APIs and etc.
  • How would you benefit?<>Beside the usual benefits of working on open source projects you could try out the new features such as lambdas, etc. before they are officially released! You could also influence how the language evolves by either providing solutions yourself or participating in discussions.
  • What should you do?
    There are several types of contributions depending on how much involved you want to be, but they range from moderating user groups and testing early access libraries to researching co-routines and etc.
  • You can visit http://adoptopenjdk.java.net/ to see more info or the getting started page to have a quick glance of what you need and how it works.
  • In case you want to just keep informed you can simply follow the newspaper , join their mailing list or follow their twitter account @adoptopenjdk

Have you seen Spring lately?

by Josh Long

Presentation was partially based on this article

Spring have lately been embarking on an entirely new adventure with the Pivotal initiative. Pivotal aims at making the cloud more easy to adopt, building on top of technologies such as Spring, Grails and Groovy. For Spring particulary this means focusing on the mobile, improving the speed of development (one of their core principles from day one) and other technologies that would provide an embedded, one-click experience for the cloud apps.

By the way - Spring 4.0 has reached GA! Most of the things I will list here are connected to it such as:

  • First class Java 8 support. In terms of IDEs - Idea IntellyJ is already there for some time, Eclipse is lagging far behind, but Spring Tools Suite is trying to catch on
  • Have you, by any chance, read about the Richardson Maturity Model of REST services? Spring seem to be embracing this idea and embedding it in the Spring Framework. The Websockets JSR will be supported in Spring 4.0. Not only that but Spring makes sure the solutions you build have legacy support for older and handicapped (I am not saying I am talking about IE, but I am) browsers by utilizing the sock.js framework
  • Check out Rossen Stoyanchev's Webinar replay on building a WebSocket Browser app with Spring. Awesome and easy!
  • Spring have invested quite a lot of time in providing easy-to-use tooling when integrating to the social networking. They've built on top pf AllAuth and improved it. Check out the overview - really amazing work.
  • There is also much talk about Spring Mobile, but I had no time to explore this further
  • Interoperability is another thing Spring are trying to solve. by implementing the concept of profiles - defining profiles of beans would mean they would only be deployed on a suitable platform and thus the app would be able to easily handle different deployment scenarios.

20 December 2013

A Brief introduction to Scala and its Ecosystem

by Manuel Bernhardt

Presentation is available online here

I've always confused Scala for Groovy, but as it turns out they are quite different, and to my amazement Scala is actually awesome (whereas I have a somewhat traumatic experience with Groovy). So what is so awesome about Scala?

  • Scala is fully interoperable with Java and runs in it's JVM
  • Builds on top of it and tries to solve many of the problems, cutting down on boilerplate code and removing NPEs
  • Awesome combination of OOP principles and functional principles in a statically typed language
  • Multicore development was never so easy (unfortunately this was a whole new topic that we barely scratched and still I was very impressed)

The "null" polemic ("The billion dolar mistake" as it's creator Tony Hoare dubs it) is actually very interesting and new for me (never spent too much time thinking about it) and although there are many ways of mitigating, e.g. the Null Object Pattern Scala makes it even easier by removing null as a whole. Kind of hard for a developer that used null so many times to imagine at first but when you see some of the code you'd be amazed how much better it is.

By the way have you checked ThoughWorks's Technology Radar recently? Scala is in the Adopt segment - a strong recognition of it's potential.

Another absolutely radical thing about Scala is it's modularity / extensibility. The example below is taken from the presentation. You can see how one could easily build up a DSL by extending Scala (see image on the right).

And here is a summary of all the things that caught my eye through the rest of the lecture.

  • Macros are calcuated compile time and during type checking, expanding on the AST which is arguably an improvement over Java's generics which are evaluated during compile time
  • There is dependency management, something each self respecting language should have, and it is based on Apache Ivy(as such it could take advantage of any Maven repo)
  • AKKA is the huge actor concurrency model utilized by Scala to easily handle multicore / multithreaded development. A very interesting alternative to using threads it avoids some of the problems they pose and simplifies the model.
  • Play is the web development framework based on Scala and AKKA that has some pretty neat features : it allows for building MVC architecture and everyting is compiled (and by everything I mean everything - JavaScript, CSS, even URLs).

By the way have you read the Reactive Manifesto? Scala tries to allow the developers to follow these principles - in my humble opinion they make sense.

To recap I will list a few of the reasons not to choose Scala over Java (this was the logical question that came up at the end of the session, since it was presented at the Java2Days conference):

  • Do not use it for memory intensive or CPU intensive applications - performance and memory wise running Scala apps is still more demanding than running Java apps
  • Small teams could benefit from the fact that it is very expressive, but large teams would require a lot of discipline otherwise they may end up with spaghetti code

04 December 2013

Java2Days 2014

Dear patient readers, I will be writing a series of overview articles on the presentations I visited at this year's unsatisfying attempt of a Java2Days conference.

As you might have deduced already, the organization this year was, incredible but fact, even worse than last years', but still there was a great deal of excitement, quite a lot of interesting new topics, most notably WebSockets, Open JDK, AngularJS (more than three presentations involved the use of it - is this local, or is this framework really becoming that popular?), Spring 4 goodies and much more.

Here is a preliminary list of the topics that caught my eye:
  • A Brief Introduction to Scala and its Ecosystem - by Manuel Bernhardt
    I was amazed at how much Scala has evolved and the potential it has, could this be my next favorite programming language?
  • Have you seen Spring lately - by Josh Long
    Josh talked about Spring 4, Websockets, Java 8, Pivotal, Spring Social, etc.
  • Adopt OpenJDK - by Mani Sarkar
    The Bulgarian JUG shared how exciting it was to develop the new features of the reference implementation of the JDK and evangelized how beneficial it would be to contribute to this project
  • Real Time with Websockets - by Andrew Lombardi
    Andrew talked about how the idea of Websockets was born, the frameworks that were created and the current browser support
  • Automated Unit Test Generation - by Vassil Popovski
    A good overview of tools and technologies that could help out in parameterized tests by analyzing branching and generating the minimum required test cases to test all possible branches
  • Web apps : a different angle - Web applications in Java with Spring Data, Spring data REST and AngularJS - by Ioan Eugen Stan
    A very entertaining tech session that showed how we can use Spring Data, Spring Data REST, AngularJS, Bootstrap and WebJARS to build a very neat web app
  • Websockets with Spring 4 - by Sergi Almar
    Presented how Spring envisions using Websockets (one of the technologies that were key topics of the conference)
  • Dissecting the Hotspot JVM - by Ivan Ivanov and Martin Toshev
    A somewhat confusing but very interesting deep dive into how the JVM works and some internal specifics
  • Practical introduction to jOOQ - by Lukas Eder
  • The Irresistible Database for Java - in Jar - Nikolche Mihajlocski
The last two lectures were both dealing with the SQL / noSQL polemic, providing a somewhat mixed approach to dealing with the problems of modern databases. Very close ideologies, but somewhat different implementations.

03 September 2013

The future of programming

The most dangerous thought you can have as a creative person is to think that you know what you are doing ...

... because once you think that you know what you're doing you stop thinking about how you need to do it.

Bret Victor - The Future of Programming from Bret Victor on Vimeo.

Visit the talk here

10 January 2013

API Design

by Pavel Penchev

This was one of the talks I was looking forwards to, since I have had the pleasure of talking with Pavel before and I know he has a lot to share on this topic. However I was disappointed that this talk took place in a crowded and hot small room and the words of the lecturer was barely audible. A real shame, but fortunately I was able to catch some of the things he shared with us.

Writing public API as opposed to writing internal API

We have all faced the challenges of writing APIs to some degree - however the problem becomes much more complex once we have to actually sell a public API. Then the design of the code, it's documentation and naming conventions, all of the things we usually consider internal, become part what we would usually expect from our user interface, they became the face of our product.
The topics in this lecure were mostly influenced by two very well written books:

  • "The design of everyday things" by Donald A. Norman - a book that is not strictly focused on software development but on the design of products as a whole
  • "Effective Java" by Joshua Bloch - which is a book that every Java developer should seriously consider reading

"The API is a business card to your company"

Natural mapping

Natural mapping is a design term, that implies that our products, e.g. our public API, needs to be designed in a such a way, that the user would find them natural to use. The first step to achieve this is to build a mapping between the intentions of the users and the way the API is designed. The next step would be to build a mapping between the structure of the domain and the API.
A very crucial point is to use the terminology of your domain. Many times developers tend to look at their code from an implementation point of view and use names such as "SystemEntity", "DOMTree", etc. These names, although accurate, do not translate to the user the purpose of the objects but rather translate the implementation specifics, which is not important to the user.

Mental models

A very important part of building an API is building up a model of each of the objects, their properties and how they interact. Unfortunately at this point I decided to switch to another lecture and my notes are cut of. Also Pavel has not provided his presentation online and I was not able to fill in the gaps myself, so here is where I leave this topic.

"Your code needs to be easy to use, easy to learn, but also hard to misuse"

Footnote : here is a good article by Joshua Bloch that I stumbled upon while writing this blog post on the same topic.