[rabbitmq-discuss] Fwd: Fwd: Objective-C AMQP Library

Chuck Remes cremes.devlist at mac.com
Wed Jun 10 12:30:39 BST 2009


You're welcome!

4. I don't know anything about SenTest. It might be good; it might be  
bad. <shrug>

5. I was thinking along the lines of libev but someone may have  
already wrapped it in a nice little C API for creating embeddable  
servers. There are lots of projects out there so search around. Good  
places to start looking are github and sourceforge. It's kind of  
outside my zone of expertise too. I primarily write ruby stuff and  
when I need speed I dip into Java now instead of C.

As for general guidance, I would look at the available libraries for  
the various AMQP implementations from Apache, Rabbit, etc. Read  
through the protocol definition for 0-8 and 0-9-1 to get familiar with  
the protocol requirements. Make sure that whatever you create is *not*  
tied to a particular AMQP implementation. One of the best reasons for  
using AMQP is the stated goal of all vendors for perfect  
interoperability. It is achievable so make sure your library doesn't  
undermine that goal.

Have fun...

cr

On Jun 10, 2009, at 1:20 AM, Matt Todd wrote:

> Hi Chuck,
>
> Wow, great feedback! I will definitely take the opportunity to write  
> a few of these "spikes", and recommending the actual Cocoa API as  
> inspiration is so obvious and elegant it hurts!
>
> 1. Great!
>
> 2. Standard tools sound great. My target audience is primarily Mac  
> platform apps, and didn't even think of Windows; partly due to my  
> ignorance to Obj-C on the Windows platform but also because I just  
> haven't used Windows in several years. No offense to the users, but  
> I don't care about that platform. But, I do care enough about the  
> library to want it to remain as simple as possible, which should  
> improve the likelihood that it will work across platforms (unless I  
> do use the Cocoa framework, I guess).
>
> 3. See above, but I will definitely take this into consideration. I  
> want a library that Obj-C devs would use, not some lofty idea I  
> think is the best (or a great) approach. I love the evented model,  
> and NSNotification seems to match the ideas, but Delegation in  
> itself is almost like an evented model. I'm not married to either,  
> though.
>
> 4. Is using SenTest discouraged then?
>
> 5. Pardon my misspeaking, I meant to say that I should write all of  
> the components of AMQP, even those parts that include XML parsing  
> (as opposed to letting the C library do that for me), using a proper  
> XML parser handle that for me. I'm certainly that last person that  
> should be chosen for writing an XML parser! :) Also, great  
> suggestion to use C for the networking reactor. Perhaps even a  
> library like libev or kqueue can be used to create the evented model  
> I'm fond of? Though, I am speaking out of my zone of expertise here.
>
> 6. As I said before, probably the best suggestion in your stellar  
> email!
>
> 7. I may just end up with hundreds of these little "spikes" figuring  
> all of this out!
>
> There is an article that I have been reading about writing your own  
> AMQP library which has been informative, though not entirely  
> illuminating (regarding implementation details). Any specific  
> reading anyone would recommend for both AMQP protocol implementation  
> as well as Obj-C in general?
>
> Thanks so much for the great feedback and general guidance!
>
> Matt
>
>
>
> On Tue, Jun 9, 2009 at 12:24 PM, Chuck Remes  
> <cremes.devlist at mac.com> wrote:
>
> You're lucky in the sense that Obj-C gives you some of the same  
> dynamism as Ruby. You should be able to give it a nice wrapper.
>
> I'm not an Obj-C pro by any stretch but I'll take a crack at  
> answering some of your questions.
>
> 1. Obj-C is a C superset, so integration is pretty simple. Just  
> #include/#import the headers, make sure the correct files are on  
> your path and start compiling stuff.
>
> 2. A few suggestions...
> a. Keep the number of external dependencies low (see #5)
>
> b. Use whatever the current standard is for C-based applications  
> which is likely autoconf and make. This gets more complicated if you  
> want your library to be usable from Windows too.
>
> 3. NSNotification is a Cocoa API so if you use it then you are tying  
> the library to OSX (though NSNotification has probably been cloned  
> by the GNUstep project). Use the dynamism allowed in Obj-C and use  
> the Delegation pattern. If you are familiar with Cocoa at all, it  
> uses delegation all over the place. Copy that idea.
>
> 4. Look at OCUnit which is an Obj-C testing framework similar to the  
> old XUnit and JUnit frameworks. Ruby's Test::Unit was patterned  
> after that API too so it might be familiar to you.
>
> 5. I highly recommend *against* writing common utilities like XML  
> parsing. Someone else has already done the job for you so don't  
> reinvent the wheel. Make it a project dependency. For an AMQP  
> library I don't think you'll need to do this too often. If you  
> really plan to mimic the Ruby AMQP gem, you'll want to  see out an  
> embeddable C network server/library that can act as the central  
> network reactor.
>
> 6. The largest body of Obj-C code in the world is in the Apple Cocoa  
> API. Copy those patterns. You can't really make a DSL like you would  
> in Ruby though.
>
> 7. Why not? You might want to write a few "spikes" (small programs  
> that prove an idea out... kind of like what you do in irb).
>
> Good luck!
>
> cr
>
>
> On Jun 9, 2009, at 12:19 AM, Matt Todd wrote:
>
>> As a new Objective-C developer (just fiddling around with it), I've  
>> been thinking of a project to get my hands dirty with. I've been  
>> using RabbitMQ for some time in my Ruby projects and really enjoy  
>> using it, and the AMQP protocol should be fairly simple to grok and  
>> work with.
>>
>> Because of this, I'm currently looking to start building an  
>> Objective-C based client library as a pet project to get me  
>> actually working in the language.
>>
>> I'm thinking of using the experimental C language client code to  
>> power the functionality and giving it a nice Obj-C DSL and handling  
>> everything through a NSNotificationCenter to create an evented  
>> interface (similar to the EventMachine Ruby AMQP library I'm used  
>> to working with). This is the goal for now, anyhow.
>>
>> Being still very new to the language, and certainly being  
>> unfamiliar with the idiosyncrasies of developing libraries for Obj- 
>> C, I'm looking for input, support, and contributions for this  
>> endeavor from experts and enthusiasts with strong opinions and/or  
>> time.
>>
>> Let me stress my lack of exposure to Obj-C (nor have I done  
>> anything significant in C/C++ or any strongly typed, compiled  
>> language in quite some time). This means I'm currently asking the  
>> following questions (as noob as they may be):
>>
>> 1. How do I integrate the C library into this Obj-C library?
>> 2. How do I write a distributable, clean Obj-C library?
>> 3. Is an NSNotificationCenter-based implementation a good approach  
>> for an evented AMQP library?
>> 4. How do I mock objects in Obj-C (to not require an instance of  
>> RabbitMQ to be running for tests)?
>> 5. Should I just write this from scratch, including XML parsing et  
>> al?
>> 6. What does a good Obj-C DSL look like?
>> 7. Why would I start with a significant library to get familiar  
>> with the language?
>>
>> Fair warning, I'm a Ruby developer, mainly building web  
>> applications in Rails.
>>
>> Looking forward to hearing from you, and hope to get something  
>> worthwhile out of this.
>>
>> Matt
>>
>>
>>
>> -- 
>> Matt Todd
>> Highgroove Studios
>> www.highgroove.com
>> cell: 404-314-2612
>> blog: maraby.org
>>
>> Scout - Web Monitoring and Reporting Software
>> www.scoutapp.com
>> _______________________________________________
>> rabbitmq-discuss mailing list
>> rabbitmq-discuss at lists.rabbitmq.com
>> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
>
>
> -- 
> Matt Todd
> Highgroove Studios
> www.highgroove.com
> cell: 404-314-2612
> blog: maraby.org
>
> Scout - Web Monitoring and Reporting Software
> www.scoutapp.com
>
>
>
> -- 
> Matt Todd
> Highgroove Studios
> www.highgroove.com
> cell: 404-314-2612
> blog: maraby.org
>
> Scout - Web Monitoring and Reporting Software
> www.scoutapp.com
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20090610/23510ace/attachment.htm 


More information about the rabbitmq-discuss mailing list