Currently working on an accounting application. Wrote the GUI framework from the ground up with Win32 and it works well. The issue I'm having is trying to separate the GUI from the application logic. The classes I've implemented so far are:
class Application class MyApplication : public Application // Is this my controller? class Account // Model class Transaction // Model class Split // Model class Window // Is this a view? Should it hold a view? class DataGrid : public Window // Same with this??
MyApplication has a vector of accounts with each account holding a vector of transactions and the transaction objects holding vectors of splits
In this case I assume Account, Transaction, and Split are my models. I do not want my view to deal with these directly to separate the logic, data, and view.
What exactly is my controller? Should I add an Accountant class that both the models and my Datagrids interact with?
This would mean that my Datagrid or Table class would need a pointer to Accountant. My GUI (datagrid, window, etc.) is pretty clean now and I don't want to pollute it with application-specific code.
How do I go about separating my views and models? Does my Window class hold a pointer to a ViewBase class? My window class should definitely not contain a list of models.