Skip to main content

skip to main content

developerWorks  >  SOA and Web services  >

Common data design problems

Data designs are often far from ideal, so learn to spot common problems

developerWorks
Document options

Document options requiring JavaScript are not displayed


Rate this page

Help us improve this content


Level: Introductory

Scott W. Ambler, Prectice Leader, Agile Development, Rational Methods Group, IBM

01 Jul 2001

The need to work with questionable legacy data designs is a fact of life. With an understanding of the common design problems that Scott W. Ambler illustrates and analyzes in this tip, you can arm yourself in the inevitable struggle against imperfect data designs.

Existing data designs, and even new data designs, are rarely perfect and are often significantly flawed. The reality is that most developers must tolerate an existing legacy design, one that is often difficult, if not impossible, to change because changes in the existing legacy design would necessitate corresponding changes to the legacy applications that access it. In my last tip, Challenges with legacy data, I explored some of the common problems that you'll run into with the data itself. In this tip I examine common data design problems that you are likely to experience: They're summarized in Table 1. In the next and final tip in this three-tip series, I'll explore potential solutions and tools to address these problems.

Table 1. Database design problems

ProblemExample(s)Implications
Database encapsulation scheme exists
  • Access to the database provided only through stored procedures. For example, to create a new customer you must invoke a specified stored procedure.
  • Access to views on the database is permitted, direct table access is denied.
  • The database must be accessed via an API implemented by a C or COBOL wrapper that in turn accesses the database directly.
  • The database must be accessed via predefined data classes/objects.
  • To enable container-managed persistence (CMP) in an EJB environment, the encapsulation scheme must be made to look like a data source that your persistence container recognizes. Otherwise you'll be forced to take a session-bean managed persistence (SMP) or bean-managed persistence (BMP) approach.
  • The encapsulation scheme will likely increase the response time of database access.
  • The individual components of the encapsulation scheme may not be able to be included as a step in a transaction.
Naming conventionsYour databases may follow different naming conventions from one another, and likely do not follow common Java naming conventions.
  • The deployer(s) will need to understand all relevant naming conventions.
  • Political pressure may be put on your team to follow inappropriate corporate data naming conventions for use with your objects.
Inadequate documentation The documentation for your database is sparse, nonexistent, or out of date.
  • A significant legacy data analysis effort will be required to determine the proper usage of each table, column, and stored procedure within your database.
Original design goals at odds with current project needsThe legacy database was built for internal use by data entry clerks to capture customer orders in batch mode, whereas you are building an 24/7 order-entry application to be deployed over the Internet.
  • Good luck, you'll need it.
Inconsistent key strategyYour database uses natural keys for some tables, surrogate keys in others, and different strategies for surrogates keys when they are used.
  • Developers must understand and then appropriately code support for the various key strategies for their objects.
  • Key-generation code increases in complexity to support the various strategies.
  • Additional source code to validate that natural keys are unique will be required.
  • Relationship-management code increases in complexity because you can't code and then reuse a single approach.

Note: This tip was modified from the Mastering Enterprise JavaBeans 2/e, to be published in autumn of 2001.



Resources

  • Find all the nuts and bolts you need for using Java to develop DB2 Universal Database applications at the Java Enablement with DB2 page.

  • With DB2 Data Joiner middleware, a single SQL statement can access and join tables located across multiple data sources (including databases from vendors other than IBM) without needing to know the source location. With only one API to deal with, application development is easier: You tell your application how to talk to DataJoiner, and DataJoiner talks to all the different databases in your organization.


About the author

Scott W. Ambler is a Practice Leader for Agile Development within the IBM Methods group. He develops process materials, speaks at conferences, and works with IBM clients worldwide to help improve their software processes. Scott is author of several books, listed on his Web site at www.ambysoft.com. Scott is also a recognized Ratonal Thought Leader, whose homepage may be viewed here.




Rate this page


Please take a moment to complete this form to help us better serve you.



YesNoDon't know
 


 


12345
Not
useful
Extremely
useful
 


Back to top