O'Reilly logo

Agile Database Techniques: Effective Strategies for the Agile Software Developer by Scott Ambler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 13. Database Encapsulation Strategies

Coupling is your greatest enemy. Encapsulation is your greatest ally.

Encapsulation is a software-design issue that deals with how functionality is compartmentalized within a system. The main concept behind encapsulation is that you should not have to know how something is implemented to be able to use it. Some people say that encapsulation is the act of painting the box black — you are defining how something is going to be done, but you are not telling the rest of the world how you're going to do it. For example, consider your bank. Do they keep track of your account information on a mainframe, a mini, or a PC? What database do they use? What operating system? The answer is that it doesn't matter to you; the bank has encapsulated the way in which they perform account services. You just walk up to a teller and perform whatever transactions you wish.

The implication of encapsulation in terms of software development is that you can build the separate components of a given application in any way you want and then later change the implementation without affecting other system components (as long as the interface to that component did not change).

This chapter explores:

  • Database encapsulation layers

  • The role of the agile DBA

  • Encapsulation layer architectures

  • Encapsulation layer implementation strategies

  • Marshaling and data validation

  • Error handling

Database Encapsulation Layers

A database encapsulation layer hides the implementation details of your ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required