
My application is essentially a collection of formulae that I store in separate "variable" definitions. When I load my data file from disk, I am considering parsing all of the formula definitions so that I have the benefits that the AST and token-stream representations have to offer for a rich UI experience (dependency analysis, etc.).
As I see it, there are a couple of ways I could do this - one way would be to modify my lexical analyzer and parser to support calling by my code as well as the syntax editor (I've actually already done this, but it would have to be done again if I want to support non-mergable language). Another way would be to simply keep a "document" object (syntax editor's Document) for each of my formulae in memory and attach it to my object model. That way, when a user needs to edit a formula in the syntax editor, I can just attach the editor to that document instance and there I go (currently I'm setting the document.text on the syntax editor to the formula text each time the user changes formulas to edit).
My question is this: do you feel that keeping a document instance for each variable definition would be too heavy?
Here's some stats about my data (not likely to change much, maybe increase by 100% for user files):
Vars Loaded: 2461
Average text length: 272
Let me know if you need more info to answer this question, hopefully you can give me some advice on this, as I'm just not sure how much overhead creating that many Document objects would entail.
Thanks,
[Modified at 06/05/2007 10:04 AM]
As I see it, there are a couple of ways I could do this - one way would be to modify my lexical analyzer and parser to support calling by my code as well as the syntax editor (I've actually already done this, but it would have to be done again if I want to support non-mergable language). Another way would be to simply keep a "document" object (syntax editor's Document) for each of my formulae in memory and attach it to my object model. That way, when a user needs to edit a formula in the syntax editor, I can just attach the editor to that document instance and there I go (currently I'm setting the document.text on the syntax editor to the formula text each time the user changes formulas to edit).
My question is this: do you feel that keeping a document instance for each variable definition would be too heavy?
Here's some stats about my data (not likely to change much, maybe increase by 100% for user files):
Vars Loaded: 2461
Average text length: 272
Let me know if you need more info to answer this question, hopefully you can give me some advice on this, as I'm just not sure how much overhead creating that many Document objects would entail.
Thanks,
[Modified at 06/05/2007 10:04 AM]
Kelly Leahy Software Architect Milliman, USA