Ticket #124 (closed enhancement: wontfix)

Opened 7 years ago

Last modified 2 years ago

Encapsulate Tiddler's "links" and "tags" fields

Reported by: UdoBorkowski Owned by: MartinBudden
Priority: major Milestone: unscheduled
Component: core Version:
Severity: high Keywords:
Cc:

Description

To provide the option to improve the implementation of the "links" and "tags" handling in the Tiddler class it is necessary to no longer access the "links" and "tags" fields directly (like in "tiddler.links = ..."). Instead these fields are encapsulated through accessor and mutator functions:

Tiddler.prototype.getLinks = function() {return this.links};
Tiddler.prototype.setLinks = function(links) {this.links=links};
Tiddler.prototype.getTagList= function() {return this.tags};
Tiddler.prototype.setTagList= function(tags) {this.tags=tags}; 

Only these functions should be used to access or modified the "links" and "tags" of a tiddler. Also you should not assume that the implementation given above will stay. E.g. we may change the "tags" field internally from an array to a hashmap and just create and return a tags *array* "on demand".

The direct access to these fields is "deprecated". I.e. any code that directly accesses the fields (like in plugins) may break in a later version of TiddlyWiki.

Change History

Changed 7 years ago by JeremyRuston

In fact, perhaps we should encapsulate all the other fields (eg modifier, modified, created) with getters and setters as well.

Changed 7 years ago by JeremyRuston

  • owner changed from JeremyRuston to MartinBudden

Changed 7 years ago by MartinBudden

  • priority changed from major to minor

Changed 7 years ago by MartinBudden

  • priority changed from minor to major

Changed 7 years ago by MartinBudden

  • status changed from new to assigned

Changed 7 years ago by MartinBudden

  • owner MartinBudden deleted
  • status changed from assigned to new

Changed 7 years ago by MartinBudden

  • owner set to MartinBudden

Changed 6 years ago by MartinBudden

  • milestone changed from 2.2 to 2.3

Changed 6 years ago by MartinBudden

  • milestone changed from 2.3 to unscheduled

Changed 2 years ago by cdent

  • status changed from new to closed
  • resolution set to wontfix

getters and setters no longer really considered great form are they?

Note: See TracTickets for help on using tickets.