Thursday, November 13, 2008

you're a backend service, forget about the user

The title is an excerpt from my conversation this morning with a class ... no, not any class, you'll find out in a sec.

Her name is LibraryService and has been around for quite some time, and I can tell you she's on no diet. It grew to the point that no sane developer wanted to get in trouble with her, so they just feed her and everybody seems to get along. Just leave her alone, otherwise she might get nasty and do exceptional things that you won't expect.

She sits between the friendly GUI fellows that talk nicely to the user, inform him of errors, handle his mouse clicks, in a word they behave nicely as any counter officer should (some call them handlers) and the backend. So she takes the user's messages from the front-end guys through to the remote backend.

But this morning I discovered a hidden facet of her, let's call it update that does not yell back if she could not deliver the message. And this is most unusual for her, she that is always loud and ... nasty. Instead she bypasses the nice guys in front, picks up the receiver and calls the user directly (pops up a dialog in case you did not get the metaphor). This is wrong because the nice guys in the front will never know what happened with the message, so they might want to retry sending it.

What I've discovered next might be the explanation of her behavior, a new life form called Actions that masqueraded both as a counter guy and as her, fooled both parts, and put himself in-between. This would be fine as long as he helped in translating the messages that go to and fro. But instead he maliciously started to ignore her answers, both the acknowledging and the exceptional ones. He doesn't even do the job by himself, he creates another anonymous life form that has a start facet and delegates all the work to it. So both malicious and lazy, what could be worse?!

I suspect this is the reason she got upset, and started talking directly to the user. Now I'll stop this detective role playing, cause the only thing I feel right now is refactor the hell out of these guys.

No comments: