Toybank Refactoring – CMM Team – Week after Thanksgiving

December 1, 2006

This week we met from 9am – 2pm on Wednesday to complete the introduction of Product as a super class of Account and Loan by adding the hibernate mapping for Product. The inheritance mapping type that we chose (in accordance to the discussion in the previous meeting) was the one-table-per-subclass mapping. The steps that we followed were as follows:

  1. Created a Product.hbm.xml file with the Product, Account and Loan hibernate mappings (they have to be in one file because Account and Loan are listed as subclasses under Product).
  2. Deleted the Account.hbm.xml and Loan.hbm.xml files.
  3. Changed the hibernate configuration file to load Product.hbm.xml and not load Account.hbm.xml and Loan.hbm.xml.
  4. Changed tables-schema.ddl and sample.sql to reflect the hibernate mappings changes.
  5. Changed the action classes and jsp pages that were using Account collections to use the appropriate Product properties (in cases where the property had been moved up into Product).
  6. Tested the chages by re-deploying the application and running though the various use-cases.

Before making our changes we synchronized with the repository as usual and to our surprise we saw that somone had reverted back changes that we had commited before Thanksgiving. After further investigation we found out that it was due to merging by the GL team. We will discuss this further during this weeks meeting.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.