Two weeks ago, in the Road to a more functional Java with Javaslang - example refactoring
blog post, we shared a short demo of Javaslang
Try capabilities . We know that any code
could be improved almost infinitely, but for the purposes of our article we had to say "stop" at some point to show you
some concepts of
But what surprised us is that many of you (in the comments below the post, during conversations in various public Slack
channels) actually took time to point out that our code could be improved even further or written in a much better way.
And we completely agree! That is why we decided to organize a small coding contest where you could show your Java
refactoring skills and win a ticket to the GeeCON 2017 conference in Cracow!
- Write Java code having the the same functionality as our original FacebookImage class:
- Load the content of a website
- Extract the first
og:imagefrom the meta tag in
- Return a URL of this image
- If there is no such page, in case of any exception or if there is no
og:image, log a warning and return a URL of a default image as a fallback
- No library restrictions, just add them in
build.gradlein a separate section to make merging easier :)
- Logic should be written in Java, tests can use any JVM language.
- Code could be object oriented, functional or a mixture of these two approaches.
- All your code (classes, interfaces, etc.) should be located in a separate package
com.softwaremill.java_fp_example.contest.your_github_loginwhere last part should be your GitHub username.
- Add MIT License file signed with your GitHub username (template file with readme is already in the repository)
- Share your solution as a Pull Request to our GitHub repo with your code, tests and signed license.
- The Pull Request should be sent before 23.04.2017 24:00 CEST.
- Full contest rules in Polish can be found here. If you have any questions, please ping us via konkurs (at) softwaremill.com or in the comments below.
- You have to be adult person from Poland.
Winner will be announced within 7 days after the contest end.
Our Java developers will analyze all solutions and pick the best one (i.e. one that has a nice design, good
readability and generally conforms to "clean code" rules). The winner will get a ticket to the GeeCON 2017 conference
which takes place on 17-19th May in Cracow.
The rules are pretty clear: write some code, create a PR and get a chance to attend one of the best Java conference
in Poland. As simple as that, so do not hesitate, create your fork today and start coding.