• 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: Attachable and observable patterns
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Attachable and observable patterns


  • Subject: Re: Attachable and observable patterns
  • From: John Calsbeek <email@hidden>
  • Date: Thu, 14 Jul 2005 17:35:23 -0500

What's the best way to implement attachable and observable patterns in Cocoa/ObjC?

This is a brand new app for Tiger or later. The basic design is a pipe-and-filter that processes incoming network packets (normal app, not a kext or anything). I want to be able to add 0..* observers or attachments to each stage that can either do stuff based on or do stuff to the packets as they progress through the filters.

If I were doing this in Java, I'd be tempted to give each of the filters a Vector objects that implement Observable or some interface with an "execute" method, but I suspect I may be missing something I can get for free in Cocoa that is more efficient. Delegates and notifications look sort of promising, am I on the right track? Any particularly beautiful examples of this being done?

I'm a complete Cocoa and ObjC novice, so there is no such thing as an obvious answer to me right now. Any suggestions are welcome.

For at least the observing part, you may want to take a look at these pages:


<http://developer.apple.com/documentation/Cocoa/Conceptual/ KeyValueCoding/index.html>
<http://developer.apple.com/documentation/Cocoa/Conceptual/ KeyValueObserving/index.html>


-John Calsbeek
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Attachable and observable patterns
      • From: email@hidden
References: 
 >Attachable and observable patterns (From: email@hidden)

  • Prev by Date: Re: how to evaluate an NSString content as a real obj-c instruction/expression
  • Next by Date: Creating an XML document
  • Previous by thread: Attachable and observable patterns
  • Next by thread: Re: Attachable and observable patterns
  • Index(es):
    • Date
    • Thread