Re: Plug Ins - To Subclass or to Protocol?
Re: Plug Ins - To Subclass or to Protocol?
- Subject: Re: Plug Ins - To Subclass or to Protocol?
- From: Lee Morgan <email@hidden>
- Date: Wed, 21 Jul 2004 19:26:06 -0400
On 21 Jul, 2004, at 18:56, Prachi Gauriar wrote:
I would just use a protocol. It affords the plugin developers the
most flexibility, while still defining an interface between the plugin
and your app. In addition, you probably aren't providing any common
data for all plugins, just a list of methods that the plugin should
respond to. As such, a protocol seems like the best tool for the job.
Since you're dealing with different types of objects, you can just
pass a common superclass of those types to the plugin, or better yet,
id. As far as the plugin telling you what types it can handle, a
simple method like
+ (NSArray *)acceptedTypes;
that returns the types it can operate on should work swimmingly.
Thanks, for the suggestion.
You have a good point - in that since I'm not having any data for the
plug-in object - that it can simply follow a protocol, and that should
give more flexibility also.
thanks for your time,
lee
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.