Started this discussion in another
thread.
João Bispo wrote:Duv Vo: Thank you for the tip. I've read about object serialization, but I'm not sure this is what I'm looking for, the life-time of the objects is limited to the program.
I'll give you an example of what I'm doing. I have a parser for a simple language, and originally, the objects would access directly the nodes of the parser tree to obtain the needed information. This had two downsides:
- The objects had to know the structure of the parser tree. If I changed the language, there might be changes in the "working" objects, which shouldn't;
- If I want to use those "working" objects (in this case, they are objects that generate code) in another context, I need an object which is a node of the parser tree, with the expected structure;
Old Thread:
link
This question is more about program design, so I'm not sure this is the right section. Curretly, I've already decoupled the parser tree from the other objects (see my post in Old Thread for the method), but I'm not sure of it. I've already searched the internet but haven't been lucky.