Tuesday, February 11, 2020

MVVM is just a concept.

It looks a little bit like a never-ending story, but it isn't.

Two things I realized after the "Pattern" is working.

1.) The main part of the implementation was the binding and also the hardest.
2.) With the D.MVVM-Framework in place, you have nothing to write a real app.

What?

Yes, the only thing you have is some kind method creating the chain of Model -> ViewModel -> View and also binding the component properties to the ViewModel. Of course, this was the most work, but creating the flow of the app is also a necessary part. So what? Good question.

First of all, you need some really good startup/connect all/composition thing. That's why we call it composition root. This is the point where everything is hooked up together. At this stage, you can use a service locator to do your dependency injections. 

After your Main-Chain is running, how to do the program flow? How to load the next form from the View or the ViewModel? With a Navigation-Service! How can I fire some Button-Clicks? With an Action-Service! How to create a Main-Menü on the Main-View (without creating any dependencies?) With a Menue-Service. Dialog-Service... What else?

There might be some more services needed. But at the moment I'm able to do anything with a combination of these Services - Like a "You are not logged in" so fire up a Login-Dialog before loading the next Form/Frame.

At the Model stage ORM/CRUD Database stuff would be perfect. That's why I write this also as a plugin for my FDK because everything you need to do with the database stuff is already in place.

If you never tried this yourself, the best approach is to try a sample application. At this point I realized - yes all this framework stuff is just to be able to do a proper unit-testing and after two weeks of refactoring - lol - unit-testing is a piece of cake, after I created some Mock-Ups to kill the visual dependency's.

Before you are able to buy this framework, I will refactor some of my other projects - this real-life proof of concept will perhaps bring up some more needs, but every new project will do this, up to a point where I call it ready for shipment. 

At the start, my release date was February - but as always - other things got into my way. So it is ready if it is ready - sorry no prediction at this time. We will see. I hope that refactoring my other projects to the framework would only show up additional needs and not the need of changing the kernel. 

Any questions or ideas? That what I really need to put into the framework, please leave a comment.

4 comments:

  1. "you can uses a service locator to do your dependency injections."

    That's an oxymoron

    ReplyDelete
    Replies
    1. Only for people that knows enough about DI; when you're just trying to give your first steps, nothing is :)

      Delete
  2. I'm looking to make the transition to MVVM, but I'd prefer not developing such framework myself. And yours will be the first MVVM framework
    I'd like to purchase it, even if it's still on beta
    Pleasd, let me know if it's possible

    ReplyDelete
    Replies
    1. I would like to do a real application with my framework first, to check if I have to change something in the core system. Perhaps I do a Video tutorial about this. After that it is possible, but I can't give you a release date at the moment.

      Delete