A Java EE 7 Startup: Virtualizing Services with hubeo.com 📎
Could you please briefly introduce Hubeo.com and yourself?
My name is Wojciech Ozga. I am 25 years old, living currently in Krakow, Poland. I am interested in different areas of Computer Science, starting from software engineering going through computer networks and finishing on cloud computing and linux system administration.
I started my adventure with programming when I was kid, I got Microsoft Visual Basic 6 Pack from my father. Then I was experimenting mostly with c/c++ till 2004 when I entered the path of PHP. After one year I finished works on Cracow-Apartments.com, one of the first online booking system of apartments in Poland.
Since 2009 I have spent most of my time in the JVM world with small exceptions for python and shell scripting languages. In mid 2012 I started the design and the implementation of Hubeo.com. I decided to keep as close as possible to Java EE stack, and it was good ;)
Hubeo.com is a global web platform for virtualization of services like: accommodation, tours, transportation, medical treatments etc. Complex system logic is hidden behind user friendly web page with modern and fresh design.What makes hubeo.com stand out from other booking platforms is the ability of its users to advertise, promote, find and book a wide range of services in one place. Main features are:
- selling own services
- buying services of other users
- affiliation
- automatic booking settlements (with anti-fraud protection)
- reviews
You told me, you read the book realworldpatterns.com and used the ideas to implement a prototype. What is exact the story behind?
I started to take a deeper look into Java EE on my studies. We had classes where outdated ways of coding and usage of Java EE were introduced to students. That time I was thinking that programming in Java EE is a nightmare. I found some online tutorials to give it a try and I remember one which scared me a lot.
The simple code was surrounded by all the patters coming from "old j2ee times". I had to write the same thing 3 times, encapsulating everything. Moreover I was shown to use ale the xml configurations which I just had to "click and fill" in Eclipse. I was really happy passing the exam and being able to forget about Java EE world. But then I found your books. I read two of them: "Real World Java EE Patterns - Rethinking Best Practices" and "Real World Java EE Night Hacks". The second one made so big impression on me that I decided to give it a try implementing the first prototype version of "cloud market" (the antecedent name of hubeo.com). What I liked the most reading them is that they are written from the programmer point of view: keep it simple, stupid, do not repeat your self. Skip the unnecessary boiler code, write it the simple way so every one can understand. Some times I had an impression that you are more agile then Agile :) Since that time I recommended them to few friends of mine. I think it is obligatory to read them!
You also told me that your colleague was fascinated by the simplicity of the code and wanted to join forces with you. Could you tell the story to the readers?
One friend of mine - Mateusz Krzyszton - was working previously in a big company as JSF programmer. They had a lot of issues with it, large views and server was responding slowly. They were implementing a lot of hacks to make it work. I needed someone to take care of implementing the front-end part, and I knew Mateusz is a brilliant, experienced programmer. That time we met in Lisbon. I told him the basic idea and I showed the very early mock-ups. He was not convinced. Months later we met again in Warsaw where I showed him the skeleton of the web project, implemented in JSF 2.0 with Primefaces and Omnifaces. He browsed through the source code, looked at the implementation of business logic and he decided to reinforce the team! He was really impressed about, how things can be easily done using modern version of Java EE and JSF following patterns from your books.
What surprised you in Java EE the most?
What I like the most is avoiding of writing the boiler code again and again. At the beginning I created few classes, I wrote few lines of code and I added annotations. The very simple, but working, 3 layer application has been implemented! With no magic I had a simple CRUD application with MySQL engine behind! Every programmer with a bit of experience in linux administration can quickly make business application accessible to everyone in a very easy way.
On the other hand I was really disappointed about the security models. I could not find any suitable for hubeo.com. I read official Oracle tutorials 20 times and I did not find JASS as a good solutions for modern web applications. I took a deep look into Apache Shiro but it did not convinced me neither. Modern web systems require much more complex management of roles and permissions. I hope that it will be done with Java EE 8.
What about the Java EE performance? Did you have to perform particular measures to improve the performance?
Performance! Yes, we did several measurements, using JMeter, Selenium and VisualVM. We found few issues but they were mostly related to our implementation. We focused also on the memory usage of our front-end application. I can say that creating complex views, with many components and ajax is not a way to go with JSF. Between requests, JSF stores the component tree of views on the server. Depending on configuration, JSF can store even few hundreds views per user. Having views build with many components we can finish up with few Mb of memory taken by an individual user. That made us thinking about the number of users we can handle during the duration of the user session.
For now we did not find important issues related to the JPA performance, but in the business logic we avoid eagerly loading of collections.
What were the most interesting challenges?
Designing Hubeo.com from scratch was really interesting challenge :) Considering the principles, the design of the database was a really difficult part. I needed a good common schema to store information about services like apartments, tours, dentist treatments and many more. All of those services had to be represented in a similar way to allow design of the algorithm to calculate availability and prices.
Probably the most difficult part of the implementation was the business component responsible for service order and booking management.
Moreover I was really excited discovering Amazon Cloud. Two years ago, together with Jose Java EE Coarasa Perez (blog, @coarasa, LinkedIn), we build one of the biggest implementation of cloud using OpenStack on CMS farm (one of the experiments at CERN) It was a great adventure but after using Amazon services I see how immature OpenStack was that time.Which IDEs / tools are you using?
At the beginning of my Java EE journey I was using Eclipse. It was a nightmare. After reading your books I switched to NetBeans and I was really happy. Things were just working! Right now I am using IDEA IntelliJ. We use maven and Nexus to store artifacts. For continuous integration server we have Jenkins. The application runs on WildFly 8.2. We also use the relational database: MySQL. Hubeo.com is hosted in Amazon Cloud. We use EC2 to run VMs, S3 to provide common storage for all VMs and RDS for the database. CloudFront helps us to make our static resources easily accessible around Europe and US.
If you had the chance to start-over, would you use Java EE again?
Definitely yes. I could rethink the usage of JSF for that kind of application, but the business logic would be definitely implemented in Java EE.
Do you have any other (secret) startup ideas, which you would like to share with the readers? :-)
I was asked to implement the idea of a simple web page, where people can see the map with different trails indicating interesting points in the city, related to some topics. User can select the trail, search for places, and select specific marker to read details. This is the classical CRUD application. I decided to implement it with Java EE 7 and it took me one day. It runs on WildFly on some really small server (1gb of memory), waiting for a better times - some investor to push it forward.
Any web links / resources?
- Hubeo.com - virtual market of "real world services". Register your service and start earning money with us ;)
- Szlaki miejskie - urban trails, application implemented in 1 day using Java EE 7 and Wildfly
Wojciech, thank you for the interview and good luck with your next project!