Tags:
create new tag
view all tags

Programmatic rename is at the wrong level of abstraction

Motivation

We need to be able to rename a user's account silently, for example during register.

Current Implementation

I took a look at Manage.pm which implements the RenameCgiScript functionality.

One thing I noticed is that rename's level of abstraction is wrong: RenameCgiScript says:

TWiki::UI::Manage::rename( $web, $topic, $userName, $query );

Then Manage::rename combines the extraction of the parameters with the implementation of the routine. This is not okay, because what if the parameters are not formed by an end user query but rather from a programmatic invocation? Surely I in register am not supposed to create a mock CGI query when I am not coming in from CGI?

Proposal

I submit that something RenameCgiScript ought to have extract all parameters, and something else should actually do the rename. Given we have UI in TWiki::UI::Manage it is okay for manage to know about CGI but in that case it should not have the actual rename functionality in it: this should be in a deeper layer such as TWiki::SubSystem::Topic::rename({named params=>values});

However, if I implement this I will not have time to finish RegisterCgiScriptRewrite ...

-- MartinCleaver - 08 Oct 2004

Programmatic rename is at the wrong level of abstraction
Do you agree or disagree? Please select one of the radio buttons below and click the button.
I 1 - Strongly disagree   2 - Disagree   3 - am Neutral   4 - Agree   5 - Strongly Agree  


Topic revision: r1 - 2004-10-08 - MartinCleaver
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.