How can I design this better? (Avoiding a switch statement with Object Oriented design)
问题 I know a little bit about Object Oriented design, but I'm not sure how to go about using those principles in my code. Here's what I'm working on: public void Query(Agency agency, Citation queryCitation) { queryCitation.AgencyCode = agency.AgencyCode; switch (agency.ClientDb.Type) { case "SQL": QueryOracle(agency, queryCitation); break; case "PIC": QueryPick(agency, queryCitation); break; } } (Most of these are objects from NHibernate. I'm working with a legacy database system and am