Is there a DataModule counterpart for .NET?

Oxygene on .NET, is there a counterpart like Delphi’s non-visual data module?

I think a Component class would be the closest thing.

wuping,

You might want to study the MVVM (Model-View-ViewModel) pattern. This was the preferred pattern in Silverlight and can be used in WPF application (and even for web).

MVVM is a different way of viewing your application than was used in Delphi, but accomplishes the same type of “separation of concerns” that was introduced in Data Modules when they were created in Delphi. It takes a bit getting used to, but when I was doing Silverlight, it seemed perfect to me. The way development should have been done all along.

The ViewModel part can be created in its own completely separate assembly and reused in multiple applications.

It works GREAT with the binding used in Xaml.

Are you making a desktop app?

It has been a couple of years since I retired and I’m not sure if Visual Studio now has added some “Model” goodness for that part of the MVVM. There are (or at least used to be) some good tutorials for MVVM and Silverlight which was .net based.

The tutorials I used to really like were in Silverlight by Mike Taulty. He was usually straight to the point. Unfortunately, I’m not sure those videos are still around since Microsoft dropped Silverlight. John Papa also had a lot of good information.

Hope that helps.

… time passes …

Here is a video that isn’t really narrated, but shows the structure in code. It is FAST, so you may need to stop it occasionally to see what the guy did.
https://www.bing.com/videos/search?q=mvvm+wpf+2019&&view=detail&mid=E4EE296B00BCFF511585E4EE296B00BCFF511585&&FORM=VRDGAR&ru=%2Fvideos%2Fsearch%3Fq%3Dmvvm%20wpf%202019%26qs%3Dn%26form%3DQBVR%26sp%3D-1%26ghc%3D1%26pq%3Dmvvm%20wpf%202019%26sc%3D2-13%26sk%3D%26cvid%3DAB336128095748F099DDBC7EDBE11331

2 Likes