开发者

Patterns/Practices for designing Web Services

Are there any good patterns/practices used while designing Services. I came across this post today:

When to Use the Decorator Pattern?

Though I didn't completely understand but it really gives a new direction to think about designing services.

Note: This question is not any technology speci开发者_如何学Pythonfic.


  1. Follow a REST model.
  2. Rigorously validate incoming data.
  3. Avoid SQL injection, and other code exploits.
  4. In general, work with large chunks of data; i.e. records instead of fields.
  5. Build your services on a transaction (Unit of Work) basis.


Here is my list:

  1. Read a book on real-life service design. For a Restful approach i recommend Restful Web Services
  2. Spec it: Designing a service in human code is much easier to discuss and change than implementing it and then discover it's wrong.
  3. Write integration (service tests) in a different language: You can be fooled into thinking that your service is real spiffy by using the same tech on both client and server. Implementing a RESTful service in Java?, then write your service tests in (J)Ruby, creating .NET SOAP service ? then write your service tests in Java.


Check SOA Patterns at http://www.soapatterns.org/

I think you can get some insight into the subject and find good ideas browsing there...


I like to divide the services in two kinds: 1.- Business services with the following layers: ddbb dal (group functionality, ddd's repository style) bll (entities, business actions) sil (DTOs, conversion from dto to entity and security)

2.- orchestration services (bpel style): it groups business services for achieving something.

I do not like REST so much, I prefer SOAP.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜