Hi Glenn. Many thanks for your reply. I’d certainly be interested in sharing experiences. Do you use Oxygene as your base language?
As a many years self taught Delphi person, my approach was certainly not text book! The projects were usually small, typically under 30 users, and the underlying database fairly simple, and usually MS Access.
My answer to the question of separating UI and UI functionality from the business logic and data was basically not to bother too much! Although I did use separate .pas files for different purposes:
Forms - with as little code in other than events calling functionality in another .pas file
Business Logic files, but still making direct reference to UI controls
Data, making ADO connections, general control.
Because data performance was not normally an issue I used to use a separate ADOQuery defined (and freed) in each bit of logic.
To populate, say a grid, from the database, I’d create a dynamic array to act as half-way house between the ADO Data Table, and the Grid, then codewise get the raw data from the Table, using the Query, then manipulate the that data to build the array rows. Then as a last step, read the array and populate the grid. User actions like filtering and ordering would be done using code to rebuild the array, then re-populate the grid.
Probably very crude, but for smaller data loads, it gave me complete control of what could be very dynamic displays of data.
Going from that to WPF/MVVM/EF where such a lot of stuff is defined at design time has left me struggling. Also the sophistication of UI controls today (such as in the DevExpress Grid and Scheduler controls) makes it impractical I think to use my “old” approach.
I’m hoping that once I “get it”, I can perhaps blend some of my older knowledge with the new possibilities, but so far it has been a struggle.
Do you have a very very simple WPF/MVVM/EF project that you could share? Then perhaps we can talk through how you set it up. I have seen some examples in the RO documentation, but they seem to skip over bits without going “behind the scenes”. DevExpress have lots fo great examples, but they use their tools to set up the project, and that of course uses straight C#. I’m getting more familiar with C# but it’s an additional barrier, and I’m not sure how much one can mix C# and Oxygene in the same project.
So, I hope I’ve not put you off too much! Any feedback or comments would be very welcome.
Regards Bob Russell