hibernate


Plans for the week ahead

We’re meeting with Dermot to give a release next Friday, here are my plans between now and then:

Create templates and editable text for the offline products
Add in login functionality

Validation of form fields

Email component

Server side validation

Form field persistence – a handler that fires on quote Generate? or quote Generate and copletePurchase handler passing request to FormFieldPersister, FormFieldDAO.

Similarly, a requestHandler for form field value requester.

Meeting with Howard

Today we met with Howard for just under an hour and discussed the following:

Blogs
Our meeting with Dermot on the 15th February
Work completed since last meeting
Architecture run through

Discussed some of the issues we had raised on our blogs, which merged nicely into the discussion of the DM05 meeting, where our first release was made. We highlighted the fact that database migration has taken somewhat longer than planned, with DM’s request for detailed policy information and extra links between clients (husband and wife, parent and children). Kevin has primarily been working on these mappings, while I carry on with developing components deemed essential in the functional specification.

We then gave a nice demonstration of how the architecture works, and how it’s precisely as originally planned (High Level Architecture Overview), we did this by demonstrating the lifecycle of a FLEX getPageContent request to the Management System servlet (flexController), its trail through the chain of responsibility (requestHandlers) and how specifically the GetPageContentRequestHandler reacted -> HibernateSitePageDAO object, SitePage POJO, Hibernate SitePage mapping file all the way back to the JSP that flex interprets. Quite a nice example of how everything is working. I also discussed how adaptable that made the architecture, how pools of popular request handlers could be formed with ease, and how new request handlers can be added without modifying the source of the flexController, quite magic!

Today was our first meeting with Howard since before Christmas, our last meeting was a day before delivery of the CMS prototype to DM. Similarly today’s meeting is on the eve of our first release delivery to DM.

Our agenda was as follows:

  1. Blog Review
  2. Bug Tracking
  3. Source Control
  4. Hallway Testing
  5. DM05
  6. Initial Release Review

First off, we had our regular blog review (not too many updates during exam time!) , followed by a demo of our ASP.net Bug Tracking setup that Kevin got up and running on his machine this week – screenshot of issue tracker.

We then discussed our Source control solution, which fast became necessary now that we have started full production development. We have chosen ’subversion’ and its associated eclipse plugin ’subclipse’. It allows for comparisons between versions of files, stored in a repository, making it very easy to get back to working code when you’re 1 undo too far away!

The notion of hallway testing is taken from Joel’s 12 Steps to Better Software, and involves grabbing someone in the hallway (or CA lab) to randomly test the code you’ve just written for usability.

We also demonstrated Release 1, which consists of our replacement customer database GUI: Filters for searching for customers and an interface for inputting new customers’ data.

Spent today finalizing the Customer Database interface for OBS, its nearly completely
wrapped up. Adding new customers, updating existing ones and deleting (marking as
inactive). The flex UI sends a newCustomerDetails request with either a brand new customer
or updated customer details, the newCustomerDetailsRequestHandler determines which it is,
and persists the changes to the database.

Some learning curves today included using a WHERE clause with a hibernate select, deciding
how to deduce whether a customer was new or an update, without relying on information from
flex (Did this using whether or not a clientid was in use), how best to use multiple
constraints.

Flex was sending back the string ‘null’ which was being persisted to the database, rather
than the value null, I overcame this by inserting a simple check on each entry received from flex.

Validation layer will add more concrete assurance to this.

I need to allocate some time to mastering the hibernate mapping technique, particularly in
those instances where multiple tables play a part in creating an object, for example a
customer, with many policies, a contact log and a document library.

Again, our choice between hibernate 2 and 3 will play a part here. Hibernate 3 is the
obvious choice, but some inconsistencies within Spring have caused some headaches here.
[UPDATE: Successfully migrated to Hibernate 3 (headaches included)]

Also need to figure out how to automatically derive the CLIENTCODE as in previous post.

Having exported DM’s legacy customers to our new mySQL database, today it fell to me to
figure out how to create a new customer [from the management system, or from a customer
sign up] and enter them into the database.

DM’s legacy clients have CLIENTCODEs which aren’t at all uniform, probably dependent on the
database system he was using at their inception. I had to create a hibernate mapping that
could ensure unique codes would be assigned to new customers upon their persistence to the
database.

I created a new ‘id’ column in the client table, which has an autoincrement property, all
of his original 2000 or so clients now share this common column, while new and online
cliets will have a new CLIENTCODE which is based on this column, prefixed by some
characters, thus ensuring all CLIENTCODEs are unique.