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 896253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:41:51+00:00 2026-05-15T14:41:51+00:00

I will have multiple WCF component methods returning a common object. In some cases,

  • 0

I will have multiple WCF component methods returning a common object. In some cases, fields A,B,C,D will be required to be non-null, but in other cases fields B,F,G,Q may be required to be non-null.

I want to indicate to whoever may be creating these methods which fields are required for any particular method. I’d also like to enforce these requirements as well.

I may not be able to change the common object – i.e. it’s defined by a different team.

Is there a pattern or strategy that can make this easy?

Thanks!

  • 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-15T14:41:51+00:00Added an answer on May 15, 2026 at 2:41 pm

    You need an adapter object that knows how to handle both (all) cases or (probably) better, multiple adapters that each know how to handle their own case.

    If you don’t have control of the object, then you can’t enforce anything on its internals, all you can do is adapt to it in your own code. So the other team will still return the common object. What you do is in your code, create adapter objects that validate your required fields etc.

    For example,

    CommonObjectFromWCFGuys cofwg = wcf.SomeMethod( someParam );
    AdapterForABCD abcd = new AdapterForABCD( cofwg );
    abcd.ValidateRequiredFields( );
    SomeInternalBusinessMethod( abcd );
    

    Your ‘SomeInternalBusinessMethod’ can then require specific fields, but you can’t really force the other team to return those fields, you can just check them in you code before using them.

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

Sidebar

Related Questions

I'm creating a program in VB.NET to output multiple images. Some images will have
I have multiple WCF services that share some data contracts and need to generate
I have a WCF service that will serve multiple clients. They will have operation
I will have multiple tables used by different projects on the same mySql server.
i am doing a project that will have multiple channels for clients chatting. Each
I need to create a WP site which will have multiple subjects. Each subject
For a project I'm working on I will have multiple servers and lots of
_Hey, I have a question. I want to write application which will have multiple
I have multiple classes that will store similar data for different uses and I
I am making an application which will have an interface similar to Photoshop: multiple

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.