• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Re-engineering legacy software: the database side

 
Bartender
Posts: 1357
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone,
In re-engineering software, the code part is crucial. Anyway, coding is only a side of the medal. Refactoring legacy databases design should play an important role too.
In my experience, I've seen applications whose related database didn't follow the very basic rules of ER model.
Is Chris' book somehow addressing this matter too? And what are your opinions/experiences about ?
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll let Chris answer for his book but Scott Ambler's book "Refactoring Databases" (2006) might give you some ideas as well. Scott is a very opinionated author, speaker, and blogger and his articles and books are always interesting to read at the very least.
 
Junilu Lacar
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As with most of the code I have refactored over the years, the database refactorings I've done involved mostly stored procedure code that needed to be decomposed into more focused chunks, decoupled, generalized (introduce parameters, extract constants), and clarified (rename variables).

If you have a good DBA and/or database designer and relatively well-defined entity-relationships, then you probably have a decently normalized database design that is amenable to changes. Adding columns to an existing table is usually a trivial exercise when you have a normalized database. Other kinds of changes may require you to write some data migration scripts but those are usually straightforward if you have a normalized db. Just like the problems posed by duplication and tight coupling in code, a poorly normalized database hinders your ability to make changes and you should try to address those kinds of issues first.
 
Claude Moore
Bartender
Posts: 1357
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Junilu, thanks for your kind answers. For sure, I'll have a look to the book you suggested.
 
Author
Posts: 18
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not planning to discuss DB refactoring specifically in the book, but in the chapter on full rewrites I will talk about how to mange the DB. e.g. sharing the DB with the existing application vs creating a new DB from scratch.

Usually I find it easier to leave the DB alone as much as possible, and instead put effort into writing a good data access layer that can hide the crazy details of the legacy DB from the rest of the application. One reason for taking this approach is that there often other systems (batches, reporting scripts, etc.) that also depend on the DB, making it difficult to change.
 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
Greetings!
Another thing I noticed with legacy projects - Many a time the necessary constraints are missing...

Adding these much later - can possibly break data loading programs...
 
reply
    Bookmark Topic Watch Topic
  • New Topic