Friday, Aug 17, 2007, 1:42 PM in .NET
Duck Typing for .NET!
1 comment
on this post
Eirik Mangseth:
Example: Let's say you're going hiking and pack a rucksack for the trip. It would be nice to know how much the rucksack weighs and of course you send the rucksack the message rucksack::weight. The rucksack iterates over its content sending each item the message ::weight. In a single inheritance language, you either have to let all items in the rucksack share a common ancestor which doesn't really make sense or you can define a contract saying that to be allowed into the rucksack an item has to adhere to a specific protocol, e.g. protocol xyz {decimal weight}.
EM
Tuesday, Aug 21, 2007, 1:11 PM



