a) Well, I'm all in favor of the get it working and then get it
working well development pattern. Presumably you would mind if Fred
and I propose a bit of refactoring as part of the work we are doing.

b) You ask:
"If the 'text' serializer was called 'files' what would the simpletext
serializer be called? 'alsofiles'?"

presumably you mean:

If the 'text' store was called 'files' what would the simpletext
store be called? 'alsofiles'?

Well, it would probably be called something like 'flattenedfiles' (or
even 'simplefiles'). But the point is both of them should contain the
word 'files' rather than the word 'text'

c) "one is that the idiom is create serializer object, tell the
serialize the object we want to work on, serialize it."

I don't actually like this idiom very much (that is the idiom of
creating an object to perform a function). So rather than:

serializer = Serializer('text')
serializer.object = recipe
recipe_file.write(serializer.to_string())

I'd rather have

recipe_file.write(self.serializer.to_string(recipe))

(serialize having been created in init)

Martin







2009/2/15 [email protected] <[email protected]>:
>
>
>
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to