Delphi MVVM links

  

After I did conference presentations and wrote a magazine article and in 2013 about Delphi MVVM using DSharp, I saw a 3 articles in 2018, then I went through a big rollercoaster involving rectum cancer treatment.
After recovering, I found that there is one commercially project working on an MVVM framework implementation.
So here are some links on MVVM from new to old:

A late 2021 post from Frank Lauter working on a #D.MVVM implementation (smart move to name it like DSharp): [Wayback] from old school to new frontier: My road to a useable MVVM Pattern implementation for Delphi!
The links to the 2018 grijiy posts on MVVM and github source (which has not been modified after 2018): Some interesting Delphi MVVM posts…
A 2016 book on MVVM in Delphi which is more about concepts, as the underlying MVVM framework is mediocre at best: [Archive.is] MVVM in Delphi: Architecting and Building Model View ViewModel Applications: Kouraklis, John: 9781484222133: Amazon.com: Books
A 2014 log of a webinar and comments mentioning where the current MVVM demos are: Q&A log for the “RAD-in-Action Webinar Unit Testing in Delphi featuring Nick Hodges”
The 2014 DSharp branch named Caliburn containing the MVVM framework code: [Wayback] sglienke / DSharp / feature/Caliburn — Bitbucket

It is quite mature, supports FMX and VCL, and is used in production. Regrettably, there is currently no development on it.

A spring 2014 Spring4D roadmap mentioning the mobile support for Spring4D, and a tiny bit of MVVM: [Wayback] Delphi sorcery: Spring4D roadmap
A late 2013 DSharp roadmap that unfortunately did not make it: [Wayback] Delphi sorcery: Future plans for Spring4D and DSharp
The late 2013 MVVM article in Blaise Pascal magazine: [Wayback] Issue 31/32 | Blaise Pascal Magazine
The 2013 presentation and demo code of using DSharp based MVVM: [Wayback] Conferences/2013/20131121-BE-Delphi at master · jpluimers/Conferences
A 2011 blog post on the MVVM presentation model: [Wayback] Delphi sorcery: Putting the pieces together – the DSharp presentation model

In my experience experimenting with MVVM and other three- and four-letter frameworks, I found a recurring concept is “convention over configuration”. This relies heavily on having matching names in the various layers.
There you see a big drawback in the Delphi compiler: it lacks a NameOf expression, which means a lot of literal strings ending in your code. Few of the MVVM frameworks have good logging explaining when literals mismatch.
The C# compiler also took a while (until C# version 6 in 2015) to get one, but now supports the [Wayback] nameof expression – C# reference | Microsoft Docs. Some more documentation about this:

[Wayback] Expressions – C# language specification | Microsoft Docs: nameof
[Wayback] Nameof Operator: A New Feature of C# 6.0
[Wayback] c# – What is the purpose of nameof? – Stack Overflow

Furthermore, the Delphi compiler lacks helpers on interfaces and helpers for generics (heck, I would actually want full extension methods) and generic parameters for methods on interfaces (which is different from the generic parameters on the interface declaration itself). This lack of these features often cause for convoluted syntax to workaround this. Stefan explains the first lacks more clearly in [Wayback] Delphi sorcery: Why no extension methods in Delphi?.
Requests for the nameof expression and interface helpers have been there since at least 2015:

Reminder to self – proposals for Delphi Language Enhancements, a year later
Reminder to Self: check if NameOf has been implemented yet

–jeroen

Comments are closed.