Chapter 2. Theory and Concepts
In this chapter, I need to spend a little more time on some basic theory. I know you’re ready to get to some code, but reading through this section will prepare you for the terms and concepts that I’ll use later in the book and will also allow you to focus on application throughout the rest of the chapters. In the last chapter, you got a very quick rundown of both data-centric and business-centric APIs. In this chapter, I drill down into some of these APIs. However, instead of detailing what the APIs are, or how to use them, I focus on their relation to data binding. For example, most data binding packages allow you to set a SAX entity resolver, so I spend a little time detailing what that is. Since you won’t ever need to use a SAX lexical handler, though, I skip right over that. Make sense?
In this chapter, I also explain how XML is modeled with constraints, cover the various constraint models currently available, and then funnel this into discussion of how constraints are critical to any data binding package. This will set the stage for Chapter 3, for which you need to have a good understanding of XML validation, DTDs, and XML Schema. Additionally, you’ll learn about some of the newer constraint models that may affect data binding, like Relax NG.
Finally, I get a bit conceptual (but only briefly) and talk about the relevant factors for a good data binding API. You’ll learn about runtime versus compile-time considerations, how versioning is a tricky ...