none
SOA message design RRS feed

  • Question

  • Hi,

    I'm developing a system using web services with SOA principles. But I have doubts about the design of a message. For example, I want to expose a product catalog so the signature of my method would be:

    public FindProductResponse FindProduct(FindProductRequest request){........}

    FindProductResponse will return a collection with all the products that meet the criteria specified in the FindProductRequest object. But I don't know how to define a FindProductRequest correctly.  I have several search criterias: By product category, product subcategory, product unique identifier, etc... Do I have to write a different method for each search criteria?

    Thanks for your help

    Mauricio.

    Monday, June 5, 2006 11:39 PM

Answers

  • I can see this going either way.  Personally I would probably have one method.  I am assuming that the response data will always be the same.  In that case it makes sense to me that your request criteria would identify the property to search by and the value to filter.  To me the method is still performing one piece of functionality.  Just don't go farther with this.  I wouldn't have one method that return products, customers and invoice depending on criteria. 

    I am sure there are those who will disagree.  If they do they can state their reasons.  Hope that helps.

    Tim Murphy

    Tuesday, June 6, 2006 7:12 PM
  • this is about how flexible and ready for change you want to be and in control and...and.. and.. and preformance.

    When you use one methode which accepts different criteria and let the request handle the knowledge on which property to filter, and multiple clients are using that methode. they also must have knowledge of the filtering properties. When you change (add, delete or rename) a filter property you must notify the clients.

    When you use multiple methods each client who uses a specific filter methode. this client doesn't have to know all the other filter properties and when you change one methode you only have to notify the clients who are using that service.

    When you just have one client, you can choose to have just one methode, but maybe you want some control on which properties this client is filtering on... 

    and what Tim is saying, result should be the same.

    and you can go on like this a while.. there are more tradeoffs you can make.  

    But finaly I would go for multiple methodes

    Wednesday, June 7, 2006 3:56 AM

All replies

  • I can see this going either way.  Personally I would probably have one method.  I am assuming that the response data will always be the same.  In that case it makes sense to me that your request criteria would identify the property to search by and the value to filter.  To me the method is still performing one piece of functionality.  Just don't go farther with this.  I wouldn't have one method that return products, customers and invoice depending on criteria. 

    I am sure there are those who will disagree.  If they do they can state their reasons.  Hope that helps.

    Tim Murphy

    Tuesday, June 6, 2006 7:12 PM
  • this is about how flexible and ready for change you want to be and in control and...and.. and.. and preformance.

    When you use one methode which accepts different criteria and let the request handle the knowledge on which property to filter, and multiple clients are using that methode. they also must have knowledge of the filtering properties. When you change (add, delete or rename) a filter property you must notify the clients.

    When you use multiple methods each client who uses a specific filter methode. this client doesn't have to know all the other filter properties and when you change one methode you only have to notify the clients who are using that service.

    When you just have one client, you can choose to have just one methode, but maybe you want some control on which properties this client is filtering on... 

    and what Tim is saying, result should be the same.

    and you can go on like this a while.. there are more tradeoffs you can make.  

    But finaly I would go for multiple methodes

    Wednesday, June 7, 2006 3:56 AM
  • I don't think that exposing a "generic" method to perform searches on products is in line with SOA principles - it looks more like a DAL that happens to have a web-service API.

    I would try to create messages that are aligned to specific business processes that the service participate in.

    Arnon

    Friday, June 9, 2006 10:16 PM