I am wondering if I am approaching my project the right way in terms of OOP. My project consists of a windows console application in c#. The point of the application is to take user input, convert it to an sql query and query the connecting database and then spit out the information in a reader-friendly format that the user requested. I have the following 3 classes right now:
Class: commandLineInterpreter extends sqlQueries
this class prints out the commands that the user can utilize. it also takes the user input.
Class: sqlQueries extends dbConnect
this class holds the sql queries that will query the database depending on what the user is inputing.
Class: dbConnect this class initlizes the database connection and prints out a message saying if it suceeded or not.
as you can see i have the commandlineInterpreter class that extends the sql query class that then extends the db connect class.
When I initlize the commandline class in the main() function, it automatically intitlizes the other extend classes as well. I did this because without connecting to the DB then the commandLine interpreter is useless as it cant provide any answers.
My question is, even though these classes aren't related in an inheritance sense of OOP, does it still make sense to do class inheritance this way? or is there a better way to organize my code?