xtim
Monday, January 05, 2004
 
Been thinking about the design over the weekend and I reckon it's OK. I'm going to make a few changes so that the entry takes a more active role in managing its data. At the moment, it's the import parser which runs the text through an entry parser to obtain the heading, entry type etc. I'd like to make that the responsibility of the entry itself. That way we avoid nasty race conditions about setting entry text before entry type when the entry text will be split off into different objects.

So, to summarise the current plan:

1. Entries will take responsibility for finding their own parser and applying it to the entry text. This means their create methods can be simplified.
2. Import parser will be simplified, as it can let the entry decide its own heading and type.
3. When the entry's text is changed, it will run it through an appropriate parser to create any seconday objects (eg dtables) and only store the potentially modified source.
4. When getText is called on the entry, it will reassemble the original text using the parser.

This way, all markup-specific work is performed by the parser layer. All entries get/set text deals in pure raw data, as originally intended. We get an efficient storage mechanism for entries which contain vast amounts of data which is better represented elsewhere (eg dtables).

It's a plan. It's a Monday. I've moved my desk. Time to get going!

T
Comments: Post a Comment

<< Home

Powered by Blogger