views:

291

answers:

3

I have been given to the task of writing a coding standards document and creating a framework for web services.

I've looked at numerous articles but I am still stumped to what is exactly required especially when developing a framework as it is completely different from application code.

Has anyone got any useful tips or books they can recommend?

+5  A: 

Check out Framework Design Guidelines by Brad Abrams.

Gerrie Schenck
+2  A: 

If you think about frameworks, the best make repetitive coding tasks easier, DRY, and, if possible, automatic. With that in mind, identify the repetitive tasks in your web service layer. Maybe:

  • Security?
  • Mapping from transport objects to business objects, data objects, others?
  • Special serialization handling?
  • ...

If you have specific use cases or service contracts, pore through them and find things you don't want to code inside every web service method.

From that, cook up a scheme that automates or simplifies code inside the service and, better yet, for service consumers. Maybe:

  • A component that lets you swap out different security approaches with a simple config change
  • A single, generic object mapper versus mapping Property-to-Property every time it's required.
  • An Attribute scheme that tells the service how to handle special serialization versus explicitly handling each case
  • ?

When rolling your own framework, I'd say the most important thing is to start humble. Don't try to be everything to everyone and don't try to anticipate every possibility. Instead, start with tasks that you know are tedious and error-prone and make them automatic.

Corbin March
very helpful advice thanks
CodeMonkey
A: 

When considering a framework, consider using someone else's. Look at the Service Factory. It's not only a framework and development methodology; it's also customizable.

John Saunders