Chapter 20. Objects and SQL
This chapter covers:
I’ve never designed physical products, only software. But I’ve noticed that physical objects, no matter what their shapes, tend to be packaged in rectangular boxes and crates. An example would be the broadband router I received in the mail a while ago. There was the router itself, neatly box-shaped, an AC adapter, which is much more irregular, a cable folded and packaged with a clip, and an installation guide. All of this was safely ensconced in an unsurprisingly rectangular cardboard box with the aid of some extra packaging materials.
Although I’m anything but an expert on this kind of packaging, I can guess one reason the outermost box is rectangular: it’s easy to stash on storage shelves. I can just imagine what would happen if they were irregularly shaped: put package number 500 in place, and it topples the 499 previous ones.
Something similar happens in object-oriented programming. It’s a bit like trying to put a round peg into a square hole. Object-oriented programming and relational databases don’t go well together because the way data is represented and handled is fundamentally different in the two worlds.