Friday, February 1, 2013

Building Vaadin UI with Xtend

Today I have decided to say hello to Xtend . I had wish to learn some new programming language. The list of the criteria for choosing one, wasn't so big .

  • It must be a programming language running on JVM,
  • and it would be nice if i don't need to learn completely new eco system for building application. 

I have checked a few options. The list of programming language for JVM is quit big, but at I was deciding between the following ones: Groovy, Scala and Xtend. At and i have choose Xtend.
Scala did not fit well in my criteria, on the other hand groovy fits my criteria but it will be the next programming language which i will learn, after Xtend. It is hard to explain why I choose Xtend. I don't even think that the Xtend is a programming language, it's more like extension, but it's my opinion.  

Thursday, November 29, 2012


A few days ago, one of my colleague wrote a really interesting blog about TDD. He has explained benefits of using it,  and he introduced some lacks when you are using TDD, and he provided a really nice example how to use TDD. So this blog post is my reaction on it.

Wednesday, July 25, 2012

Checking file's "magic numbers"

Few days ago I had very interesting task. Our customer required that we perform checking of so called file's "magic numbers" to determinate does uploaded file correspond to it's extension. 
We are already allowed only to upload files with some predefined extensions (PDF, DOC ...). But this can not prevent some evil user to update an exe file after renaming it to PDF or DOC.
So first of all I will explain what are "magic numbers", and then I will show how we handle them.

Thursday, April 26, 2012

Clean code with aspects

In my previous post I've described the alphabet conversion, and I've mentioned that we used AspectJ to resolve that task, but i did not mention how AspectJ works and what are aspects generaly. So in the next few lines i will explain:

  • what is Aspect Oriented Programming and why we need it
  • what is AspectJ
  • using AspectJ with Spring (configuring AspectJ and spring to work together)
  • and i will explain aspects on the example from previous post.

Sunday, March 18, 2012

Alphabets Conversion

In one of company's last projects we supposed to implemented support for usage of Latin and Cyrillic alphabet. This could sounds like an easy task, the Java have a real good support for the multi language application, but what is with languages which have multiple alphabets.
When I said supporting more alphabets, I mean on possibility of choosing between different keybord layouts, not only on showing messages from different properties files, also content saved in database should be transformed from one to other alphabet.
To accomplish these requirements, we made few decisions. We've decided to save data in Latin form and then transform it in Cyrillic if it is needed. This also mean that complete input from user side will be transformed to latin alphabet.
I've almost forgot to mention technologies used in this project. It is a web application, devloped with next technologies:

  • JSP + Servlet for front end
  • Spring + Hibernate as backend
  • and it is running on Tomcat 6

Friday, December 16, 2011

Sending Event Invitations With Seam

These days one of my colleagues had problems with sending event invitation using mail templates with seam (version 2.x). In basic this should not be a hard task, so I will in short explain what need to be done for sending event invitation using seam mail templates.
When you send mail invitation you need to send an email with attachment which contains information about particular event. I will create simple template and sender class which will be used for sending invitation.

Thursday, November 24, 2011

Swiping Slides On Mobile

These days working on our current project was very interesting. Creating a web page for mobile devices is not so easy task. Getting page to work on all platforms can be fun, interesting and in some moments a hard task. It is like making page to works with IE 6 :).
We already have templates which works in mobile, and support both (landscape and portrait) page orientation. But for the first time we were supposed to implement more complicated logic in our mobile sites. We got a task to create "coverflow". We were supposed to create slides and allow user to swipes them.