• 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.

Item5673: should the if Parser and queryParser 'pseudo singletons' be undef'd in the finish() destructors?

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Low Confirmed   patch 4.2.1, 5.0.0

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

or should we make it clear that they are going to persist for some unknown time.

-- TWiki:Main/SvenDowideit - 01 Jun 2008

Not sure why you think of them as "pseudo". They are singletons, that happen to be lazily created. They contain no internal state, so as written, there is no reason to destroy them. Of course that might change if you follow up on adding operators dynamically (something I like less and less the more I think about it, BTW)

-- TWiki:Main.CrawfordCurrie - 02 Jun 2008

They're pseudo-singletons because they are not 'properly coded' singletons - if you want to use one in a Plugin, the current code would result in another parser being created (unless the coder is fully aware of the core code's usage).

rather than littering any client code with unless defined, call new TWiki::IfParser the IfParser class should be a proper singleton class? (assuming that it really is supposed to be a singleton).

The fact that one of them is stored in a twiki context, rather than in the session hash, also adds to this confusion - we need to reduce the number of places we store hidden objects, not increase them.

I guess these are code refactorings that will have to wait for 5.0.

-- SvenDowideit - 03 Jun 2008

That's a fair point. TBH I had never considered that these classes would be used outside the core, but in a spirit of modularisation this refactoring ought to be undertaken. However the priority is, IMHO, Low.

-- CrawfordCurrie - 03 Jun 2008

ItemTemplate
Summary should the if Parser and queryParser 'pseudo singletons' be undef'd in the finish() destructors?
ReportedBy TWiki:Main.SvenDowideit
Codebase 4.2.1, ~twiki4
SVN Range TWiki-5.0.0, Tue, 27 May 2008, build 16846
AppliesTo Engine
Component

Priority Low
CurrentState Confirmed
WaitingFor

Checkins

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