Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF design - One Request and Response object or multiple?

Should you make one request/response object for each method or should you have one per service?

My service request object would only have 5 different things in it if I used it across all methods as I use the same inputs for almost all methods.

The response object would only have a dictionary, a bool, an int that represents an ID, and a string value for the name. I'm not sure I see the point in creating a bunch of separate objects that all have the same things inside of them instead of just using one object.

What is considered the best practice?

like image 721
hyprsleepy Avatar asked Dec 29 '25 11:12

hyprsleepy


1 Answers

I would advise one for each method containing only the request and response information that that method provides and returns. The reason being that it will be clearer to calling clients what the expectations of that method are when they generate their proxy code from the wsdl.

like image 86
Nick Ryan Avatar answered Jan 01 '26 20:01

Nick Ryan