Let's write a framework.sql
- 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.cookie
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.mvc
Further more, let's create a socket as server binded to a port and accepts data by tcp/ip protocol.app
- 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
Createsocket