Hi - just stumbled across CloudKit, which looks *very* similar to a
layer that I'd like to provide for some models in my app. I'm hoping
to use MongoDB (http://www.mongodb.org), a schema-free JSON-based DB,
as storage for the rest of a Merb or Rails based app, and it would be
excellent to be able to expose my app models via a layer like
CloudKit. Is this kind of approach viable, or is CloudKit really
designed to work more standalone?
It would be nice to be able to hook into/override some of the CloudKit
API methods at the model level to provide any custom processing that
might be required, and it might be nice to be able to expose things on
a per property kind of basis as well.
On Wed, Mar 25, 2009 at 10:34 AM, Liam Staskawicz <lst...@gmail.com> wrote:CloudKit can work standalone or integrated into another framework using CloudKit::Resource. See this Gist for an example of integrated use:
On Mar 25, 2009, at 9:16 PM, Jon Crosby wrote:On Wed, Mar 25, 2009 at 10:34 AM, Liam Staskawicz <lst...@gmail.com> wrote:CloudKit can work standalone or integrated into another framework using CloudKit::Resource. See this Gist for an example of integrated use:
I'm starting to think that I might have the wrong idea, but here's roughly what I had in mind - please excuse my half-baked planning.It would be great to be able to mix in a cloudkit-style module to normal (DataMapper or ActiveRecord) models in order to provide a discoverable/navigable rest interface to them. This could provide default implementations for GET PUT POST DELETE endpoints (which could be overridden by the model), provide the machinery to respond to OPTIONS & HEAD, and to include the model in responses to GET /cloudkit-meta queries. An additional query (GET /%collection%/_definition ?) might return a class definition, as the class currently exists (members, methods, etc.) Depending on the backing store, versioning may or may not be appropriate. This module might also ideally help manage the last-modified status of model instances.
As far as the custom properties, all I really had in mind was the notion that there might be elements of your model that you'd prefer not to be exposed - maybe this is aligned with private methods/members, but maybe it's a separate concern. Some way to specify this on a per method/member basis would be necessary, I think.
a long way towards converting existing apps to being open web json appliances as well. Thanks again for your thoughts.Again, I'm not sure if this misses the point of the existing cloudkit implementation a bit too much, but I think something like this could go
Liam
This would be quite interesting. Will definitely keep an eye on how
this progresses.
In the meantime, I'm trying to think through the implications of using
CloudKit as a parallel layer to a Merb app. Ideally, they would be
able to access the same DB layer which got me thinking about
CloudKit's compatibility with various backends. Is there a spec/API
for CloudKit 'adapters'?
Liam
Liam