TiddlyWiki.org

Ticket #155 (new enhancement)

Opened 2 years ago

Last modified 10 months ago

Avoid confusion on use of low-level and higher-level Tiddler access functions

Reported by: UdoBorkowski Assigned to: JeremyRuston
Priority: minor Milestone: soon
Component: core Version:
Severity: medium Keywords:
Cc:

Description

There is a continuing confusion on the usage of the "similar" Tiddler access functions of the TiddlyWiki class:

  • addTiddler - saveTiddler
  • fetchTiddler - getTiddler
  • deleteTiddler - deleteTiddler

(see #150).

To avoid future confusion mark the "low level functions" addTiddler,fetchTiddler and deleteTiddler as such, and encourage people to use/hijack the corresponding high level function. E.g. with a comment like this:

	//# Rarely call/hijack this low level function but getTiddler
	this.fetchTiddler = function(title) {
		return tiddlers[title];
		};
	//# Rarely call/hijack this low level function but removeTiddler
	this.deleteTiddler = function(title) {
		 delete this.slices[title];
		 delete tiddlers[title];
		};
	//# Rarely call/hijack this low level function but saveTiddler
	this.addTiddler = function(tiddler) {
		 delete this.slices[tiddler.title];
		 tiddlers[tiddler.title] = tiddler;
		};

(BTW: One may consider getting rid (deprecate) getTiddler since it adds nothing essential to fetchTiddler, but on the other hand keeping it ensures the clean split between low and high level functions)

Change History

06/10/06 16:33:28 changed by JeremyRuston

  • milestone changed from 2.1 to 2.2.

13/12/06 08:02:21 changed by MartinBudden

  • priority changed from major to minor.

21/12/06 22:08:24 changed by MartinBudden

  • milestone changed from 2.2 to 2.3.

12/10/07 16:49:39 changed by MartinBudden

  • milestone changed from 2.3 to soon.