Its easy. Just do what I did. First, turn off your brain. Then tell somebody that adapters and dependency injection work in similiar fasions. Have that somebody tell 10 of their friends, and then each of those 10 people tell 10 more people and so on. But don’t stop there. Then tell that person that facades and templates behave the same. Repeat the whole tell your friend have them tell their friend thing.
Ok, so now that you look like a complete and utter idiot, turn your brain back on. Go back and read the conversation, think about who was talking here, realize it was you, go puke in the toilet and then bury your head in the sand in embarassment.
I’ve never had an episode of complete brain malfunction like that before in my life. You ever just have something snap in your head, like something turned back on and say to yourself “What? Huh? Wait a minute, what did I just say?”
Just for clarification, adapters and DI do not behave the same. At all. Adapters “adapt” from interface A to interface B. DI is a custom implementation plug-in like behavior pattern.
Also, subconsciously, I meant to say that adapters and facades behave in similiar but obviously seperate fasions. Facades provide unified interfaces (this is where template crossed my mind because you often used facades to unify multiple template interfaces, at least I do) and adapters, again, adapt interfaces from one to another. Why random misfirings occurred in my brain and those 3 simple, one line explanations came out all wrong, I may never know.
Please tell me that I’m not the only one to have done something this stupid and embarassing. Please. Share your quick stories here so I won’t feel alone.