File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes SQL Antipatters and db refactoring Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "SQL Antipatters and db refactoring" Watch "SQL Antipatters and db refactoring" New topic
Author

SQL Antipatters and db refactoring

Gian Franco
blacksmith
Ranch Hand

Joined: Dec 16, 2003
Posts: 975
Hello Bill,

How do the lessons in SQL Antipatterns relate to
the principles of database refactoring (Sadalage,
Ambler
)?

Gian


"Eppur si muove!"
Bill Karwin
author
Ranch Hand

Joined: Aug 02, 2010
Posts: 32
Hi Gian,

The Sadalage/Ambler book "Refactoring Databases" is more or less a catalog of the types of schema changes you might find yourself making, and how to make each type of change successfully.

Often we use database refactoring to more faithfully represent our data model. For instance, a users table has phone_number, but if we decide users can have multiple phone numbers, we should refactor by creating a dependent table for phone numbers, with a many-to-one relationship to users. Our understanding of the data we need to handle has evolved, and we change the database to match.

Several of the chapters in the database design sections of "SQL Antipatterns" have to do with designing databases right from the start. If we can do that, we can reduce the need for refactoring later.

Java developers use OO design guides like GRASP to help them compose classes in the best way for their app. The rules of normalization provide similar guidelines for relational database design. In both cases, we know we'll have to do some refactoring as our project requirements evolve, but a little analysis up front can help use reduce that work.


Bill Karwin is the author of SQL Antipatterns: Avoiding the Pitfalls of Database Programming
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL Antipatters and db refactoring
 
Similar Threads
Mocking out the parent class method using Easymock
refactoring beginner
Q. related to naming convention...
eclipse refactoring
JasperException error help (exception report)