Advanced Search
Start Your Free Trial

Overview

Other Readers Also Read...
Patterns of Enterprise Application Architecture

Patterns of Enterprise Application Architecture
by Martin Fowler; David Rice; Matthew Foemmel; Edward Hieatt; Robert Mee; Randy Stafford

Refactoring to Patterns

Refactoring to Patterns
by Joshua Kerievsky

Refactoring: Improving the Design of Existing Code

Refactoring: Improving the Design of Existing Code
by Martin Fowler; Kent Beck; John Brant; William Opdyke; Don Roberts

Top Sellers in this Category

Refactoring has proven its value in a wide range of development projects—helping software professionals improve system designs, maintainability, extensibility, and performance. Now, for the first time, leading agile methodologist Scott Ambler and renowned consultant Pramodkumar Sadalage introduce powerful refactoring techniques specifically designed for database systems.

Ambler and Sadalage demonstrate how small changes to table structures, data, stored procedures, and triggers can significantly enhance virtually any database design—without changing semantics. You’ll learn how to evolve database schemas in step with source code—and become far more effective in projects relying on iterative, agile methodologies.

This comprehensive guide and reference helps you overcome the practical obstacles to refactoring real-world databases by covering every fundamental concept underlying database refactoring. Using start-to-finish examples, the authors walk you through refactoring simple standalone database applications as well as sophisticated multi-application scenarios. You’ll master every task involved in refactoring database schemas, and discover best practices for deploying refactorings in even the most complex production environments.

The second half of this book systematically covers five major categories of database refactorings. You’ll learn how to use refactoring to enhance database structure, data quality, and referential integrity; and how to refactor both architectures and methods. This book provides an extensive set of examples built with Oracle and Java and easily adaptable for other languages, such as C#, C++, or VB.NET, and other databases, such as DB2, SQL Server, MySQL, and Sybase.

Using this book’s techniques and examples, you can reduce waste, rework, risk, and cost—and build database systems capable of evolving smoothly, far into the future.

Amazon.com® Reader Reviews (Ranked by Helpfulness)

Average Amazon.com® Rating: 4.5 out of 5 rating Based on 22 Ratings

Some important ideas but much work remains to be done - 2008-08-16
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
In software development a 'refactoring' is a change that improves code quality without changing functionality. Refactoring helps keep an application maintainable over its life-cycle as requirements evolve, and is particularly of interest to those adopting modern 'agile' methodologies. This book comprises five general chapters on database refactoring - about 70 pages - followed by a 200 page catalog of various refactorings. The refactorings are classified as 'structural', 'data quality', 'referential integrity', 'architectural' and 'methods'. An additional chapter catalogs 'transformations', more on which in a moment. Each catalog entry uses a template including 'Motivation', 'Tradeoffs', 'Schema Update Mechanics', 'Data-Migration Mechanics' and 'Access Program Update Mechanics'. The 'Mechanics' sections include example code fragments for Oracle, JDBC and Hibernate.

Several of the structural refactorings are just simple database schema changes: rename/drop column/table/view. Adding is not really a refactoring so add column/table/view were cataloged as 'transformations' - changes that do affect the application, a distinction that appears to me a little clumsy. Some structural refactorings are more interesting: merge/split columns/tables, move column, introduce/remove surrogate key, introduce calculated column, introduce associative table.

The data quality refactorings include introduce/drop default values, null or check constraints, standardize codes, formats and data types, use consistent keys and lookup tables. Most of these are common best practices, seeing them cataloged as refactorings didn't yield me any new insights. Only replacing type codes with flags was of special interest.

Referential integrity refactorings include the obvious add/drop foreign keys with optional cascading delete, but also using triggers to create a change history and hard vs. soft deletes. Using before and after delete triggers to implement soft deletes is probably the best example in the book.

Architectural refactorings include using CRUD methods (ie. stored procedures or functions to select/insert/update/delete records), query functions that return cursor refs, interchanging methods and views, implementing methods in stored procedures, using materialized views and using local mirror tables vs. remote 'official' data sources. All these are common design techniques and the discussion of motivation and tradeoffs is particularly relevant.

The final section on method refactorings is more abbreviated and covers typical code refactorings. These qualify for inclusion only because databases include stored procedures, but they have nothing to do with schema evolution.

An important aspect of this book is that the catalog of refactorings is presented in the context of evolutionary database development described in the first five chapters: this approach emphasises an iterative approach, automated regression testing, configuration control of schema objects and easy availability of personalized application database environments for developers. Refactorings and transformations are intended to be applied one by one, and an automated regression test suite used to maintain confidence that a change does not introduce an application defect. Change control and a change tracking mechanism are essential to manage the application of schema changes to integration, QA and production environments.

What do I like about this book? The catalog of refactorings is thorough (some might say pedantic) which makes it a good learning tool for new database developers and DBAs, and as a shared reference for communicating on larger projects and in larger organizations. Experienced DBAs working on smaller projects are less likely to find it useful.

What don't I like? Relatively little is provided about the tools required to make regular refactoring practical, the authors simply state that these are being worked on. utPLSQL is not mentioned at all. The discussion on tracking changes is thin (but check out the LiquiBase project on Sourceforge). No guidance is provided on how you might use Ant to build and maintain developer database environments. Little is covered on the tough topic of building and maintaining test data sets. A final pet peeve: no discussion of refactoring across multiple schemas shared by an application suite.

In summary this book sketches out some important ideas but much work remains to be done. The catalog takes a number of established techniques and best practices and places them in a new framework which at least provides value to some for now.

Refactoring (Relational) Databases - 2008-06-12
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
The bulk of this book is a catalog of database "refactorings" such as "rename table" or "add column constraint". Each refactoring includes a brief description and the steps you'd go through. There is often also some stored procedure code, with the odd JDBC code or Hibernate configuration fragment. This is all interesting, but a bit tedious to read through from A to Z, so it's best used as a checklist when doing a change (though it's usually nothing surprising).

The more interesting part of the book talks about how to manage and evolve a database in general (e.g. keep a table that tracks all changes that have been applied). But this part doesn't go quite as far as I'd hoped it would, e.g. there is no discussion of how to track down who is using what parts of the database prior to refactoring (proxy driver? access stats?), and the discussion is limited to relational databases (which may not even be the best choice for rapidly evolving data models).

btw there is an interesting open source tool called LiquiBase (apparently inspired by this book) that attempts to help manage (and deploy) database "refactorings" as described in this book.

Good for developers - 2007-06-19
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
On smaller projects where you can't have a dedicated DBA this book offers just the kind of expert advice for dealing with existing DBs that you need. Highly recommended for such teams.

A very complete catalog of strategies for database maintenance - 2008-08-12
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
As I had never thought about data model maintenance in terms of "Refactoring", the title of this book was very appealing to me. Creating a data model from scratch on a development environment is a relatively easy thing to manage; updating an existing one on a production environment with a lot of dependencies, is certainly not.

Like accomplished taxonomists, Scott Ambler and Pramod Sadalage elaborated an exhaustive catalog where they identified, named, and classified most (if not all) of the transformations that can be applied, not only to the database itself (e.g. Drop Column, Rename View, Split Table) but also to the data (e.g. Apply Standard Codes, Introduce Default Value, Introduce Common Format) and to the methods (e.g. Add Parameter, Rename Method, Remove Middle Man).

Each transformation is clearly explained together with a suggested strategy for rolling-it out into production. References on the inside cover serve as an index to easily locate each particular refactoring and transformation.

This book should certainly be on the bookshelf of any person responsible for maintaining a database.

Probably great for DBA - 2008-03-01
Reviewer Rating: 1 star rating2 star rating3 star rating4 star rating5 star rating
Probably great for a DBA or if you are executing SQL scripts for everything. I wish there was more on using ORM technologies such as Hibernate.

Browse Similar Topics

Top Level Categories:
Databases

Sub-Categories:
Databases > Database Design

Some information on this page was provided using data from Amazon.com®. View at Amazon >


About Safari Books Online • Terms of Service • Privacy Policy • Contact Us • Corporate Licenses • Help • Accessibility | See us on FacebookSee us on Linked InSee us on TwitterRSS

Copyright 2010 Safari Books Online. All rights reserved.