Since the topic MVVM in Delphi has been discussed and presented in the past and none of the approaches did it well (in my opinion) I wrote some small prototype how I think MVVM should work.

Since the topic MVVM in Delphi has been discussed and presented in the past and none of the approaches did it well (in my opinion) I wrote some small prototype how I think MVVM should work.

It is inspired by Knockout.js - the code is quick and dirty and just coded to make the things work that I wanted to show. But it shows some of the concepts really well imo. Please leave your opinions and feedback if that is something that could be worked with in the future. Keep in mind it does not touch on some other challenges presented by MVVM like wiring up multiple views and view-models. I just focused on the essential parts (imo) of MVVM - easy and declarative data binding (nope, no RAD) and dependency tracking.

Imo the most difficult part is making the UI elements work properly with the data binding and attach to the correct events. Especially when it comes to more complex controls like grids or trees. However I already have some ideas how to handle that properly.

https://bitbucket.org/sglienke/knockoff

Comments