<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><span class="Apple-style-span" style="-webkit-text-stroke-width: -1; ">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.</span></div></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>I'm not an Obj-C pro by any stretch but I'll take a crack at answering some of your questions.</div><div><br></div><div>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.</div><div><br></div><div>2. A few suggestions...</div><div>a. Keep the number of external dependencies low (see #5)</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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 &nbsp;see out an embeddable C network server/library that can act as the central network reactor.</div><div><br></div><div>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.</div><div><br></div><div>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).</div><div><br></div><div>Good luck!</div><div><br></div><div>cr</div><div><br></div><div><br><div><div>On Jun 9, 2009, at 12:19 AM, Matt Todd wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">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.<div> <br></div><div>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.</div><div><br></div><div>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.</div> <div><br></div><div>Being still very new to the language, and certainly being unfamiliar with the&nbsp;idiosyncrasies&nbsp;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.</div> <div><br></div><div>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):</div> <div><br></div><div>1. How do I integrate the C library into this Obj-C library?</div><div>2. How do I write a distributable, clean Obj-C library?</div><div>3. Is an NSNotificationCenter-based implementation a good approach for an evented AMQP library?</div> <div>4. How do I mock objects in Obj-C (to not require an instance of RabbitMQ to be running for tests)?</div><div>5. Should I just write this from scratch, including XML parsing et al?</div><div>6. What does a good Obj-C DSL look like?</div> <div>7. Why would I start with a significant library to get familiar with the language?</div><div><br></div><div>Fair warning, I'm a Ruby developer, mainly building web applications in Rails.</div><div><br></div><div> Looking forward to hearing from you, and hope to get something worthwhile out of this.</div><div><br></div><div>Matt</div><div><br></div><div><br clear="all"><br>-- <br>Matt Todd<br>Highgroove Studios<br><a href="http://www.highgroove.com">www.highgroove.com</a><br> cell: 404-314-2612<br>blog: <a href="http://maraby.org">maraby.org</a><br><br>Scout - Web Monitoring and Reporting Software<br><a href="http://www.scoutapp.com">www.scoutapp.com</a><br> </div> _______________________________________________<br>rabbitmq-discuss mailing list<br><a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br><a href="http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss">http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br></blockquote></div><br></div></div></div><br></body></html>