Thursday, October 29, 2009

Introducing a new hibernate persistant entity

1. Write down how your model object (.java file), hibernate mapping (.hbm file) and ER diagram (DB schema) is going to look like before and after the change. Contemplate on the end result and confirm that it is the best solution in each aspect (model, mapping and schema)
2. Implement any new model object. Review (see "Self reviewing code changes").
3. Coin the hbm mapping for the new model object. Review.
4. Modify existing model object to reference the new model object. Review.
5. Modify existing mapping to reference the newly mapped object. Review.
6. Write a new test case that will
a. exercise each method and each control flow (within the methods)
b. exercise each attribute of mapping
7. Make the test case pass (this will automatically rebuild the schema or you might have to drop and recreate the schema manually)
8. Write SQL scripts to
a. Change the schema on production.
b. Migrate existing data.
9. Use the new APIs from client APIs.

No comments: