Java Cinema Booking Client and Server

Another University project that I want to talk about is a client/server cinema booking system written in Java. I worked with my good friend Nathan on this as it could be completed in pairs. We used GitHub (obviously) to host the project and the repo can be found under Task2.
We achieved a mark of 90% for this as we implemented all of the requirements to a good standard. We also had a report to produce, explaining design choices, etc. It’s not interesting, but the report’s here if you want it.
The main points that I’d like to discuss about this project are:

  • Implementing Multithreading

    Multithreading is the ability to run code in parallel within one process. Java makes this very easy by providing a Thread and Runnable classes to allow developers to extend or implement. The main problem that we faced when dealing with multithreading was multiple access to data. We had a central object on the server which contained all data, two threads (read user connections) should not be able to read from or write to this object at the same time. Access to this critical region was controlled by synchronising access to objects with synchronised methods and the synchronised keyword.

  • Building a protocol

    As this project was quite large (Nathan and I had not dealt with a project of this scale before) we needed to ensure that there was a formalised way of communicating between clients and servers. This helps to ensure that the server and clients can communicate easily and also makes it easy to notice an error. We built two classes to model the client/server communication in this project; a Request class, and a Response class. We chose these names as we felt that they fitted the nature of the connection. A client makes a ‘Request’ to the server (to log in, to make a reservation, etc.) and the server passes back a ‘Response’ with details of what happened (the result of a query, success message, error message, etc.)

  • Graphical User Interfaces

    Initially we had veto’d this aspect of the project as we were daunted by the scale of the project and didn’t think we should have enough time to learn and implement an AWT/Swing Java graphical interface. In the early stages of the project, while I was working on the basics of the server, there wasn’t anything Nathan could have been doing so he decided to look into Swing and took well to it quickly so we changed out mind about implementing a GUI. Nathan implemented most of the interfaces that are in the project, the rest were from my reuse of his code.

I loved this project and learnt a lot about software development, Java, and the client server model.

rserve: Java Web Server

Image of rserve running in Mac terminal having dealt with one request.

As one of my modules at University this year will require me to learn Java, and I like to get a head start on things, I decided to jump into Java. Using the very helpful course on (if you want to learn programming, check them out! Seriously!) I got a basic grasp of Java and started tinkering around with little things (see Learning-Java repo) but then my Christmas break came and I hibernated for a month. Once back at uni, I decided to create a web server as a personal project in Java as a way of ‘relaxing’ in-between catching up with the work I should have done over my Christmas break.

This is an ongoing project, but at the time of publishing this post I have just got it to serve the file at the requested path. Next step is constructing a response header rather than just throwing the file back at the client.

You can follow my progress on the rserve GitHub repository. Feel free to fork my code, send pull requests to help me out, or submit an issue.

Computer System Modeling and Development

In my Systems Analysis and Design module in the first year at University I was put into a group and given this specification for designing a computer system. Even though it was a group project, I ended up completing almost all the work because of absences and lack of skills of the other members. The project involved project planning, use-cases, multiple levels of abstraction of data flow diagrams, logic modelling, entity relationship diagrams at different stages of normalisation, and many other skills. This project taught me a lot about the systems development process and gave me a more formalised way of looking at potential projects. You can download the final portfolio here. For this project we were awarded 74% which is first class level. I am very pleased with this project and feel that without me the rest of the group would not have been able to meet such a high grade.

iOS Development Project

I have made it my summer project to make an iPhone (and iPad) app. Though, currently, I haven’t an idea which isn’t helping me concentrate on learning how to do it.<!–more–> I like to have clear goals before working on something and learning Objective-C and everything seems quite difficult when thinking in the abstract not in terms of ‘my app’.
If anyone is looking for a noob to make them an app. Get in touch! Not likely.