Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3969630
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:59:11+00:00 2026-05-20T03:59:11+00:00

I’m designing some services and I would like to get some feedback about the

  • 0

I’m designing some services and I would like to get some feedback about the conventions I’m using.

For all operations, I always define a ‘Context’ object and a ‘Result’ one, because of the following advantages:

  • extensibility: I can add parameters to the context or objects to the result without changing the interface
  • compactness: I only have a single object in the definition, even if I need many parameters

Example:

[OperationContract]    
DoSomethingResult DoSomething(DoSomethingContext context)

Anyway, I’m not really sure that this is the best way to do it because of the following reasons:

  • overhead: I always wrap the response properties into an object. Sometimes, the Result object has no properties
  • versioning: WCF has built-in versioning for contracts, and maybe it could be better to use a different version to inform about the difference

In fact I use the same technique with normal methods too, so it would be important for me to get some feedback, advices, critics and so on and so forth.

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T03:59:12+00:00Added an answer on May 20, 2026 at 3:59 am

    I think that’s a perfectly legitimate way to write your contracts. I’ve worked on a number of projects with these sort of contracts and it is has been a pleasure – very easy during development (just add a property to the object and you’re done), a straightforward and clear pattern that applies to all services, and allows for things like a single validation method for all operations.

    In response to your concerns:

    • I don’t think the overhead of creating an empty object is at all significant. Don’t worry about this unless it becomes an issue.
    • If the Result object has no properties (i.e. you aren’t returning anything) then simply return void. You aren’t gaining anything by returning an empty object.
    • You can (and probably should) version these objects as you version your contracts. What you are doing in no way precludes you from versioning your objects.

    Please note that versioning objects does not mean changing them to DoSomethingResult_v1, DoSomethingResult_v2 as I’ve seen before. You should version with namespaces; it makes things clearer and cleaner. Just put a version in the XML namespaces in both the operation contract and data member attributes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.