Re: Strategies to prevent class name clashes
Re: Strategies to prevent class name clashes
- Subject: Re: Strategies to prevent class name clashes
- From: Arne Scheffler <email@hidden>
- Date: Fri, 15 Feb 2008 11:22:37 +0100
On Feb 15, 2008, at 10:42 AM, Lieven Dekeyser wrote:
On 15 Feb 2008, at 10:09, Arne Scheffler wrote:
Hi,
I'm just porting an open source UI toolkit to Cocoa. This toolkit
is mainly used in plug-ins by many different people. So it's more
than likely that two or more plug-ins get loaded into the same
process. It's also very common that the people who uses the toolkit
modify the source. This all worked in C++ because all bundles were
loaded into different name spaces. With Objective-C this is no
longer the case. I already got a problem while porting that two
plug-ins that uses the toolkit were compiled at different times
with different code. But as a nature of Objective-C it only loaded
the classes once. I'm looking now for a way to prevent this. Does
anyone have any idea how to best deal with this ?
Use class name prefixes as a simple namespace substitute. That's why
Cocoa class names are prefixed with NS ( see "Prefixes" in http://www.stepwise.com/Articles/Technical/2002-10-13.01.html
).
So, you want to advise me that every user of the toolkit should edit
the objective-c class names ?
Programmers are lazy. They simply forget to do this and the result
will be that the hosting app will eventually crash. So this is not a
solution for me.
thanks anyway
arne
_______________________________________________
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