Hello * I think I will give a glimpse of scenario of my problem so that we can discuss and conclude which will be the best design pattern
Here is the scenario: I have 3 types of trace files (A , B, C) each has its own format and requires a different way of parsing the file to pick data from the file. so Afile has a Aparser, Bfile has Bparser, and Cfile has Cparser. apart from these Aparser, Bparser, Cparser there are common methods that can be reused for parsing the file. Now the design for this: Trace <>--------> TraceParser / | \ (sorry the lines here indicate inheritance/generalization) AparserType BparserType CparserType Points for discussion: 1. If TraceParse has a method ParserTrace which AparseType , BparseType , CparserType has different implementation for it --- It is Strategy 2. If TraceParser has many methods some of them are common for the three parser types and some of then have been overridden by the three parser Types - is it a template method ???? 3. The input file at a point can be one of TraceType, Trace will decided by checking the file which TraceType is it and based on that object AparserType/ BparserType/CparserType is created Please enlighten me , correct me so that I will learn from my mistakes. Thanks & Regards Bharathi _______________________________________________ gang-of-4-patterns mailing list [EMAIL PROTECTED] http://mail.cs.uiuc.edu/mailman/listinfo/gang-of-4-patterns