On 07:42 Tue 25 Jan , Edgardo Hames wrote: > 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? You've got it! Congratulations. :) > > Please, post a positive reply and you just may save me a couple of > therapy sessions :P I'm happy to be of service. That'll be $250. :-P > > Kind Regards, > Ed > > -- > Alcohol is the anesthesia by which we endure the operation of life. > -- George Bernard Shaw > > -- Jamis Buck jamis_buck / byu.edu http://jamis.jamisbuck.org ------------------------------ "I am Victor of Borge. You will be assimil-nine-ed."