Yes, I ‘m lying in my upcoming Java tutorial. I went again through the lesson about the Java interfaces. Well done, Yakov! Nicely explained the concept of interfaces and how they are great for offering polymorphic solutions. But I lied. Why?
I did it because this is what Java newbies have to say during technical job interview. Why? Because the chances are very high that people who will interview newbies also think so. And newbies won ‘t be able to convince the interviewer that even though programming to interfaces may look better to those (PEOPLE) who read the code, they still lead to tight coupling between objects. Even the definition “the interfaces is a contract between… ” clearly states that you can ‘t breach the contract, and you must read the contract.
What ‘s better? Events. An object A fires an event to an object B. No, I lied again. An object A is firing an event to whoever. It ‘s none of its business to whom. When Howard Stern broadcasts he has no idea who is listening to him. Whoever subscribed to this message. Think decoupling. Events. Observer-observable. Dependency Injection.
Read my book. Pass the interview. Accept the offer. Walk into the building on Monday. Stop by the cubical of your interviewer and say, “Sorry, man. I lied to you during the interview, but I didn ‘t have a choice “.
What a gibberish is this blog, right? I know.