• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Plug Ins - To Subclass or to Protocol?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Plug Ins - To Subclass or to Protocol? (From: Lee Morgan <email@hidden>)
 >Re: Plug Ins - To Subclass or to Protocol? (From: Prachi Gauriar <email@hidden>)

  • Prev by Date: NSString or NSData
  • Next by Date: Re: counting objects in array
  • Previous by thread: Re: Plug Ins - To Subclass or to Protocol?
  • Next by thread: Re: Plug Ins - To Subclass or to Protocol?
  • Index(es):
    • Date
    • Thread