Best Way To Achieve This?

Greetings all. I am a fairly novice programmer and have recently learned a small bit about interfaces. I thought, for me to do a project with them would be the best way to learn more about them. So here is my idea:

End goal: Create a class library that will allow the usage of MySql, MSSQL, abd NoSQL depending on preference. Now I don't think this would have real world applications but I wanted to try it out. So what I know I have to do is this:

  • Create interface to list out the functions and responsibilities of each class
  • Create class for each of the 'protocols' to manage functionality

Now, when I want to interact with said classes, do I do so through the interface, or do I just instantiate the classes? Does the interface provide any value, other than requiring I implement each function in the class?

by PhroznGaming via /r/csharp

Leave a Reply