Our two demonstrators are: Cong lun Yao and Hasan Qunoo. Rather than have office hours in their office, they hold them in the labs: thus both of them will be there for both 3 hour lab sessions in the MSc lab.
Each student is likely to have timetable clashes across some of the lab hours, hence a sufficient number of lab hours have been arranged so that, in spite of timetable problems, each student can attend a number of these hours. You are strongly advised to attend as many lab hours as you can to take advantage of the demonstrator (and classmate) support available. Any exam condition lab exercises will take place in the Friday lab sessions, as will any extra tutorials provided by the demonstrators (no students have timetable clashes for the Friday session).
|
Day
|
Time
|
Room
|
| Mondays |
09:00-12:00
|
LG04 |
| Thursdays |
14:00-17:00
|
LG04 |
| Fridays |
15:00-17:00
|
LG04 |
Handouts are available from the school library from the box in the shelves. The librarian always has a master copy so if they run out from the shelf box, ask the librarian to run off extra copies.
Handout 1: JDBC
This link covers use of JDBC, using transactions via JDBC, using sequence fields in PostgreSQL, and describes the "Shop" database. There are links to the files used for the exercises in the handout. You should attempt all exercises. The exercises are unassessed, but are necessary preparation for the lab test (see below).
For Postgresql, you can find the online information about the School's setup here.
Handout 2: Use Cases
Use cases are a way of recording requirements that is understandable to non-technical people and not overly formal, yet precise and specific enough to provide a basis for planning and carrying out the implementation of an application. Furthermore, they can provide the basis for a significant part of the testing of an application.
Handout 3: Hibernate
This handout introduces Hibernate, an object-relational mapping tool.
Download the following HibernateShop.jar file. If you un-jar it (use the command "jar xvf HibernateShop.jar" from a terminal window in Linux or the command prompt window in Windows). This will create a directory called "src". Inside that directory you will find the source files for a working Hibernate Shop application. Look in Main.java to see the possible command line arguments. You can run it with the argument "drop-create" (without the double quotes) to safely drop any tables and sequences created by a previous run of the program, and create them afresh..
Please try the following exercises
Handout 4: Spring
SimpleSpring: using Spring to insert logging via aspects.
shop-spr-hib.jar: the latest version of the shop application using Spring and Hibernate
Handout 5: Acegi
shop-sha.jar: The shop application using Hibernate, Spring and Acegi
Please try the following exercise
Handout 6: Wicket
SimpleWicket.jar: A simple first web application using Wicket. Note that this does not use Hibernate, Spring or Acegi: you only need the Wicket jar files, the log4j jar file, the two for slf4j (slf4j-api-1.5.0.jar and slf4j-log4j12-1.5.0.jar) and the jar file for joda time. Get this working in the lab. Make sure you can use the debugger to stop at break points in the program and inspect variables. Try adding some more web pages using the same pattern you see here.
SimpleWicket2.jar: This is an extension of SimpleWicket.jar that adds a border, a navigation bar, bookmarkable links and styling.
SimpleWicketListView.jar. This adds a ListView component and demonstrates the basic model/view/controller pattern using a simple static pseudo-database. Some exercises to try:
- Add an extra instance variable called "description", of type String, to the Appointment class and modify the application to support setting the description as part of creating the appointment (using a TextField component), and displaying the description everywhere the description (using a Label component) is to be displayed.
- Modify your solution above to use a TextArea component for input of the description and MultiLineLabel for displaying it.
- Add a new "postpone1Day" use case: Add an extra column to the ViewAppts table of appointments called "Postpone". When this is selected, the appointment is recheduled for the day after the one it is currently scheduled for.
- Add a new "reschedule" use case. Here a reschedule link on the ViewAppts table takes you to a new page that lets you choose an alternative date, using a text field with a DateChooser, to replace the date in the corresponding appointment.
- Refactor the application so that the list of lecturers are maintained by the AppointmentService class (although initialised to some small list of names). Ensure that these names are used when making appointments and that, if a name is removed, all appointments that refer to that lecturer are also removed. Add new pages to let you add or delete lecturers.
- Add a new feature that lets you choose a lecturer from the list of lecturers and then displays only the appointments of that lecturer, with appointment deletion facilities as for the ViewAppts page.
Handout 7: Hibernate + Spring + Wicket + Acegi
SimpleHibSprWicAce2.jar: An extension of our Simple Wicket application to integrate all the technologies so far.
NOTE THE TIME CHANGE
Because of timetable clashes the Friday lab session, and the assessment
on Friday 18th January, has had to be moved to 15:00-17:00
This will take place on Friday 18th January 15:00 - 17:00 the usual lab (LG04) under examination conditions. You will be asked to implement a program, similar to the exercises in the JDBC handout above (it will be harder than the first exercise in the handout, but easier than the last one). You will have access to the Java APIs, the module web site and your own files. You can bring any books or notes you like. The program you write will have to be submitted electronically at the end of the assessment session. Invigilators will be present to maintain examination conditions. You must write the program on the school systems using the school's PostgreSQL database server. In order to prepare for this exam, you should study the JDBC handout and attempt all the exercises at the end of the handout before the assessment.
This will take place on Friday 8th February 15:00 - 17:00 the usual lab (LG04) under examination conditions. You will be asked to implement a use case in a hibernate program. You will be given a working program based on the Shopping example (which will be available before the lab session at 9am on Monday 4th Feb.) to which you will have to add the new use case. Implementation of the new use case will require adding a new business object and corresponding hbm.xml file and you will be required to implement the use case in a style similar to that shown for the use case in the Shopping example. You will have access to the Java APIs, the module web site and your own files. You can bring any books or notes you like. The program you write will have to be submitted electronically at the end of the assessment session. Invigilators will be present to maintain examination conditions. You must write the program on the school systems using the school's PostgreSQL database server. In order to prepare for this exam, you should study the full Hibernate handout and attempt all the hibernate exercises before the assessment.
Before the assignment you need to
The actual assessed exercise will be made available at 15:00 in the lab but will be in the form of an extra piece of functionality that you will have to add to this project