[siesta-dev] preferences

[prev] [thread] [next] [lurker] [Date index for 2002/10/10]

From: Simon Wistow
Subject: [siesta-dev] preferences
Date: 17:29 on 10 Oct 2002
I've started looking at moving the preferences stuff into
Siesta::Preferences rather than all being in Siesta::Stroage::* to
prevent duplication of code between implementations.

However there are two calls to explicit Storage methods, specifically

   Siesta->storage->_update_or_insert(
                              table => 'config',
                              where => {
                                         namespace => $namespace,
                                         user_id   => $user_id,
                                         list_id   => $list_id,
                                         key       => $key
                              },
                              row => {
                                       namespace => $namespace,
                                       user_id   => $user_id,
                                       list_id   => $list_id,
                                       key       => $key,
                                       value     => $value
                              },
                              );


in Siesta::Preferences::config and


    my @results = Siesta->storage->_get_rows(
                                    table   => 'config',
                                    where   => $where,
                                    columns => ['value']
                                    );

in Siesta::Preferences::get_config_explitly and, finally

  my @results = Siesta->storage->_delete(%args);

in Siesta::Preferences::delete_config

what I'm thinking is that a Storage implementation has to implement

set_config (or preference, since that's what it actually is)
get_config
del_config 

which are all quite simple

and Siesta::Preferences calls those.

Also, at the moment all calls to Siesta->storage->$config_method

have been changed to Siesta::Preferences::$method

and I was pondering the value of turning them into method calls on an
object since the arguments are always 

	$namespace, $user_id, $list_id

thoughts? comments?

Simon





-- 
: feel the banana karma

Generated at 13:56 on 01 Jul 2004 by mariachi 0.52