Jump to content
Mavarik

Delphi and MVVM Framework

Recommended Posts

After a lot of research and experiments I believe that MVVM as it works in other languages which makes it desirable to use is not possible in Delphi at this point. (*)

The main reasons for this are lack of language support for things that are achievable in a very compact way in other languages and the way the main UI frameworks work in Delphi.

 

Considering the history and existing support for datasets everywhere I think that separation of business logic and UI can be achieved rather by utilizing this to be able to access plain object with their properties over a TDataSet API to make any DB aware control work with them out of the box giving you all the support that has been there since Delphi 1.

 

(*) "WTF is he talking about?!" - just take ReactiveUI as an example - implementing this in Delphi in a nicely usable way is imo almost if not entirely impossible.

Edited by Stefan Glienke
  • Like 1

Share this post


Link to post
7 hours ago, Stefan Glienke said:

After a lot of research and experiments I believe that MVVM as it works in other languages which makes it desirable to use is not possible in Delphi at this point. (*)

The main reasons for this are lack of language support for things that are achievable in a very compact way in other languages and the way the main UI frameworks work in Delphi.

 

(*) "WTF is he talking about?!" - just take ReactiveUI as an example - implementing this in Delphi in a nicely usable way is imo almost if not entirely impossible.

Nor should we be surprised, as MVVM was evolved into by people working every day in C# and with XAML. This happened, I am told, as people simply found a comfortable approach in that environment, not because they sought to copy an idiom from another language.

Share this post


Link to post
1 hour ago, Bill Meyer said:

Nor should we be surprised, as MVVM was evolved into by people working every day in C# and with XAML. This happened, I am told, as people simply found a comfortable approach in that environment, not because they sought to copy an idiom from another language.

And yet that idiom works even better in the Web where you can easily blend data binding into the DOM like all those MVVM frameworks over there do.

Share this post


Link to post
20 minutes ago, Stefan Glienke said:

And yet that idiom works even better in the Web where you can easily blend data binding into the DOM like all those MVVM frameworks over there do.

And that's fine, but doesn't negate it being a bad fit for Delphi, does it?

Share this post


Link to post
10 hours ago, Bill Meyer said:

And that's fine, but doesn't negate it being a bad fit for Delphi, does it?

IMO not - the beauty of MVVM comes from things that I have not seen yet seen achieved in Delphi.

It requires special support for every existing control by either subclassing or other ways, CoC and existing data binding solutions are very brittle and easily break when renaming things, functional approaches like done in ReactiveUI are almost impossible or create clunky and bloated code.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×