On Feb 15, 6:02 pm, Martin Budden <[email protected]> wrote:
> a few questions:
Good ones.
> i) is not stores/text.py a misnomer? Should it not be stores/files.py,
> since it is a store that stores the tiddlers in files (as opposed a
> database, a rvcs or whatever)? The fact that the tiddlers are in text
> format is incidental.
i basically goes with iii. It's called text because the tiddlers are
in the format of the text serializer. At least that's how I was
thinking when I first put the thing together. Originally I thought of
it is a stopgap until a good one was created, but other issues have
been at the fore.
My expectation was/is that there will be a lot of stores that use
files, so files would be an especially confusing name. I agree,
though, that text is also confusing.
If the 'text' serializer was called 'files' what would the simpletext
serializer be called? 'alsofiles'?
> ii) Is there a reason why you create a Serializer object every time
> you need to use one (eg in recipe_put etc), rather than just creating
> the Serializer once in __init__
Two reasons:
* one is that the idiom is create serializer object, tell the
serialize the object we want to work on, serialize it. If the creation
of the serializer object is hidden away in __init__ then it seems like
it would become easy to forget to set serializer.object resulting in
the wrong thing getting serialized.
* laziness: very little of the TiddlyWeb code has yet seen any
refactoring; I've been working to get it working, later I hope to get
the code more clean.
> iii) Is there a reason why the Serializer in stores/text.py is
> hardcoded to 'text'? The type of serializer could be obtained from the
> config file.
Yes, that would be possible, but see both points above about the
naming, and the lack of refactoring.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/TiddlyWikiDev?hl=en
-~----------~----~----~----~------~----~------~--~---