<div class="gmail_quote">Hi Chuck,<div><br></div><div>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!</div>
<div><br></div><div>1. Great!</div><div><br></div><div>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).</div>
<div><br></div><div>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.</div>
<div><br></div><div>4. Is using SenTest discouraged then?</div><div><br></div><div>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.</div>
<div><br></div><div>6. As I said before, probably the best suggestion in your stellar email!</div><div><br></div><div>7. I may just end up with hundreds of these little "spikes" figuring all of this out!</div><div>
<br></div><div>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?</div>
<div><br></div><div>Thanks so much for the great feedback and general guidance!</div><div><br></div><font color="#888888"><div>Matt</div></font><div><div></div><div class="h5"><div><br></div><div><br><br><div class="gmail_quote">
On Tue, Jun 9, 2009 at 12:24 PM, Chuck Remes <span dir="ltr"><<a href="mailto:cremes.devlist@mac.com" target="_blank">cremes.devlist@mac.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div><div style="word-wrap:break-word"><br><div><div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;min-height:14px">
<span>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"><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 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><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 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.</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" target="_blank">www.highgroove.com</a><br>
cell: 404-314-2612<br>blog: <a href="http://maraby.org" target="_blank">maraby.org</a><br><br>Scout - Web Monitoring and Reporting Software<br><a href="http://www.scoutapp.com" target="_blank">www.scoutapp.com</a><br> </div>
_______________________________________________<br>rabbitmq-discuss mailing list<br><a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.rabbitmq.com</a><br><a href="http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
</blockquote></div><br></div></div></div><br></div></div></div><br>_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com" target="_blank">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Matt Todd<br>Highgroove Studios<br><a href="http://www.highgroove.com" target="_blank">www.highgroove.com</a><br>cell: 404-314-2612<br>blog: <a href="http://maraby.org" target="_blank">maraby.org</a><br>
<br>Scout - Web Monitoring and Reporting Software<br><a href="http://www.scoutapp.com" target="_blank">www.scoutapp.com</a><br>
</div>
</div></div></div><br><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>