When [doubt] start of the project, the issue of preservation of data

We start the application, enter the URL in the browser, HTML resource requests to the local server

At this time, if the system is not wrong, but the address is correct, then the browser will service from the HTML code and the corresponding side gets the style files, etc., rendered into a web page.

We then enter the query parameters, the controller transmits parameters to the HTTP POST request of the layer, 

  Controller Control Layer: This is the data interface for front-end request, the previous controller, also called Handler , the handle of the same name with in C ++, while taking into account the handle is a key operational target, where you can also controller regarded as operating WEB project in the data key, the user operation although seemingly data request, but all requests are users inside the control range of the controller, the controller operation is an abstract concept , which project in a range of standardized request, service layer operation is also based on the requirements of controller, controller requests for access to multiple data, service can not be only one query data, controlled output requires a String data type, service must be the only type int data type becomes String data back to the controller; and the user, if the controller which defines only add and remove two operations, that user will not be able to query and modify operations, if the controller has also provided the add operation must provide the appropriate parameters, that if there is no user this parameter controller to provide Will go to the add operation ,,,,,, yes, controller is so playfully (~ ¯ ▽ ¯) ~ emmmmm ,,, In fact, it is silly ( `· ω · ')

  Now what, controller has received a proper request sent by a user and the corresponding parameters, then the controller will go call the appropriate service layer interface, all thrown into the pot it ,,,, service who told the Chinese name is "service" trained, trained, trained it ..

  Service logical operations layer: entire WEB project most hard to force the right part of the service layer is typically set according to the controller, and implement a class of service interfaces sometimes more than only one method, according to the project will be blended. other methods,  such as: we have to do a user query, request personal information (name, age, job) to get the user, based on abstract principles, we can provide the user's name and age to build a service interface to separate, and then to separate work to build a service interface, and user information when we conduct queries, you can call the two service interfaces are on the line, to facilitate easy.

  In fact, here I want to talk about the idea of ​​problem when we developed, said the program from the bottom up ,,,, do not know if I understand the problem or how, and how I think this idea did not seem so right ,, the simplest, you say you want a bottom-up development, OK, there is no demand you develop a hammer, when data is written queries you full of joy and finally found a far cry from now on demand requirements, even give their own dig in many pits, I feel it, should understand that this process, at the beginning of the face of demand, our design is top-down, all of the following designs are designed according to the needs of the uppermost layer, when it should after the overall design requirements substantially completed, if to do better, even pseudo-code is also written about it, then back to write the code that is hand speed issue, and the time to write code in the bottom-up development, this is the correct posture ,, but almost all of them are called bottom-up development ,,,,,, I say half of this talk is really fraught with good cutting ,, which is to bear legal responsibility (funny)

  Mapper layer data mapping interface and SQL statement is actually not very important, anyway inquiries are conducted entirely in accordance with the requirements of the controller;

 

  OK to sort out ideas here, we in turn look at the title, although this Skynet does not know how to ask it to simplify the description of it, but probably my guess is this: a hundred users, their personal information in the name and age I classify them in part a, part B classified work, and a separate part a and part B to create the corresponding data mapping alias objects (as in fact it is the POJO class ), then a separate query, the query success data are stored in the corresponding data object ( in fact, there is still a problem that the query from the database where data is placed in the end of? I may take it that the data is placed in the open by their mapping object the memory space bar ), after the previous inquiry, and now part a and part B which are the data can be queried on the web page, then you can think there is data.

  Then temporarily depressed by the user query, and now we go to inquire information about the company can be found in the company name, department, job, and then post here are associated with the user information together, without considering other factors that premise, we can by working in part B of the inside of the property of an entity class data calls to query corporate information as a condition of it?

  Perhaps this is rather abstract, look at the code

 

The above object is defined in three

 Then according to the previous query, A, B which are all part of the data ( as if such a design is also problematic, but the focus is not here, so be it ,, ,, first trained, trained, trained )

然后是对应的 mapper 和 service ,虽然这时好像是可以成功查询到的, 那么这也只是两个部分的数据, 但是我们在一个完整的项目中 ,肯定不会这么简单, 当我们从好几张表里面查询出数据之后, 这些数据会放在哪? 会放置多久?而当我执行完 用户的数据操作后, 这个查询需求的生命周期是多久? 当我进行公司查询的时候为什么还可以使用? 还是说我想错了? 当用户查询到数据并且返回给HTML后, 用户查询的生命周期就结束了, 然后在进行公司查询的时候, 那个 B 部分里面的数据是再一次进行查询出来的数据, 而不是前面遗留下来的数据?

是这样的么? 正是因为这样我们为了项目的性能才使用缓存的么?

OK,,又有一个坑了

 

Guess you like

Origin www.cnblogs.com/unityworld/p/10939586.html