Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Patterns/Practices for designing Web Services

Tags:

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 specific.

like image 409
noob.spt Avatar asked Nov 21 '09 00:11

noob.spt


2 Answers

  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.
like image 195
Robert Harvey Avatar answered Oct 03 '22 13:10

Robert Harvey


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.
like image 42
Lars Tackmann Avatar answered Oct 03 '22 14:10

Lars Tackmann