Ticket #124 (closed enhancement: wontfix)
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.
