Mailinglist Archive: yast-devel (246 mails)

< Previous Next >
[yast-devel] Proposal how to improve Resource Loader
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Thu, 20 Aug 2009 10:34:10 +0200
  • Message-id: <4A8D0A82.1040501@xxxxxxx>
Hi,
after critic about resource loader, that is unreadable and
non-transparent I suggest this change:
Create it as classical child of ActiveResource e.g. YastResource which
then is ancestor of plugins models. What model only need define is
interface in its body to get same functionality as now. (self.sife is
method which get site dynamically).

advantages:
It is transparent ActiveResource, also it is easier to debug it (it is
not dynamically created)
It is more common for rails developers
Instance have automatic permissions field which is filled in
constructor or find call (part of YastResource class)
It is easier to understand how it works
Developer could move functionality to Model, so it prevent huge
controllers and it also allows easier testing (you can easy mockup
statically defined class)
Removes all duplicity with load proxy and with proper exception and
usage of rescue_from for standard page for some exceptions we have
unified behavior.
Controller looks more usual and removes all magic around proxy from it.

disadvantages:
Must change current code, but it is not much work (just move interface
name to model)


example of model code with same functionality as now:
Time < YastResource
self.interface = "org.opensuse.yast.modules.yapi.time
end



I welcome any comments and suggestions. I plan do it in next week in
separate branch for test usage and then transfer it to trunk.
--
Josef Reidinger
YaST team
maintainer of perl-Bootloader, YaST2-Repair, webyast modules language
and time
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages