On Thursday 10 September 2009 10:37:17 Klaus Kaempf wrote:
* Duncan Mac-Vicar Prett <dmacvicar@suse.de> [Sep 10. 2009 10:19]:
I think Martin approach is saner and easier for Rails developers. I am not sure how he expects to un-hardcode the remote path prefix by using the interface, but I like the design of declaring the options in the model class itself, in the same style of has_many and so on, one could get something like with_interface "org.yast..." as an option to the path derived from the class.
Can you point us to a Wiki page explaining your approach and some example code showing the improvements over the current implementation ?
Please don't pollute the wiki with stuff that nobody will remember to cleanup later ;-). IMO the place for an example is the final module tutorial and unless the final approach is defined, the place for documentation is the comments above the class in Martin's branch. Mailing lists are fine for discussions and showing "examples". the main difference is, current solution: (client side) client = YaST::ServiceReource.proxy_for('org.opensuse.yast.network.interface') cards = client.find(:all) ... if not client.permissions.write? .. disable ui end Martin's solution (client side) class Interface < YastResource::Base has_prefix '/network' end then in the controller: cards = Interface.find(:all) Interface.permissions... 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 -- Duncan Mac-Vicar P. - Engineering Manager, YaST SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org