Week 9 (27.08. - 02.09.) - Release 2What has been done? Wednesday, this week was the last "official" day of my internship. I didn't add any new functionality to my system this week. I tried to finish everything and make it ready for deployment. Moreover I updated the class diagrams of the system and finished the necessary internship report.
Week 8 (20.08. - 26.08.)What has been done? This week was the final week of my internship project who's goal was to develop the mobile posting system for Firstlife. I didn't add much features this week, however I was able to do a lot of important improvements of my system, on the server as well as on the client side. I'll briefly list all done things below:
What will be done next week? The following week I'll see to conclude all of the work and make the application ready for deployment. Moreover I'll see to update all my Class diagrams as soon as I complete all the other stuff.
Problems? Problems were mainly related in figuring out configuration details for the Spring schedulers and for implementing the "small-chunk-based data retrieval". Week 7 (13.08. - 19.08.)What has been done? This week I finally constructed a simple Location simulator which can be used by all First-Life components for testing purposes. I wrote the simulator in a way such that it can be substituted later on with the real location-retrieving code. The simulator contains several Location objects which hold data regarding the cell-id, latitude and longitude. The simulator can be accessed from the main First-Life menu. Locations can be selected randomly or manually.
As discussed in the last meeting I also finished the user-registration part of First Life by using the Social Network server which is also used for doing the user-login.
Another important thing to which I didn't pay much attention till now was to secure the information exchange between the server and client, especially to encrypt exchanged passwords and to secure the server by adding authentication functionalities. For the encryption part I developed a utility class which can be used by all First-life components (more details here). It basically creates a message digest out of a timestamp, a random number, the username and password. The mobile client has to send the timestamp, random number, user and the created digest to the server, which will on his side create a new digest out of the timestamp, random number and username from the client and with the user-password from the database. Finally both digest messages will be compared and evaluated. Different passwords on the client and server-side will result in different digest messages and therefore in an authentication failure (I'll post more details about how the other firstlife-components can use the encryption classes for their servers). In the case of my Mobile Posting server, I found after some research in the Spring reference documentation that Spring disposes of an abstract class HandlerInterceptorAdapter which has useful methods such as preHandle(HttpServletRequest, HttpServletResponse, Object) and postHandle(...). Inheriting from this class I was able to develop my authentication component on the server side in a way that all the incoming HTTP requests on the server-side are catched and authenticated before they arrive to my HttpController class where the request is then actually processed. This has the big advantage that I don't have to deal with sessions or check continuously the authentication data on the actual server controllers since I can be sure that all requests arriving to the server controllers have already been checked before (more details can be found here).
Finally I did other things such as adding more information to post comments like user-information and the date of creation. This allowed me to change my code a little such that posts and comments are now delivered to the mobile client in descending order according to their creation date.
What will be done next week? The following week I'll add another functionality to posts: visibility. I thought that it may be the case that a post should be visible regardless of the location of the current device, meaning that a post defined "global" should always be retrievable. On the mobile client there would be then the option to fetch just the posts of the current location or including also posts defined as "global". Moreover I'll do some refactoring on the client (mobile) as well as on the server side. Especially on the client side there are some parts of the code which have become quite messy and have to be reorganized a little. As a last point I'll focus more on the location-based stuff...in order to find a definitive solution how the location could be retrieved on the mobile phone since we found out that the JSR-179 API will not be that convenient.
Problems? There were no notable problems this week.
Week 6 (06.08. - 12.08.)What has been done? Thursday this week we met for a 2nd meeting, since we had to put together all the single databases to the common firstlife database which will then be used by all the applications. We had to meet since there have been tables which may be used by several firstlife components for which reason we had to discuss on the needed table columns. As I announced last week, this week I changed my implementation of the posts such that they have now a creation-date associated. From one point of view this may be interesting to see how actual a post is, but it could also be used for filtering, such as for retrieving only posts created within the last 2 weeks or so. The date is added on the server-side and is therefore based on the timezone and date-configuration of the server-machine. Moreover I added the functionality of adding an expiry date to posts. As I already explained in the report of last week, this may be useful for posts which are only valid till a certain date, as for instance a post that announces that on the date xy there will be a party...after xy the post will basically be useless. For removing expired posts, I implemented a class on the server, which is launched at server-startup and runs as thread in the background, checking the DB for expired posts in a specified time interval. A second feature which I added to my posting system was to add an "OR search" to the already implemented "AND search". To explain myself more clearly the user can now do the following: A user can load the search-form on the mobile phone and enter the following query: "computer sell" (equivalent: "computer and sell") This will be interpreted as "Computer and sell" and will intuitively return posts containing the string "computer" AND "sell". The "OR search" allows the user to enter a query as follows: "computer or sell" This will be interpreted as "inclusive or" and return posts which contain either the strings "computer" or "sell" or both of them. Moreover the user can concatenate both types of search, by typing for instance "computer or sell party" The query will be evaluated on the server side and return posts that contain the string "computer" or "sell" (or both) and a string "party". So the following posts will be returned:
Beside this I also tried to develop custom items for displaying for instance user-comments on posts. For doing so I've extended the CustomItem of J2ME which disposes of a Graphics object for directly drawing things on the display.
What will be done next week? The next week I will implement the registration of a non-existing user by using the Social Network server which does the user-management (login, registering of users). I will try to implement a simple Location Simulator which I was not able to implement this week due to time constraints.
Problems? The only problems were related to writing my own UI item. J2ME disposes of the CustomItem class which can be extended by inheriting from it to create personalized items. I wanted basically to create a UI item for displaying user comments, where there is a picture on the left and the user-comment flowing along on the left side of the picture. The difficulty was basically to let the comment-string wrap on the lines since all line-breaks have to be done manually by measuring the string and cutting it on space symbols if it is too long. Here's a sample of the successful implementation of my comment-item:
Week 5 (30.07. - 05.08.) - Release 1What has been done? On Tuesday this week we had the 1st "firstlife" meeting (see here). Therefore one of the things that have been done this week were to configure the common SVN repository and to move the source-code of all Firstlife components to the common repository. Moreover I collect the single databases of all the project members and started to combine them to the single Firstlife database that will be shared by all server-side components. For the Mobile Posting system I implemented a function that allows users to leave comments on posts, similar as it is done on online blogs. This encourages the communication between Firstlife-users' using the Mobile Posting system. Lets take for instance the old sample of the restaurant (see scenario): a user posts that he found a good restaurant in some street...Others read the entry, maybe they also go to eat there but they may not agree with the opinion of the post-writer. With the possibility to leave a comment on the post, users can express what they think. Getting feedback on posts is much nicer. The second major functionality I added is the post-search. Users have the possibility to enter search-queries by typing in keywords. At the moment it is a simple "AND" search, meaning that the query "computer sell" will be interpreted as "computer AND sell" resulting in posts that contain the keywords "computer" and "sell". Beside of the location-feature the system is fully functional and could be defined as the first release of the Mobile Posting System. Till now the following functions are available:
What will be done next week? The next week I'll improve the search by adding the option of specifying "OR" queries and also to use filters (for time, only posts of current cell,...). Moreover I'll add date information to posts, such that one can fetch posts also based on time-data (i.e. fetching posts made in the last 7 days). I would also like to add an "expiry date" to posts. This could be especially useful for posts that are only valid (or useful) till a certain date...For instance one could make a post that a party is taking place, say, the 15th of August...So after the date, the post is useless...However if it would have an expiry date associated, the server could check the DB periodically and delete such posts. Moreover I want to create a Location-Simulator that can be used by all Firstlife team members to test their components. Lastly I'll do some refactoring on my code on the mobile side and improve the user-interface.
Problems? There were no big problems! Week 4 (23.07. - 29.07.)What has been done? I finished all the things which I planned for this week. I added several functionalities. So the user has now the possibility to retrieve all the posts he has written. Moreover he's not only able to retrieve them, but also to edit and recommit or to delete them. In this way the users of Firstlife's Mobile Posting System can fully manage their made posts. This week I also refactored a little my system on the mobile side since some parts of the system got a little messy. I also started handling all errors properly...so I started to display the relevant ones to the user, by using Alerts. For instance if an "error" happens on the server side, because for example a user has not the permission to delete a post, the server will encode the message (error) into XML, send it back to the client, where the message will be displayed as an alert. This makes the system much more interactive and improves the usability. I also developed a general ProgressBarForm, which can then also be used by other parts of Firstlife on the mobile side. Moreover I finally also wrote all the unit-tests for the mobile side of the MPS using J2MEUnit.
What will be done next week? The following week I will probably add functionalities regarding the searching of posts by giving some keywords. I will also try to make the system more usable by giving the possibility to leave comments on read posts, such that using MPS will be more interactive. Moreover I'll start to write a Location simulator which in some way is able to simulate changing cells, such that all the components of Firstlife which are location-based can use it to test their parts.
Problems? I had to read through some tutorials for understanding how J2MEUnit tests work. But with a sample from Matthias Braunhofer and a good tutorial, which I found online, I understood everything quite quickly. There were no other problems.
Week 3 (16.07. - 22.07.)What has been done? This week I implemented the user-story "Fetch posts based on location". The user can now start Firstlife on his mobile phone and retrieve all posts of the current location. Clearly I'm till now only simulating the location, by programmatically setting the location-data (cellid, lat, long). For this reason I had to modify my model on the server as well as on the client side. Furthermore I added more information to the DB and had to change the XML-model. I have to postpone the other scheduled stories for next week, since I didn't manage to implement them this week. The MPS system runs and there are currently the following features available:
What will be done next week? The next week I'll add the functionalities that the user can edit and republish his personal posts. This will include also the possibility of deleting and fetch his personal posts.
Problems? Problems were mainly related to understand how the persistency mapping of foreign key relationships are done with Hibernate. It needed some time and reading after I successfully understood it. Despite this effort, Hibernate gives many advantages, where the most substantial ones are cleaner java code and mainly the decoupling of the code with the DB layer. It would be easy to switch to another DB system by just changing the hibernate mapping files, without having to touch any line of code.
Week 2 (09.07. - 15.07.)What has been done?
Server-side: I started developing the application. First I had to decide how to structure my system on the server-side where I've come to the decision to use the Spring application framework. One reason for using it was to get in touch with something new, I've never used before, but the main reason was that it nicely fits into my application. Since for the Mobile Posting System the communication between the mobile client and the server takes place over the HTTP protocol, I made use of the Spring Web MVC framework which has a couple of controllers available for implementing a nice MVC pattern on your web application. Specifically, I used the Spring Dispatcher Servlet, which takes all the HTTP requests and forwards them to my main application-controller-class which then processes all of them (I'll provide a class diagram of the server side soon here). This gives me the benefit that I don't really have to care about having a servlet and about creating a Web application. I can build a normal java application on the server side which has to be structured and configured such that it cooperates with the Spring framework and takes the forwarded HTTPServletRequests and respondes over the corresponding HTTPServletResponse. For this reason my main application controller has to inherit from the necessary Spring controller. For managing my objects I used the Spring IoC Container, which takes care of instantiating the objects in a bean-fashion, by using the setter-based dependency injection style (Martin Fowler's article). Another advantage of Spring came up when writing my Unit tests. So for instance I could use the available Mock-objects, specifically the org.springframework.mock.web.MockHttpServletRequest and MockHttpServletResponse, for simulating the behaviour of a HttpRequest/Response to the server. In this way I can unit-test my application without having to deploy it every time on a running Tomcat. For the ORM (Object Relational Mapping) I used Hibernate. There would be the possibility to directly integrate Hibernate with the Spring framework, but since I'm new to both of the technologies and for other simplicity matters I decided to use Hibernate in a declarative way, by explicitly giving it the instructions for persisting objects. Maybe later on I can try to directly integrate both technologies.
Mobile client: On the mobile client I created a general Midlet called "FirstLife", where I attached my mobile application controller class "MPSMain". The idea would be that later the other Firstlife components could be added to that Midlet "Firstlife" and launched from it, such that we have a single Midlet for Firstlife on the mobile client. However this has still to be discussed with the other team members. Here is a first draft of the according class diagram on the mobile side (yet still without any method and field declarations).
Beside technology and architectural stuff, I was able to successfully implement the first user-stories and to integrate them such that I've now a running system. The user is now able to launch Firstlife, create and submit a new post. The created post is sent to the server where it is processed and saved into the DB. Moreover the user has now the possibility to download all available posts from the server and to display them on his mobile device. During this week I'll add more information about the chosen XML information exchange format here.
What will be done next week? The next week I plan to implement the location-stuff. I will figure out how to simulate location-data with the Sun Wireless Toolkit and how to write Unit-tests on the mobile client by using J2MEUnit, since Junit doesn't since J2ME doesn't support reflection, which is necessary.
Moreover I'll implement the following user-stories:
Problems? There were no real problems. The only difficulties were initially in understanding how the kXML 2 parser works on the mobile side. Another thing was also to understand how the dependency injection of Spring works and how Hibernate has to be configured for the MySql DB.
Week 1 (02.07. - 08.07.)What has been done? This week was mainly intended to perform experiments related to new technologies which are probably going to be used during the development of the project. The following experiments have been done:
What will be done next week? In the following week I will start developing the application. The first thing will certainly be to create the working environment such as creating a clean Tomcat installation and integrating my project with Spring and Hibernate to be ready for development. I will also create a first draft of a possible architecture of the application which I will post on the Wiki. Moreover I will start creating a bunch of User stories, model a general XML structure which will be used for communication and I'll start implementing the most essential User stories such as creating a post and retrieving a post. I thought to add the location-stuff later, once the exchanging of the XML documents works fine.
Problems? There were no big problems during the experimentation with the
different technologies. The only tricky part was to understand how the
Spring Application Framework integrates with my application, how it
forwards HttpRequests and how it generates and manages Java Beans.
Moreover the integration of Hibernate was not that easy, however once
done, the Java code for accessing the DB and retrieving objects is much
nicer (that was also the reason why I wanted to use Hibernate The parsing of the XML on the mobile client using kXML was also not really simple and straightforward initially since there is just a simple parser available and no DOM model as for example JDom provides. |
First Life > Mobile Posting System >