Back to list
Views:   0
Replies:  0
Archived

,
I believe a 'strategy' pattern would fit this nicely. Basically, a strategy is a collection of algorithms. You'd have an abstract base class called 'Parser'. Then you'd have derived or "concrete" strategy classes the implement the specialized parsing (for each element in your case). The idea here is that the concrete strategies can share common code with the base class and use polymorphism to address each parsing nuance with each tag. Use the strategy example on this site to get more details.
Feb 01, 2011
Reply 1
This seems like a use for the chain of responsibility.  Pass it to the first parser, and it will parse the parts it can and pass the rest to the second parser, and so forth.
Stephanie Schwinn, Feb 17, 2011


Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas