首页 > 其他分享 >As a project I always want to create for myself as a gift, the MVVM framework is more or less satisf

As a project I always want to create for myself as a gift, the MVVM framework is more or less satisf

时间:2023-11-29 21:58:01浏览次数:36  
标签:myself satisfying MVVM how data project framework my more

I used to want to build a MVVM project for myself, especially since I wrote my mementowriter project which is no jQuery, and that was very time consuming and tiring to create.

Last year, I had some inspiration, and really wanted to try to start fresh things in my tech skills stack, actually the frameowrks took me much time to think of how to design

The Java project which is CaloJMVC is what I wrote based on the simple server provided in newer JDKs, it is very simple, thus had quite a lot of work to do in order to implement a usable framework, I was not satisfied, so I put in a lot of efforts to investigate all the common pieces details, it is not that bad I think now.

 

The other project is the Calochjs, which is an MVVM javacscript framework, since traditional frontend is tiring, too much work to do. But I am not safisfied with using somebody else's frameworks, like VUE, React, Angular, etc. Using a framework is too easy to my level, just by reading the code, I can hands on in several minutes, because of the years' experience. Then how about crafting my own framework? 

 

So I did it, it actually took pretty many tries to think of how to design the framework to make a data focused brief framework to save my future labor.

In the beginning was the Render Tree, then, the methods, how to bind them to events, then how to make any data change reflected on data take effect.

 

I got stuck many times when I was trying to design it. I tried many solutions, and many failed, some bugs are found just as I began to develop based on it.

 

In the beginning it was all based on static methods, because the Render tree is already very hard, it requires to take care of all data types, and the DOM, also think of templating.

 

Building such a framework is like managing a kingdom,  the render tree took much time to precisely render every control, then another question came up, how to make to control's event respond to control value change and reflect the change on the data model.

It is like first scattering ID card to every resident in the kingdom, and everybody can respond to the data model. I thought and thought, and used the currently most brief way, every control should have a Path that points to it's value in the model.

 

Then other than basic Javascript skills to perfectly manage OOP objects and their instances with interactions, storing static things, I also had think of what if there are more than one APPs in the page, so, this time, another question came up, that's how it is like now, multi-instanced apps attached to more than one app root elements.

 

Then how about managing the routes to build a SPA webapp, and how to extend ajax utils, what about the callback expire due to page navigation. Would ajax same change its data model and apply the rendering.

 

Now it is more or less satisfying, I somehow dare say, it is my MVVM framework, and I know every design detail of it. And it will help me a lot in my future web apps!

 

Of course there may be other bugs which I haven't discovered, I will make more use of my own crafts, they two are my new future tech skills of my other works.

They are fundamentals, and there will be apps built upon them, I know there will be a long way, what if I meet with other hard problems? This is my way! Of doing them!

 

https://caloch.gitee.io/calochjs/spatester.html

标签:myself,satisfying,MVVM,how,data,project,framework,my,more
From: https://www.cnblogs.com/hualiu0/p/17865980.html

相关文章

  • Wpf 第三方Mvvm包(mvvmLight/Microsoft.Toolkit.Mvvm/CommunityToolkit.Mvvm)
    十年河东,十年河西,莫欺少年穷学无止境,精益求精 mvvmLight和 Microsoft.Toolkit.Mvvm已被Nuget弃用且不再更新,在此不作说明CommunityToolkit.Mvvm是NetCore版本引用包,详情参考:WPFMVVM框架:CommunityToolkit.Mvvm包使用介绍1、wpf项目中使用 CommunityToolkit.Mvvm(NetCo......
  • WPF MVVM 学习理解
    <StackPanel><TextBoxText="{BindingName}"/><TextBoxText="{BindingTitle}"/><ButtonHeight="50"Command="{BindingShowCommand}"/></StackPanel>数据上下文绑定:this.DataContex......
  • 初中英语优秀范文100篇-010 I Am Proud of Myself-我为自己感到骄傲
    初中英语优秀范文100篇-010IAmProudofMyself-我为自己感到骄傲PDF格式公众号回复关键字:SHCZFW010记忆树1I'mapersonwhoisalwaysconfidentandreadytotryanythingnew.翻译我是一个总是充满自信并随时准备尝试任何新事物的人。简化记忆新事物句子结构......
  • [Codeforces] CF1703F Yet Another Problem About Pairs Satisfying an Inequality
    时间限制\(2s\)|空间限制\(250M\)题目描述给你一个序列$a_1,a_2,\dotsa_n$。请计算出满足下面条件的$(i,j)(1\leqi,j\leqn)$个数。$a_i<i<a_j<j$.输入格式第一行包含一个整数$t$($1\leqt\leq1000$)—测试数据的个数每一个......
  • 使用MVVM Toolkit简化WPF开发
    最近.NET8的WPF推出了WPFFileDialog改进,这样无需再引用Win32命名空间就可以实现文件夹的选择与存储了,算是一个很方便的改进了。顺手写了一个小的WPF程序,在使用Model-View-ViewModel(MVVM)模式的时候,我不想使用Prism等重量级的框架,找了一个轻量级的MVVMCommunity......
  • WPF 使用 CommunityToolkit.Mvvm
    参考文档: IntroductiontotheMVVMToolkit-CommunityToolkitsfor.NET|MicrosoftLearn它是一个现代化,快速和模块化的MVVM库,对应用程序的结构或编译规范没有严格的限制。NuGet安装包搜索:CommunityToolkit.Mvvm导入usingCommunityToolkit.Mvvm;使用ObservableObjectpubli......
  • MVVM 和 MVC 区别是什么?
    1、基本定义MVVM基本定义MVVM即Model-View-ViewModel的简写,即模型-视图-视图模型,模型(Model)指的是后端传递的数据,视图(View)指的是所看到的页面,视图模型(ViewModel)是mvvm模式的核心,它是连接view和model的桥梁。它有两个方向:一是将模型(Model)转化成视图(View),即将后......
  • 循序渐进介绍基于CommunityToolkit.Mvvm 和HandyControl的WPF应用端开发(6) -- 窗口控
    在我们窗口新增、编辑状态下的时候,我们往往会根据是否修改过的痕迹-也就是脏数据状态进行跟踪,如果用户发生了数据修改,我们在用户退出窗口的时候,提供用户是否丢弃修改还是继续编辑,这样在一些重要录入时的时候,可以避免用户不小心关掉窗口,导致窗口的数据要重新录入的尴尬场景。本篇随......
  • 循序渐进介绍基于CommunityToolkit.Mvvm 和HandyControl的WPF应用端开发(4) -- 实现Da
    在我们设计软件的很多地方,都看到需要对表格数据进行导入和导出的操作,主要是方便客户进行快速的数据处理和分享的功能,本篇随笔介绍基于WPF实现DataGrid数据的导入和导出操作。1、系统界面设计在我们实现数据的导入导出功能之前,我们在主界面需要提供给客户相关的操作按钮,如下界面所示......
  • 循序渐进介绍基于CommunityToolkit.Mvvm 和HandyControl的WPF应用端开发(5) -- 树列表
    在我们展示一些参考信息的时候,有所会用树形列表来展示结构信息,如对于有父子关系的多层级部门机构,以及一些常用如字典大类节点,也都可以利用树形列表的方式进行展示,本篇随笔介绍基于WPF的方式,使用TreeView来洗实现结构信息的展示,以及对它的菜单进行的设置、过滤查询等功能的实现逻辑......