I am wondering if I am approaching my project correctly in terms of OOP. My project consists of a Windows console application in C #. The application point is to enter user input, convert it into a sql query and query a pluggable database, and then display the information in a reader-friendly format that the user requested. Now I have the following 3 classes:
Class: commandLineInterpreter extends sqlQueries
this class prints commands that the user can use. It also accepts user input.
Class: sqlQueries extends dbConnect
this class contains sql queries that will query the database depending on what the user enters.
Class: dbConnect
This class initializes a database connection and displays a message about whether this happened or not.
as you can see, I have a commandlineInterpreter class that extends the sql query class, which then extends the db connection class.
When I initialize the command line class in the main () function, it automatically installs other extension classes. I did this because, without connecting to the database, the command line interpreter is useless because it cannot give any answers.
My question is: although these classes are not related in the sense of OOP in inheritance, does it really make sense to do class inheritance this way? or is there a better way to organize my code?