Re: cocoa java bridge: converting nsarray to java array
Re: cocoa java bridge: converting nsarray to java array
- Subject: Re: cocoa java bridge: converting nsarray to java array
- From: Matthew <email@hidden>
- Date: Sun, 21 Nov 2004 15:51:33 -0500
The encapsulation isn't being broken. I misspoke, but here's what I was
thinking:
Well, suppose that if you have a java class with a ton of methods that
are all used frequently...further suppose that there's only one of
those methods that you'd be writing a wrapper for to extract the
contents of the NSArray (assume all of the others accept strings, ints,
or whatever else passes 'easily'.
So you have a single Java class with plenty of methods fine to use 'as
is' and then this auxiliary wrapper for one of its methods, so the Java
class can't take data form the Java bridge 'as is' without that extra
wrapper. in other words, it seems to me that the Java bridge should
pass data from the Objective C side and there should not have to be any
extra wrappers and data conversion on the Java side in order to accept
it. Maybe this isn't breaking encapsulation strictly speaking, but it
seems like there's something awkward going on since the Java class
needs a helper method outside itself as it was originally defined.
I'm having a hard time understanding why it's unreasonable to pass an
NSArray of NSString to a Java method and have it accept it 'as is', as
an array of String[]. But again, I've done very little with the Java
bridge and this might seem completely reasonable to those of you who
have used it frequently.
Is this then a matter of Apple just not getting around to implementing
this functionality, am I expecting something unreasonable, or is this a
design decision that purposefully needed to be this way? Seems to me
that if Java can send things to the Obj C side like an NSArray, it
should be a mutual 2 way street?
On Nov 21, 2004, at 3:32 PM, j o a r wrote:
In what way is encapsulation of the Java class broken?
(Please don't cross post!)
j o a r
On 2004-11-21, at 21.05, Matthew wrote:
Ok, I think that will work for the time being. Thanks for the
suggestion. It still seems kludgy, however, that in order to make
this happen, you have to violate the encapsulation of the Java class
to get the NSArray to 'pass through' the way you'd like. Seems like
there would be a cleaner way of making this happen. Oh well.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden