On Thu, Mar 15, 2012 at 2:15 PM, Shuhao Wu <ad...@thekks.net> wrote: > The things you like to see is also what I like to see, and it's what I > have already done/is in progress. > > The main part of the code that I feel is very messy is the fact that the > transport completely depends on RiakBucket and RiakObject and RiakObject > and RiakBucket does essentially nothing. >
I'd like to illuminate an aspect of the design here because the Ruby client is structured similarly. Riak::RObject and Riak::Bucket in Ruby (RiakObject and RiakBucket in Python, respectively) are really just data structures with some convenience methods added. It is the responsibility of the transport layer to convert them to and from the proper formats to be transmitted over the wire (an obvious separation of concerns that allows looser coupling). This allows the application using the client to (mostly) stop caring about transport-layer semantics when working with the domain objects. For example, the abstract "put key/value" operation can be done by calling the "store" method on the RObject because it has a reference to its Bucket and the Client object that created it; it delegates the actual operation to the Client object, which in turn delegates it to the proper transport (called "Backend" in Ruby) object. > > I'm changing it so that the transports and what not could operate > *independently* from the rest of the framework. > > When you fetch or store data, how is it represented? Shouldn't it be a RiakObject? What details and semantics leak when you return a more primitive data structure? These are things you'll have to consider; my opinion is that you'll find you need the RiakObject. If you have the time, take a look at my current source code and the > docstrings. Any suggestions for future work will be appreciated. > > Cheers, > > Shuhao > > Please don't take my comments as disparagement - we love it when Riak users scratch their own itches. We'd also love to see those lists of improvements find their way into pull-requests :). -- Sean Cribbs <s...@basho.com> Software Engineer Basho Technologies, Inc. http://basho.com/
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com