New Cloudfier release supports many-to-many associations

One clear gap Cloudfier used to have was lack of support for many-to-many associations. That has now been implemented all the way from back-end to the UI.

For instance, in the ShipIt! sample issue tracking application, a user can watch multiple issues, and an issue can be watched by multiple users:

class Issue
end;

class User
end;

association WatchedIssues
    navigable role watchers : User[*];
    navigable role issuesWatched : Issue[*];
end;

UI

…which in the UI means that is now a way to link issues as watched issues for a user:

(and vice-versa from Issue, as the relationship is navigable both ways). Once the user triggers that action, they can pick multiple target objects (in this case, issues) to pair the source object (in this case, a User) up with, by clicking the “connector” button on the target entity instance’s toolbar (the second from left to right):

which once triggered shows a notice confirming the objects have now been linked together.

I will admit this UI may require some using to. It is just a first cut, and I am interested in suggestions from those of you less UX-challenged than me.

REST API

Accordingly, the application’s REST API allows querying related objects using a URI in the form:

…/services/api/<application>/instances/<entity>/<id>/relationships/<relationship-name>/

for instance:

…/services/api/demo-cloudfier-examples-shipit/instances/shipit.Issue/10/relationships/watchers/

produces a list of all users watching the base issue:

[
  {
    uri: ".../instances/shipit.User/2",
    shorthand: "rperez",
    type: ".../entities/shipit.User",
    typeName: "User",
    values: {
      ...
    },
    links: {
      ...
    },
    actions: {
      ...
    },
    relatedUri: ".../instances/shipit.Issue/10/relationships/watchers/2"
  },
  {
    uri: ".../instances/shipit.User/8",
    shorthand: "gtorres",
    type: ".../entities/shipit.User",
    typeName: "User",
    values: {
      ...
    },
    links: {
      ...
    },
    actions: {
      ...
    },
    relatedUri: ".../instances/shipit.Issue/10/relationships/watchers/8"
  }
]

and to establish links, you can POST a similar representation to the same URI, but you only really need to include the ‘uri’ attribute, everything else is ignored.

New tour video

There is also now a new tour video, this time with audio and much better image quality, if you gave up on watching the original one, please give this one a try!

Email this to someoneShare on FacebookShare on LinkedInShare on Google+Tweet about this on Twitter

Comments are closed.