#151 Brainstorming 17 Aug 07

brian Fri 17 Aug 2007

Basic goal is to create a design center around a RESTful API to unify access to:

  • MemSpace: access to in-memory objects between threads without traditional locking
  • FileSpace: access to the file system (file meta-data and content streams)
  • SqlSpace: O/R mapping into the Fan type system
  • WebSpace: web based distributed "file/object system"

Basic principles:

  • Everything is a "resource" like web (like everything is a file Plan9)
  • Resources are identified via a Uri
  • Fan VM mounts everything it uses into its namespace under "/"
  • CRUD interface like O/R
  • Query via template like JavaSpaces (need more advanced predicates like time ranges though)
  • One type for containers and leaf nodes (C# Dir/File is a pain)
  • Maybe like file system, I can attach any meta-data out-of-bound to a Resource (and maybe that is what determines my query indices like SpotLight)

Mounting:

  • Mounting a new space requires a const object
  • Thread is mounted b/c it is const and shares state via message passing
  • SqlSpace is const from Fan perspective, but really uses Java/C# native code to deal with mutable state like database connections

Initial read always done via Uri:

User u := `/db/users/brian`.get

A component's namespace such as Sidewalk would assume it could be any mount point (like a Servlet):

Topic t := `topic/123`.get(this)

Resource might look something like:

mixin Resource
{
  Uri uri()
  Void refresh()
  Resource create(Resource template)
  Void update()  // merge?  collisions?
  Void delete()
  // something to expose transactions (EJB, T-Space style?)
  Resource[] list()
  Resource[] query(Resource template)
}

We'd mount anything of interest into the namespace:

/env         // env variables
/thread/x    // all the threads (like Plan9 /proc)
/pod/icon    // access pod resources
/file        // file system

Serialization

  • Is tree based, not graph based
  • sys::Simple defines encode/decode methods
  • sys::Complex marker interface for structured types
  • Complexes are serialized deep, outside references are Uris (as foreign keys)
  • Need to take a look at XAML design?

Login or Signup to reply.