Re: Cocoa et al as HCI usability problem
Re: Cocoa et al as HCI usability problem
- Subject: Re: Cocoa et al as HCI usability problem
- From: Jean-Daniel Dupas <email@hidden>
- Date: Mon, 19 May 2008 12:26:49 +0200
That'd be great for the Mac, but not so great for the Cocoa
evangelists. It's hard to understand the neglect Java has seen on
the Mac, except as a way to try to steer more people towards Cocoa.
Cocoa is a framework, Java a language. Apple provided a Cocoa/Java
bridge to let developpers choose there prefered language to use Cocoa,
and bet what, almost nobody choose Java. That's why the bridge is no
collapsing slowly.
In Obj-C, if the object doesn't respond to the selector, doesn't it
just fail silently? I'd think in Obj-C you wouldn't even bother to
check whether it responds to the selector, unless you had a "Plan B"
you wanted to use when it didn't.
But ignoring that for a moment, how is this example any different
from a Java or C# class implementing an interface that declares a
"rotateInDegrees" method? The equivalent C# code would look
something like this:
foreach (object anObject in userSelection)
{
IRotatable rotater = anObject as IRotatable;
if (rotater != null)
{
rotater.rotateInDegrees(90);
}
}
or if you like briefer:
foreach (object anObject in userSelection)
{
if (anObject is IRotatable)
{
((IRotatable)anObject).rotateInDegrees(90);
}
}
It's different because there no informal protocol in C#, so you have
to create a interface for each optional method you want to add to your
object, and then declare that you implement each interfaces in your
class declaration.
Yes, it's possible to achieve the same things, but it's not as easy
and natural.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden