java - 个人理解的Web-Service-Dao架构,求斧正
PHP中文网
PHP中文网 2017-04-18 09:05:16
0
3
411

如果把各个模块比喻成U盘,下图是我认为的架构模式

如图,个人感觉业务的接口应该要Web端来定义,而具体的业务实现放在业务模块,

PHP中文网
PHP中文网

认证0级讲师

reply all(3)
刘奇

I am a bit ignorant, I have only heard of mvc
model
view
controller
Your way of understanding is not quite right
The business interface is called in the web as you said, but you cannot just put the interface in the web. The business interface is a public thing. It may be called by other webs. It is abstract and convenient for decoupling, but it is still a business and cannot be included in the web. The same is true for dao

I feel like you don’t understand the interface very well. It is mainly about decoupling and reflection, and is not directly classified into the web

Maybe you think that the interface provides specifications, and changes in business requirements do not affect the web code - this is correct, but this is the function of the interface, not the architecture. I feel that you have made it very confusing

迷茫

Most of them are written like this.
However, the Web accepts user input, and service is the business interface.
This kind has come out
There is also DDD, you can take a look

PHPzhong

1. The service layer is the business interface, and the web layer is here to accept user requests.
2. The service layer method not only plays a role in decoupling, but also can be reused by the web layer.
3. The controller layer, or RPC layer, is responsible for accepting web requests, mapping urls and methods, permission verification, paging control, etc. .

Hope it helps you~~~

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template