because on Friday I finally merge in webclient yast model I create short summary of both models, its features and why you should use it.
Inspired by ActiveModel. It adds methods for easy validation, serialization, mass loading and callbacks.
for example usage see Ntp and time plugins.
For documentation see - class BaseModel::Base (I cannot connect to hudson for direct link)
why use it?
smart to_xml and to_json so you don't need to define own method unless you have hash with problematic keys (see time model for example how to solve it)
validations which checks attributes before save
same behavior as ActiveRecord and ActiveResource
Adaptation of ActiveResource to our case of changing site and credentials to target machine. It adds method model_interface which sets interface for model and fix finding single resource. Also helper methods for HttpMock which tests ActiveResource is added.
for example usage see Time plugin or network plugin.
For documentation see module YastModel::Base
example of usage:
class Stime < ActiveResource::Base
why use it?
you can add functionality to model, so no more controllers which have more then one page
same usage as any ActiveResource model, so new programmer is not confused what we using
easier testing (there is still place to improve it), but I found that many plugins doesn't have test or test is really simple and don't cover enough code.
for testing see how looks tests in network or time module.
Thanks for attention and I welcome any comments, suggestion or bugs ( ..bugs are not so much welcome, but I fix it)
maintainer of perl-Bootloader, YaST2-Repair, webyast (language,time,basesystem,ntp)
To unsubscribe, e-mail: yast-devel+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-devel+help(a)opensuse.org