13.04 2010

Creating an application from zero to done: Day 2

Day 2 started of fighting with Maven. Setting up the web project was not as straightforward as I would have hoped. First step was to find how out how to use the Vaadin archetype to generate the project. The archetype doesn’t seem to be in the main maven repository and I had a hard time figuring out where I can add new repositories to m2eclipse, and which repository exactly to add. I got it finally right with a lot of trial and error and it generated me the dynamic web project with an start-up application and Vaadin jar etc. That was just the beginning of my problems. Next up I had the problem that eclipse’s WTP didn’t accept my project and I couldn’t deploy it directly. I got WTP to recognize the project as a web project by adding natures to .project file and finally adding the Java and Dynamic Web Module project facets. After getting it deployed on tomcat I noticed that my web.xml generated by the archetype was empty, and I had to copy it in from another project. The final issue I had was that WTP didn’t deploy the Maven Dependencies, which contained the Vaadin jar, so I had to manually modify the .classpath file. It was a bumpy road but finally I got a grey page on the screen with a button saying “Click Me”. I probably should make a tutorial for myself how to set up a business logic project and a Vaadin project at some point, because that is basically what I need when I start something new. But now it’s time to get into the coding!

As I got the architecture right I started cranking out the code quite fast. First thing I did was to create a static page that looked exactly like the mockup I drew yesterday. With that finished I had the basic layout with header and content, and placeholders for my main parts of the application - Home, Add and View.

I also had the time to finish of the view for adding new tracks in the system. That’s one of the three view’s of the ‘Add’ part. The two others are basically the same and I already got the mechanism done to send messages back and forth so it should implementing the rest of that part should go quite fast. The view sends the data to a front controller now, which sends it forward to a service on the backend. The service does nothing at all for the moment. I’ll probably make those when all the ‘Add’-views are done.

So two days behind, two still in front of me. I worked on this project for about eight hours today. I got the data model, tests, the GUI template and one view done. I still got left about six views, persistence, doing graphs, theming and some final touch-up here and there. It’s a lot to be done but I guess it is doable. I think I’ll draw the views for adding players and results still today, and start implementing those tomorrow. I hope I also get the persistence somewhat done tomorrow.

Home screen

Add track screenshot

Comments
blog comments powered by Disqus