search

Home  >  Q&A  >  body text

java - 个人理解的Web-Service-Dao架构,求斧正

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

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

PHP中文网PHP中文网2889 days ago419

reply all(3)I'll reply

  • 怪我咯

    怪我咯2017-04-18 09:07:16

    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

    reply
    0
  • 迷茫

    迷茫2017-04-18 09:07:16

    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

    reply
    0
  • PHPz

    PHPz2017-04-18 09:07:16

    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~~~

    reply
    0
  • Cancelreply