From: "Weirich, James" Date: 2003-11-20T07:33:14+09:00 Subject: Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) Sean O'Dell writes: > > Actually, it tells you exactly. If a class inherits from String, you know it > > has all the methods String does, and you know exactly what parameters they Charles Hixson writes: > No, you don't know that at all. It's a reasonable > presumption, but any, or all, or the methods that you think > are there might have been overridden. And might do something > totally different. And this may be for either a good reason > or a silly reason. Several people have said this, and although true, this is not my main concern and if people make an object non-LSP compliant, then they get what they deserve. However, my concern is the insistence that only those things that have String in their ancestry can have string like behavior and can be passed to functions expecting a string like object. And this is what I thought Sean was saying (i.e. advocating ancestry checks). I now think what Sean is some way of "marking" a class to indicate that in implements a particular protocol. That marking could be through inheritance, but could also be done by some alternate mechanism. This (IMHO) is not nearly as onerous as ancestor checking. But I'm not convinced of its utility yet. I'll have to think about this. Sean, did I capture your thoughts accurately? Or am I still missing something. -- -- Jim Weirich / Compuware -- FWP Capture Services -- Phone: 859-386-8855