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:
pub
I would refactor to take advantage of an interface. I would probably make it something like:
public interface IQuery
{
void Execute(Agency agency, Citation query);
}
public class OracleQuery : IQuery
{
// Implementation
}
public class PickQuery : IQuery
{
// Implementation
}
You could then change the Agency class to store an instance of an IQuery object rather than (or in addition to) the ClientDb object:
public class Agency
{
public IQuery Query { get; set; }
}
And then in your initialization code (where you would normally set the ClientDb property), you could set the instance to the appropriate IQuery implementation:
agency.Query = new PickQuery();