discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GNUstep vs WebObject (YellowBox) incompatibilities


From: Wim Oudshoorn
Subject: GNUstep vs WebObject (YellowBox) incompatibilities
Date: Mon, 13 Jan 2003 14:27:08 +0100
User-agent: Mutt/1.4i

At the moment we are validating GNUstep base as a replacement for
Apple's foundation on Windows.

Beside the missing NSConditionLock, and the fact that +load 
is not called we found two incompatibilities.

1 - NSConnection
================

1.1 - Problem description
-------------------------

In GNUstep base [[NSConnection alloc] init] returns the default
connection.  This is done deliberately according to the following
snippet:

/**
 * Undocumented feature of OPENSTEP/MacOS-X
 * -init returns the default connection.
 */
- (id) init
{
  RELEASE(self);
  return RETAIN([connectionClass defaultConnection]);
}


However in WebObjects 4.5, (and all other version I know of),
this is not the case.  In WebObjects it will create a new connection object.

To me the WebObjects way makes more sense.  I normally create a NSConnection
when I want to vend an object.  So basically something along the lines:

  con = [[NSConnection alloc] init];
  [con registerName: @"a name"];
  ...

If I do this twice it will vend 2 objects on WebObjects, but it will only
vend the last object on GNUstep.


1.2 Solution
------------

I think the WebObjects way makes more sense but I do not really care.
If really works that way on MacOSX and we want to be compatible with that
I am fine.

1.3 Source
----------

Source code of example program attached.


2 - NSInvocation
================

2.1 - Problem
-------------

On Apples Foundation an NSInvocation will retain the return value of the
invoked method.  GNUstep does not do this.  So suppose we have:

@interface Test: NSObject
- (id) xxx;
@end

// create invokcation that will call xxx

[inv invoke];

than on Apples foundation you will notice that the return value is
retained by the invocation.  GNUstep does not do this.  This lead to
problems when you are in a multithreaded environment and expect to be
able to reat the returned value, but the other thread release the return
value.


2.2 Solution
------------

I think this should be fixed.  But maybe someone can test this on MacOSX if
that is important.  If the change in behaviour is accepted I will make a patch
and send it.

2.3 Source
----------

Sample program is attached.


Wim Oudshoorn.



 

Attachment: NSConnection-test.tar.bz2
Description: Binary data

Attachment: NSInvocation-test.tar.bz2
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]