Business Object or Individual Parameters?
-
I was arguing with my friends about sending the business object over a web service. Some of my friends said that they don't pass the busineess object (eg: Employee ) to Webservice. Instead, they used to pass the individual parameter (eg: empId, empName, empAddress ) to WebService. Because they think that sending the business object over a webservice is not good practice. I don't understand why this is not good practice. I used to send the custom business object to webservice in several project. It works fine.. Plus, it's so easy if I wanna add some properties (eg: empPhone, empEMail ) to my business object because I dont need to add the individual parameter in each and every webmethods whenever I made changes to my BO. I'd like to hear your opinion about this. What do you think? Thanks in advance.
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
-
I was arguing with my friends about sending the business object over a web service. Some of my friends said that they don't pass the busineess object (eg: Employee ) to Webservice. Instead, they used to pass the individual parameter (eg: empId, empName, empAddress ) to WebService. Because they think that sending the business object over a webservice is not good practice. I don't understand why this is not good practice. I used to send the custom business object to webservice in several project. It works fine.. Plus, it's so easy if I wanna add some properties (eg: empPhone, empEMail ) to my business object because I dont need to add the individual parameter in each and every webmethods whenever I made changes to my BO. I'd like to hear your opinion about this. What do you think? Thanks in advance.
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
Nope - your business object is the way that I'd go. As long as it's serializable, you should be fine. I suspect that they are thinking along the lines that the serialized object is going to be much more information that individual parameters, and hence is going to take more bandwidth - but if you are dealing with corporate systems this tends not to be too much of an issue. Really, you've got to ensure that your business object doesn't grow to be too big and balance this with the convenience of passing this over.
Please visit http://www.readytogiveup.com/ and do something special today. Deja View - the feeling that you've seen this post before.
-
I was arguing with my friends about sending the business object over a web service. Some of my friends said that they don't pass the busineess object (eg: Employee ) to Webservice. Instead, they used to pass the individual parameter (eg: empId, empName, empAddress ) to WebService. Because they think that sending the business object over a webservice is not good practice. I don't understand why this is not good practice. I used to send the custom business object to webservice in several project. It works fine.. Plus, it's so easy if I wanna add some properties (eg: empPhone, empEMail ) to my business object because I dont need to add the individual parameter in each and every webmethods whenever I made changes to my BO. I'd like to hear your opinion about this. What do you think? Thanks in advance.
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)
Michael Sync wrote:
Some of my friends said that they don't pass the busineess object (eg: Employee ) to Webservice. Instead, they used to pass the individual parameter (eg: empId, empName, empAddress ) to WebService.
That is not really tracking for me. There is not really a "object" approach to WebServces. There are really only Two types and then of course the REST approach which in now considered a Third type. The two main types are RPC versus Document Centric (now referred to as Service Oriented Architecture as in this definition[^]) Anyway if what you guys are arguing about is RPC vs Document Centric, the RPC approach has been recognized as inferior for a few years now as pointed out in that Wikipedia page.
-
Nope - your business object is the way that I'd go. As long as it's serializable, you should be fine. I suspect that they are thinking along the lines that the serialized object is going to be much more information that individual parameters, and hence is going to take more bandwidth - but if you are dealing with corporate systems this tends not to be too much of an issue. Really, you've got to ensure that your business object doesn't grow to be too big and balance this with the convenience of passing this over.
Please visit http://www.readytogiveup.com/ and do something special today. Deja View - the feeling that you've seen this post before.
Yeah. Thanks..
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)