Let's write a framework.
Let's write a framework.
- create a model var model={a:1,b:'b'}
- let's create a router, router maps url to concrete object and returns response, router is a collection
- let's create a manager for managing all our clients, to per request there is a client, or shared
- let's organize our request params, and apply request pipeline filters, read identity from cookie
- let's interact with database
- let's create a configuration manager which handles configuration loaders from different sources
- let's create a language manager
- let's create a base facade for our service base class
- let's create a type manager and apply di
- let's find from our ioc container the type that matches our router
- let's instantiate an object by the type
- let's execute the method router requires
- write the execution result to response
- apply result filters
send to client.
for model binding type, mvvm requires to audit property changes and recalculates the whole view model, mvc just binds the value to ui, mvp abstracts the view into an interface and handles all view relevant logic in presenter, old store pattern first gets all data, and keeps a state which is bad for interaction type apps.
Further more, let's create a socket as server binded to a port and accepts data by tcp/ip protocol.
- Whenever our server socket receives a socket connection as client, store the client to static memory by a manager class.
- Write response by the client socket in store.
- Writing our ORM, we need to implement a pool which holds a certain number of connections to be performant
- Deassemble our models into k-vs, and create table oriented sql clauses by model type name
- For different operations, build different sql sentence
- Use sql driver and execute the sentence, so the data is finally hibernating in database;
- For relation type db, read index, foreign keys, keys, and instantiate different objects with data.
- Using a Serialization tool, create a serialization protocol, and reorganize the data into the form k-v by k-v
Create
Let's write a framework.的更多相关文章
- windows类书的学习心得
原文网址:http://www.blogjava.net/sound/archive/2008/08/21/40499.html 现在的计算机图书发展的可真快,很久没去书店,昨日去了一下,真是感叹万千 ...
- ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第二章:利用模型类创建视图、控制器和数据库
在这一章中,我们将直接进入项目,并且为产品和分类添加一些基本的模型类.我们将在Entity Framework的代码优先模式下,利用这些模型类创建一个数据库.我们还将学习如何在代码中创建数据库上下文类 ...
- Entity Framework Core 1.1 升级通告
原文地址:https://blogs.msdn.microsoft.com/dotnet/2016/11/16/announcing-entity-framework-core-1-1/ 翻译:杨晓东 ...
- Entity Framework Core 实现MySQL 的TimeStamp/RowVersion 并发控制
将通用的序列号生成器库 从SQL Server迁移到Mysql 遇到的一个问题,就是TimeStamp/RowVersion并发控制类型在非Microsoft SQL Server数据库中的实现.SQ ...
- 在传统.NET Framework 上运行ASP.NET Core项目
新的项目我们想用ASP.NET Core来开发,但是苦于我们历史的遗产很多,比如<使用 JavaScriptService 在.NET Core 里实现DES加密算法>,我们要估计等到.N ...
- 采用MiniProfiler监控EF与.NET MVC项目(Entity Framework 延伸系列1)
前言 Entity Framework 延伸系列目录 今天来说说EF与MVC项目的性能检测和监控 首先,先介绍一下今天我们使用的工具吧. MiniProfiler~ 这个东西的介绍如下: MVC Mi ...
- 来,给Entity Framework热热身
先来看一下Entity Framework缓慢的初始化速度给我们更新程序带来的一种痛苦. 我们手动更新程序时通常的操作步骤如下: 1)把Web服务器从负载均衡中摘下来 2)更新程序 3)预热(发出一个 ...
- 采用EntityFramework.Extended 对EF进行扩展(Entity Framework 延伸系列2)
前言 Entity Framework 延伸系列目录 今天我们来讲讲EntityFramework.Extended 首先科普一下这个EntityFramework.Extended是什么,如下: 这 ...
- Entity Framework教程(第二版)
源起 很多年前刚毕业那阵写过一篇关于Entity Framework的文章,没发首页却得到100+的推荐.可能是当时Entity Framework刚刚发布介绍EF的文章比较少.一晃这么多年过去了,E ...
- Entity Framework 6 Recipes 2nd Edition 译 -> 目录 -持续更新
因为看了<Entity Framework 6 Recipes 2nd Edition>这本书前面8章的翻译,感谢china_fucan. 从第九章开始,我是边看边译的,没有通读,加之英语 ...
随机推荐
- php下关于字符串与数组的相互转换的函数
public static function string2array($tags) { return preg_split('/\s*,\s*/',trim($tags),-1, ...
- 059. Spiral Matrix II
题目链接:https://leetcode.com/problems/spiral-matrix-ii/description/ Given a positive integer n, generat ...
- 自定义 filter simple_tag inclusion_tag 总结
在已经注册的app下创建templatetags的python包 在包内创建py文件 my_tags.py 在py文件中写代码: from django import template registe ...
- android webview 添加内置对象
package com.android.EBrowser; import android.app.Activity;import android.graphics.Rect;import androi ...
- 应用安全 - 工具|平台 - Elasticsearch- 漏洞 - 汇总
未授权访问 (1)/_cat/indices #Index个数查询 (2)/_mapping?pretty=true #type个数查询 (3)根据Index和type查询表数据 (4)/_river ...
- VS显示代码行号
工具>文本编辑器>常规 如图勾选行号选项,点击确定即可显示行号. 如果没有行号的选项,则需先勾选下图中左下角的‘’显示所有设置选‘’‘项.
- Azure Blob 存储简介
Azure Blob 存储是 Microsoft 提供的适用于云的对象存储解决方案. Blob 存储最适合存储巨量的非结构化数据. 非结构化数据是不遵循特定数据模型或定义(如文本或二进制数据)的数据. ...
- hdfs基本文件操作
编程实现下列要求: 1.创建一个自己姓名首字母的文件夹 2.在文件夹下创建一个hdfstext1.txt文件,项文件内输入“班级学号姓名HDFS课堂测试”的文字内容: 3.在文件夹下在创建一个好的fs ...
- 02-Zookeeper介绍及安装
1 Zookeeper介绍 ZooKeeper是为分布式应用所设计的高可用.高性能且一致的开源协调服务,它提供了一项基本服务:分布式锁服务.分布式应用可以基于它实现更高级的服务,实现诸如同步服务.配置 ...
- centos终端显示字母重叠
在使用VMware虚拟机安装linux之后,之后调整了中文显示,但是后来不知道怎么回事在终端显示的字母很多都是重叠的. 在百度上也找到很多的解决办法 eg: 终端键入:vi /etc/fonts/co ...