Mailinglist Archive: yast-devel (163 mails)

< Previous Next >
Re: [yast-devel] use-activeresource
  • From: Klaus Kaempf <kkaempf@xxxxxxx>
  • Date: Thu, 10 Sep 2009 14:54:19 +0200
  • Message-id: <20090910125419.GB4111@xxxxxxxxxxxxx>
* Martin Kudlvasr <mkudlvasr@xxxxxxx> [Sep 10. 2009 14:41]:
On Thursday 10 September 2009 11:18:14 Klaus Kaempf wrote:
* Duncan Mac-Vicar Prett <dmacvicar@xxxxxxx> [Sep 10. 2009 11:03]:
And what we describe as missing features is the ability to do:

class Interface < YastResource::Base
any_that_implements 'org.opensuse.yast.network.interface'
end

instead of using has_prefix

Definitely.

Actually, there's no possibility to control the resource URI in Rails
because it is assembled from the controller name and module
(namespace).

But this means, that we'll have to solve controller name conflicts anyway. If
2 of our partners develop a plugin with the same controller name, there will
still be a name conflict problem.

Yes.
See "namespace for controllers (high)" in
http://en.opensuse.org/YaST/Web/TODO


And that's why we've choosen the 'implements interface'
approach because it doesn't require any knowledge about the
implementation (controller name) of the service side.

I see, that the benefit of interfaces is, that we can have several webservice
resources implementing the same interface. Webserver chooses the proper
resource according to the supplied interface name. I think this is a good
approach (although we will still have to solve interface name conflicts of
3rd
party plugins).

The current thinking is that the interface prefix (org.opensuse...)
solves this for now.
I guess we have to gain more experience, esp. with 3rd parties
contributing resources and reporting problems, before we can finalize
this.

What I see as the problem is, that the translation from "interface name" to
"resource URI" is not factored out.

Where would you need that ?


The webclient may want to ask for webservice resource URI,

This is explicitly discouraged just because the resource URI basically
reveals the internal implementation (controller namespace and name).
Thats why clients should just 'know' about the interface name instead
of the URI.

but certainly not about whether the resource is "singular" or "nested".
For example I cannot imagine a webclient plugin, which would change its
behaviour according to change of "singular" or "nested". This info is
only needed by proxy_for, which tries to be universal and all-
encompassing.

Nod.


I think that Martin's problem (...any_that_implements
'org.opensuse.yast.network.interface'...) can be solved by directly using
ResourceController on webservice. Then use the path from resource[:href] to
appropriately setup an ActiveResource (actually the enriched Martin's version
YastResource).

Maybe.

It would be helpful to see example code for the client side on how
this API should look like.



Martin Kudlvasr

PS: Later it would be nice to be able to get a URI from interface in a
RESTful
way. Like:
resources/org.opensuse.yast.modules.yapi.time
instead of:
resources.xml?interface=org.opensuse.yast.modules.yapi.time

Agreed. Want to open a [task] entry in bugzilla for this ?

Klaus
---
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG N├╝rnberg)

--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >