swarm-hackers
[Top][All Lists]
Advanced

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

Re: [swarm-hackers] Naming conventions


From: Bill Northcott
Subject: Re: [swarm-hackers] Naming conventions
Date: Thu, 19 Nov 2009 11:13:56 +1100

On 19/11/2009, at 5:30 AM, Scott Christley wrote:
>> Do the resulting Swarm objects understand both 'new' and 'create' 
>> instantiation methods?  (I understand that mixing them is a quick way to a 
>> crash.)  Would this mean that they are 'first class' Cocoa objects, but that 
>> one should never invoke a Cocoa method on a Swarm object even though 
>> introspection would show it as available?
> 
> I think pretty much just the instantiation methods are an issue, so 'new' 
> shouldn't be used for Swarm objects, but other methods should be just fine.  
> So yes the idea is in many ways that Swarm objects be 'first class' Cocoa 
> objects.  I think though that it might be relatively straightforward to 
> redirect the Cocoa methods 'alloc', 'new', etc to call the Swarm 
> instantiation methods.  The other possibility is to have the Cocoa methods 
> throw exceptions and point the user to 'create', actually that was the error 
> that Nima got when he mixed the two.

I might still try to argue that models should be written in Swarm style.  So 
they remain portable across host systems.

Where I thought Cocoa would be useful is to write a MacOS gui for the model 
control, probes, spaces and graph displays.  This code would be hidden from 
users within the Swarm framework.

I think it is hard enough to explain to users that the Swarm API is completely 
different to the Cocoa API (which they see in all Apple's docs), without 
muddying the waters by saying that the two can be mixed if you are skilled 
(lucky?).

Bill
PS what about garbage collection?  I seem to remember there were some hooks for 
GC in the Swarm libraries.  Can these, do these hook into Objective-C 2.0 GC?

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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