\define is-task() [tiddler-type[task]
\define new-task() [tiddler-type[task]!has[item-started]!has[item-completed]!has[item-cancelled]]
\define active-task() "[tiddler-type[task]has[item-started]!has[item-completed]!has[item-cancelled]]
\define completed-task() [tiddler-type[task]has[item-completed]]
\define in-context() [domain{!!domain}project{!!project}client{!!client}]
\define new-task-in-context() <<new-task>> +[domain{!!domain}project{!!project}client{!!client}]
In this case each tiddler will have a field time stamped as needed eg item-started item-completed or item-cancelled
Then in a List filter you could use
<$list filter="[is[current]subfilter<new-task>]">
Show if current task is a new task
</$list>](url)
<$list filter="[subfilter<new-task>]">
List all new tasks not started, closed or completed
</$list>
<$list filter="[subfilter<active-task>subfilter<in-context>]">
List all new tasks not started, closed or completed in the same "context" as the current tiddler.
</$list>
Benefits
- You can see in the above the "definition" of a new-task is encoded in the first tiddler, and can be changed without reference to all the locations where it is used.
- Simply transferring the first tiddler to another wiki allows you to continue using the logic you developed in the first wiki, including sharing it with the community.
DiscussionThe above is one example of this design pattern, I hope in this tread we can discuss others that will help the rapid transfer of design logic between wikis and community members. My Example could be called a "subfilter set".
Personally I am interested in an open "field definition" pattern., I have a great deal of prework done on this.
What other coding patterns would be useful in a similar way to the above?
Thanks in advanceTony
What I am suggesting is at a higher conceptual level. I could use bundles or plugins for distributing such tiddlers.
Let me try and say it another way.
Lets say I had one or two key tiddlers that capture the logic, relationships, meaning of fields etc... I can then go and design any tiddler to handle my tiddlers and use the logic, filters etc... Defined in my key tiddlers.
Then if I want to change or enhance my wiki I can make changes in my key tiddlers and this new logic will be reflected everywhere else. Just looking at the key tiddlers will show the logic used. If designed well the logic can be shared and reused easily, without having to look in all wiki tiddlers to workout whats happening.
An example would be task management, defining; new active urgent completed archived etc. An active task may be defined as started but not closed or cancelled. But lets say I later want to introduce onhold, rather than edit every task list widget, I can update my definition of active task to exclude onhold, update my definition of inactive task to include onhold.
Regards
Tony
I just wanted to start a thread on "Centralised logic" in TiddlyWiki, it is a systems design pattern I am interested in developing....