scott_hollen
9th February 2011, 00:17
Hello all --
I come from a functional programming background to trying to do a project in Qt/C++ -- 28 years worth of that background -- with the closest to OO being years of Ada and PL/SQL and using them in a simulated OO manner, so I'm curious about you how you experts out there approach your coding...Trying to learn Qt/C++/OO in a short time frame is proving to be, um, adventurous...
With PL/SQL you can encapsulate processing and data within procedural specs and bodies in a similar nature to classes...I'm used to main programs calling packages which do a LOT of the work and very little of the work themselves, but all the examples that I've been thru tend to split processing...For example:
I need to create a DB login screen and when the user logs in I need to verify credentials, and notify them if they can't log in...In something like PL/SQL all that processing, error and exception handling is hidden in the package -- where do ya'll commonly put that processing in Qt? I created a database management class to manage opening the DB, creating the tables (if it doesn't exist), and I'm basically wanting to put all the SQL processing there, but I'm interested to know where you put your error handling for that? In the mainmenu.cpp that accesses that class, or the class itself? Logically and stylistically, what do ya'll recommend? Generate error dialogs from the data management class or mainmenu? Does it really matter?
scott
I come from a functional programming background to trying to do a project in Qt/C++ -- 28 years worth of that background -- with the closest to OO being years of Ada and PL/SQL and using them in a simulated OO manner, so I'm curious about you how you experts out there approach your coding...Trying to learn Qt/C++/OO in a short time frame is proving to be, um, adventurous...
With PL/SQL you can encapsulate processing and data within procedural specs and bodies in a similar nature to classes...I'm used to main programs calling packages which do a LOT of the work and very little of the work themselves, but all the examples that I've been thru tend to split processing...For example:
I need to create a DB login screen and when the user logs in I need to verify credentials, and notify them if they can't log in...In something like PL/SQL all that processing, error and exception handling is hidden in the package -- where do ya'll commonly put that processing in Qt? I created a database management class to manage opening the DB, creating the tables (if it doesn't exist), and I'm basically wanting to put all the SQL processing there, but I'm interested to know where you put your error handling for that? In the mainmenu.cpp that accesses that class, or the class itself? Logically and stylistically, what do ya'll recommend? Generate error dialogs from the data management class or mainmenu? Does it really matter?
scott