Nov. 21, 2006, 10:07 a.m.

Layering

Layering example People have trouble working in layers. I don't get it. Please see the block diagram to the right for a summary of this post.

There have been several times people have asked me questions starting with the lowest layer possible and working their way up to their actual question. Meanwhile, I've spent at least a half an hour trying to explain some of the lower-level parts of a system that were contained and well-tested before finding out the question I was actually being asked was, and then finding out that that question already had a well-documented answer.

So, my tip of the day: If you want a good understanding of what you're doing, try not to force yourself to understand every detail of the system on which it's built.

Example (hypothetical, nobody asked me this yesterday): If the system has a mechanism for intra-cluster distributed notifications to which subscribers may attach either programmatically or by database-driven configuration and on top of that is built a DAO framework that supports these notifications for cluster synchronization and you're building on top of that yet another simple DAO, don't ask about the wire protocol. It won't help you. Just read the documentation for the framework. Come on, it's only got three public instance methods. One of them says it's for unit tests, so ignore it. The documentation on the second one is phrased almost exactly like your question. The third one calls the second one in a way that's expected to be used commonly, much like what you want -- um, hypothetically.

Of course, I would recommend understanding every part of every system you're working on. Do that when you're not working on it, though.

blog comments powered by Disqus