Remove boilerplate code with speaking interfaces

Abstract

From the Wikipedia: "In computer programming, boilerplate is the term used to describe sections of code that have to be included in many places with little or no alteration".

Boilerplate code is hard to maintain and boring to write. It's even difficult to write it correctly, if You don't fully understand its pre and post-conditions, and its motivations. So it's an issue for both junior and senior programmers.

A solution could be the use of code generators, but this approach doesn't solve the maintainability problem and a clumsy programmer can wrongly modify the generated code. This talk will present a different solution, drastically reducing the code the programmer needs to write. If the context and the domain are well established, all the boilerplate code could be injected at runtime, leaving the developers coding only the specific (non boilerplate) functionalities. Moreover, using a good set of convention on method names, even the specialized parts can be auto-completed using the information extracted from the method signature. The developer only need to declare methods in an interface, without implementing them at all.

This quicky will show the application of this technique for the implementation of a generic DAO (Data Access Object). For adding a finder method to the DAO, You simply need to add it to the DAO interface, without writing a line of the Java implementation or a query for your database.

Speaker

Adaptavist Theme Builder Powered by Atlassian Confluence