Re: Best Way® to test for existence of a rela tionsh ip

2008-04-07 Thread Chuck Hill
I'd expect the instanceof check will be much more efficient than catching an exception. From an OO design point of view, I'd add a billsOfMaterial() method to the Part class that simply returns NSArray.emptyArray. ManufacturedPart will then override this to return the correct result for

Re: Best Way® to test for existence of a rela tionsh ip

2008-04-07 Thread Mike Schrag
I'd expect the instanceof check will be much more efficient than catching an exception. By far ... From an OO design point of view, I'd add a billsOfMaterial() method to the Part class that simply returns NSArray.emptyArray. ManufacturedPart will then override this to return the correct

Re: Best Way® to test for existence of a rela tionsh ip

2008-04-07 Thread David Avendasora
On Apr 7, 2008, at 10:36 AM, Mike Schrag wrote: I'd expect the instanceof check will be much more efficient than catching an exception. By far ... From an OO design point of view, I'd add a billsOfMaterial() method to the Part class that simply returns NSArray.emptyArray.

Re: Best Way® to test for existence of a rela tionsh ip

2008-04-07 Thread Chuck Hill
On Apr 7, 2008, at 7:36 AM, Mike Schrag wrote: I'd expect the instanceof check will be much more efficient than catching an exception. By far ... From an OO design point of view, I'd add a billsOfMaterial() method to the Part class that simply returns NSArray.emptyArray.

Re: Best Way® to test for existence of a rela tionsh ip

2008-04-07 Thread Chuck Hill
On Apr 7, 2008, at 8:26 AM, Bob Stuart wrote: At 11:20 AM -0400 4/7/08, David Avendasora wrote: On Apr 7, 2008, at 10:36 AM, Mike Schrag wrote: I'd expect the instanceof check will be much more efficient than catching an exception. By far ... From an OO design point of view, I'd add a

Re: Best Way® to test for existence of a rela tionsh ip

2008-04-07 Thread Mike Schrag
Using instanceof on a member of an inheritance hierarchy is a bad code smell. It is the code's ways of telling you that your design is wrong. IMO. I was going to say in my original that instanceof is a code smell, also, actually, but we disagree on the level of ugliness :) You're just

Re: Best Way® to test for existence of a rela tionsh ip

2008-04-07 Thread Chuck Hill
On Apr 7, 2008, at 8:45 AM, Ken Anderson wrote: Using instanceof on a member of an inheritance hierarchy is a bad code smell. It is the code's ways of telling you that your design is wrong. IMO. Almost as bad as using case statements! (doh!) Case statements are right out! Chuck

Re: Best Way® to test for existence of a rela tionsh ip

2008-04-07 Thread Chuck Hill
On Apr 7, 2008, at 8:45 AM, Mike Schrag wrote: Using instanceof on a member of an inheritance hierarchy is a bad code smell. It is the code's ways of telling you that your design is wrong. IMO. I was going to say in my original that instanceof is a code smell, also, actually, but we