Some Thoughts on the rapid development of

The past two years, "before and after the end of the separation" There is always someone to mention, but in fact, was very clear that this is just an excuse to put the question of shifting front-end developers. With respect to the front-end developers, programmers clearer backend business processes, data structures and field names, in case of the pattern is determined by the back-end programmers to write pages directly, certainly very efficient.

In the case of database undetermined, front-end developers blindly for page design, some of the issues that will lead to a column, and these problems are usually very deadly. When we are happy to take over the page they write, but found Naming include files, form fields, and originally conceived difference is too large, the heart must be very Ben collapse, the code needs to be re-encoded, two people waste time, You might as well write your own copy. Perhaps "the problem completely thrown to the front end, we are only responsible for the back-end coding" is a solution, but the current market situation, most companies can not meet this demand.

A data management platform do not make a website, the role of front-end developers, usually less than the back-end developers, most of the pages are standardized, there is a pattern, and "there is a pattern "these five words, the programmer, is meant code packaged. We need to have these repeat troublesome work, once coded, for the future, there is a long-term plans.

 

Data Layer

This is the structure of a database table information, including the maximum field, minimum, length, field names, all initially set a good, business is starting from such a table.

 Mapping layer

In the back-end development, most of them are using ORM persistence framework, therefore, you need to configure the "Object Database -Java" mapping relations, actually configure the Java object fields correspond to which column of the database.

The following is a MyBatis configuration:

VO layer

In the database, a row is a set of data storage carrier, in Java code, VO for storing a set of data, we take the number from the database, the result of taking the object in such a package. Visible: VO all correspond to database fields.

 

Network Interface Layer

Background service interface parameters to determine the need for, a lot of people do not have this layer design, before chatting with other technologies, he gave me an answer, "it is not a front-end to do what?", This question had wanted to chat , I am a little embarrassed to hear the results. The answer to some of the layers can be considered for it, if you start out not intend to open interfaces, it is certainly right. But as a programmer ambitious, and has long-term plans, so the idea is certainly not.

我们要相信:我们的项目会做的很大,不仅仅要给前端的页面调用,还要给其他公司调用。而且,往小了说,的确永远不能指望其他人没有失误。

这个设计,其实Hibernate、SpringMVC都有,但是功能相对薄弱,可能不满足实际生产需要,需要针对自己的需求,进行功能加强。

 

表单层

这一层的代码五花八门,选什么样的前端框架,就有什么样的写法。但是框架一旦确定下来,后续的开发,基本也都是在复制粘贴,跟我们后台开发中的VO一样,结构如何,由数据库决定。

<form>
<input type="text" name="firstname">
<input type="text" name="lastname">
</form>

 

 

不论是MyBatis还是Hibernate,都有代码生成器,可以帮助我们直接生成一部分代码。从头到尾分析下来,几乎一切代码,都与数据库表结构关联,理论上讲,这些代码是全部可生成的。

从小了考虑,我们可以用好idea的代码模版功能,将我们常常写的代码,直接生成。放长远来,我们可以针对一个企业、一家公司,将代码规范下来,形成一定的代码积淀、代码形成一套标准,可以考虑从数据库配置,直接生成一套服务。

 

Guess you like

Origin www.cnblogs.com/chenss15060100790/p/10989822.html