This is a hypothetical although it could apply to any number of programs I'm working on at the moment.
Say my program is based around displaying and editing data in a database and I use the active record pattern for classes representing the data in the database. Single entities are accessed via a list for which I would use a QSqlTableModel and QTableView to display.
My question is, to keep with the pattern should I use QSqlTableModel directly or should I subclass QAbstractItem/ListModel and implement say a CompanyListModel (if I used it to list companies from the database) which would internally use a QSqlQuery to instantiate a list of Company objects? Would this be considered good design or is it just overkill?
TIA
Bookmarks