c# - Strategy or Visitor? -


setting:

i have series of classes, each acting proxy different webservice. these classes implement 1 of 2 leaf interfaces of following structure:

interface iwebservice {     dictionary<string, decimal> get(); }  interface iwebservicereference : iwebservice {     decimal get(string tocode); }  interface iwebservicetable : iwebservice {     decimal get(string fromcode, string tocode); } 

i'm attempting create class webservicecontext encapsulates concrete classes , make them interchangeable. however, because these concrete classes implementing interface hierarchy, don't need try know won't expected results.

question:

i never used visitor pattern before, type of situation calls pattern?

if so, should use it, or can avoid code maintenance complexity introduces somehow improving current design in way allows me implement strategy pattern?

the visitor design pattern way of separating algorithm object structure operates on.

what describing sounds more facade pattern:

a facade object provides simplified interface larger body of code, such class library


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -