What is a "necessary evil"?
Charles Eliot stopped me in the café at lunch today and asked me to clarify my comments about why direct database access in MS-CRM is a necessary evil. Actually, I think I used the phrase "evil-but-absolutely-necessary" when I described the design and implementation of filtered views.
Way back when the CRM product was in design we had a few ideas about how the database should look. One camp took a very esoteric, but correct, view. The other had a highly normalized and simplified view. The latter design was chosen. One of the core tenets of that design was its inherent readability. Not necessarily readable by average users, but readable by people who'd have to write those "special" reports that the system didn't provide.
Why does this matter? Well, because the idea was that the database should be accessible and not locked away. I always believed, and still do, that the data and the database belong to the customer and they can do damned near anything they want. We wrapped the database in a user-protective layer called the CRM platform and asked that anybody wanting to write to the database go through that layer. We never said you couldn't read directly from the database though.
What we did say, although I suspect the written word is a little light, is that we reserve the right to modify the data structures on a release-by-release basis to provide greater functionality, faster access, bug fixes, and so forth. I even went so far as to say that we would break any application written which bypassed the platform layer, and I said it in public several times.
With the release of 3.0 and the exposure of filtered views we still reserved the right to break any application written on those views. Only, in this case, because we released the bits as a "feature" and then started talking that same feature up, we got ourselves into a situation where breaking applications isn't a great idea. In short we said "go ahead and use the filtered views, they're good for you". But, we didn't look far enough into the future to see what effect that would have on innovation.
So, I stand by my comment. The filtered views, and by extension direct database access, is an evil-but-absolutely-necessary thing. It can't go away. It probably can't even change significantly. But, I expect those views to morph over time as new schema concepts are introduced.
On continuous loop for the last few days is Zero: A Martin Hannett Story. It's a must listen for any fan of Mancuncian music from the late 70s and early 80s.