Chat with friends and learn that their company uses WebService to layer the software architecture.
This is true in the software architecture, but there is a slight deviation in execution.
1. on the server side that provides information, the WebService function directly fetches the database for return.
The function in WebService only establishes online data and obtains data. In this way, it only writes stored procedures in the program code.
In essence, it is still the database-oriented system of "fishing data + typographical display". It is just to change the "fishing data" section from SQL to WebService.
When using WebService, it should be the service that the software system provides to other systems 』.
The definition of the software system here refers to the system with its own domain know how, and then open the function to other systems to operate and read.
2. The client that obtains the information directly calls WebService where the data is to be retrieved.
The system is filled with a bunch of new xxxwebservice (). The whole system is closely tied to WebService.
When you want to switch the information provider, you can only perform the switch from the remote WebService.
The software system should cut the connection with the external system and separate it into a level similar to Dal.
The software system depends on its own Dal interface, and then injects the WebService object for implementing the Dal interface.
3. The server that provides information directly uses the WSDL generated by the Visual Studio project.
Because Visual Studio can automatically generate the WSDL, each modification function creates a new WSDL.
When another person is also developed according to the WSDL, it is easy to cause a difference in the WSDL when there is a change.
The WSDL should be independent from the project. Multiple groups of developers can write functions based on the same WSDL.
4 ......
This article emphasizes that it is right to use WebService to layer the software architecture.
In this article, we will discuss some deviations in execution.
Finally,
In this article, ". NET application architecture: designing applications and services.
The WebService should be located at the UI Layer and Dal layer, and the application logic layer in the middle should not contain WebService.
Basically, we should regard WebService as an "interface + proxy", rather than simply an "interface" for cutting dependencies 』.