Saturday, January 10, 2009

The Component Conundrum

I know, I should write Coldfusion applications with components as the building blocks. I get it, really-- it's better for maintenance, code reuse, separates your content from your business process. Seriously, I understand how important it is.

Too bad I can never get it to work. :(

See, here's my problem. Let's say I want to write a CFC (Coldfusion component, for the uninitiated) that accepts an employee's ID number, queries Active Directory, and returns the employee's name, phone, email, and basic contact info. It sounds like a great idea, doesn't it? Set it up as a component, accept three arguments, the ID number, and the user id and password of the account to use for LDAP. Then, you can leverage and reuse it for all your application, or your team-mates can use it in their programs . . .

Oh, um, wait, that's weird-- the field in Active Directory for employee ID number seems to be empty. Not sure what that means. Hang on a sec, let me call the Tech Support folks.

(ten minutes later)

Well, it seems that whoever set up our Active Directory felt that using the field called Employee ID to actually hold the ID numbers was too generic and needed to be more proprietary or secure or . . . something, so they actually keep that information in ExtensionAttribute22 instead. And now, we have a component that only works with your specific and unique implementation of Active Directory.

I know, it's a grossly oversimplified example, but I think it makes the point. It's hard enough for those of us who don't think natively in object-oriented fashion to figure out what should be turned into a component, then to plan out the various properties and methods. It's downright demoralizing to discover when we try to implement them that someone has made a seemingly arbitrary change to the configuration of something with which we must interact. I mean, why don't you change the name of the mail server to "Linda" or "Lassie" or "Ficus Green Pearl", while you're at it?

I just want some consistency when I work. Not like I'm asking you to get me sharks with friggin' lasers attached to their heads.

No comments: