Hi,
I'm stumped, I have a task where I have to take some markup (json format, not that it really matters) and parse it into an object model. We already have a domain model, its just a matter of running through the markup and creating the relevant objects.
It's not really suitable for the composite pattern as the objects being created are not similar. Also the markup is not that huge and only goes three levels deep so I'm more interested in an organisational pattern than raw speed. I would really like to achieve the following:
- Avoid a monster method with lots of nested loops
- Easy to add new tags/objects in the future
- Clean easy to read code for the next person who has to modify it
Any suggestions on possible patterns that would be suitable for this? Feel free to give examples in any language, if so inclined.
Regards,
Chris
edit: Here's an example of the markup - link text