• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

I have recently refactored TWiki::UI::Edit::edit in a minor way to allow reuse of the edit routine from within plugins that want to edit part of the topic.

If one were to insert a new handler, say finalizeEditHandler before the edit page is written out, those plugins could do their job without having to call edit directly, making the API clean.

I have this written and tested, and wonder whether it would be prefered to have this code in rather than the simple refactoring. We don't need to publish the handler, but I would feel better if I would not have to call a core routine from the plugin.

Guidance requested... --TW


Every time we add a handler that assumes the algorithms employed in the core, we freeze the core code a bit more, making it more brittle and increasing the maintenance problems. I agree it's not good to call functions in the core, but adding handlers has the same effect in the long term.

If you had seen the trouble I have had maintaining ill-considered or poorly designed handlers and API functions in the past (I'm thinking of the code added specifically to support SessionPlugin here), you would share my concern.

Can you do two things:

  1. State the spec of the proposed handler, detailing where and how it would be used (with an example)
  2. Explain how two plugins that both support the handler would interact?

CC

Oh boy, you are right on (2). This handler would have to be invoked by only one plugin at a time. Maybe that is not quite the spirit of a plugin? Are there "exclusive plugins"? Should there be? -- TW


Yes, there are, for some handlers; that is one of the horriblenesses I had to deal with.

I don't think this should be classed as a bug, it is an issue that needs to be discussed in Codev before coming back here. So I created TWiki:Codev.AddFinalizeEditHandler, am reclassifying this as Enhancement and discarding it - please reopen if there is agreement.

CC

ItemTemplate
Summary Suggestion needed on refactoring
ReportedBy TWiki:Main.ThomasWeigert
Codebase ~twiki4
SVN Range TWiki-4.1, Sat, 23 Sep 2006, build 11571
AppliesTo Engine
Component

Priority Enhancement
CurrentState No Action Required
WaitingFor

Checkins

TargetRelease n/a
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r5 - 2006-10-01 - CrawfordCurrie
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback