📜 ⬆️ ⬇️

Why web services sucks!

Introduction


Periodically, when faced with various web services , I ask myself: “Why was it so complicated?”. We pay a lot of attention to development processes, code cleanliness, tests and methodologies. We write comments and create documentation. But at the same time, we pay too little attention to the underlying external system interfaces, web services.

All of the following can be attributed to various kinds of web services, but basically I’ll talk about SOAP web services.

Using


In the modern world, web services are used everywhere. Every day someone tears off his API for the whole world. Publishes the documentation and waiting for the influx of visitors.
')
By services, users will find out the weather, get information about traffic jams, read the latest news and learn about events. All social projects, such as facebook, twitter, vk, google, provide access to web services to their users. Immediately there are many convenient software clients. Who would have thought that a person would be able to share his experiences and thoughts in any place and at any time.
More and more public services are acquiring the same services. They can pay fines, receive valuable information, write applications and receive services.

Services increasingly bind the information systems that surround us.

Diversity


Technologies on the basis of which services are implemented are very diverse. Here and Rest-services, Soap, cryptography, various data transfer protocols, data compression technologies, synchronous / asynchronous data transfer, guaranteed delivery.

All this is exacerbated by different versions of technologies and services. To create compatible systems, it is necessary to put a lot of effort.

Who in the forest, and who ...


But how to use all this diversity? Here opinions differ. But we can safely say that many services, in fact, are not. The easiest way to verify this is with a series of statements:

This is a web service if:


This is not a service if:



Single entry point


Well-designed service is self-sufficient. He describes his own, uniquely interpretable, interface. For him, just create classes and you can immediately start using. In the client code, only filling in the request attributes is performed, no additional manipulations. The data structure of the service is simple and straightforward.

All the same as in the code. The minimum level of nesting, self-documenting, the system of logical names of elements and types (SampleRequest in the answer looks shocking ...).

All services that do not meet these requirements can only be called imitations. Of course, they are similar, but if nobody can use the service, then this is the problem of the data provider.

Compression or optimization


Here everything is already invented. Passing base64. Too much? Then use MTOM. Anyway a lot? For web services do not transfer gigabytes, wake up! Transfer links to fast file storage. When a client needs your photos, documents, archives and other media information - he will download it. He does not need an additional load of 20 megabytes per request. Text information is transmitted through the services; everything else is not reasonably transmitted.

If a company does not use its product, then it is worth nothing


If the service provider does not use it himself, if he uses any special interaction rules, if he introduces some privileges for himself in the regulations, then this service cannot be used by definition. The supplier has created an incomprehensible service that he cannot work with him. You will not look at such services without sadness ...

Conclusion


Where did I find such services? Yes, they are everywhere! Even large players have incomprehensible technical solutions. Only with well-constructed services, you can achieve a high degree of integration and stability of many heterogeneous systems.

Source: https://habr.com/ru/post/138470/


All Articles