From: Edgardo Hames Date: 2005-01-25T07:42:13+09:00 Subject: "Duck Typing" or "No need for abstract classes" Hi, you all. I'm working on a new small project where several network protocols are to be supported. I had an idea about how to implement it and it resembled something like this. class Protocol abstract :login, :logout, :send, :receive end class MyProtocol < Protocol def login # does something useful end ... # so on end Then my network client would just call the methods of a Protocol object without caring about the actual classes that implement it (yes, you're right, I come from a static typing background). But then I read something (I don't remember where :( ) which said that agile languages don't need to implement so many patterns and I think I saw the light! I don't need a Protocol class, the network client should just call the methods of the protocol and duck typing should do all the magic. Am I right? Am I coming a little closer to walking the Ruby Way? Please, post a positive reply and you just may save me a couple of therapy sessions :P Kind Regards, Ed -- Alcohol is the anesthesia by which we endure the operation of life. -- George Bernard Shaw