From: Sean O'Dell Date: 2003-11-20T08:21:34+09:00 Subject: Re: "stereotyping" (was: Re: Strong Typing (Re: Managing metadata about attribute types) ) On Wednesday 19 November 2003 03:04 pm, Austin Ziegler wrote: > On Thu, 20 Nov 2003 06:05:21 +0900, Sean O'Dell wrote: > > On Wednesday 19 November 2003 12:37 pm, Weirich, James wrote: > > I agree, but "interface checking" doesn't have to involve > > developing an abstract, nor does it require inheritance. > > > > You can say: > > class MyFakeRuwikiClass > > interface RuwikiClass > > end > > > > The above is a class which does not inherit from RuwikiClass, but > > declares itself an implementation of the RuwikiClass interface. > > Further, the original developer of RuwikiClass did not have to > > develop an abstract. The interface declaration is just a > > statement; no methods are checked, nothing is inherited. It's just > > a way to keep the developers head up about what they're doing. > > It's also a lie. MyFakeRuwikiClass doesn't implement the necessary > interface. And *that*, Sean, is why name checking *of any sort* is > useless. MyFakeRuwikiClass says that it's a RuwikiClass, but it > isn't. But to a person passing in a unsuitable object, it notifies them "hey, you need this object here." Right now, you just get deep errors. Either way, you can lie and force in anything you want. The initial error message gives you a heads-up, though. Sean O'Dell