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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:39:22+00:00 2026-05-30T05:39:22+00:00

I have a web service that returns a complex data structure representing the results

  • 0

I have a web service that returns a complex data structure representing the results of an intensive process. To make the service responsive, the process is run in an asynchronous Task.

The first time the service is called, an empty data structure is returned and the Task started. Subsequent service calls return the cached data until the Task completes. When finished, I need to determine if the results actually changed. If so, I update a property that indicates the date/time the results were updated and reset the cached data so the new structure is returned by the service. At some point in the future, based on a variety of reasons, the Task is restarted and the logic repeats.

I am looking for the most efficient way of determining whether the results have changed from the ‘cached’ data. The simplest would be to implement Equals on every object in the structure with parent’s equality based on their children’s equality, etc. so calling Equals on the root objects would yield the desired result, but this requires crawling the entire structure and I’m not sure this is the best approach.

I also thought about starting with a copy of the original and using ‘IsDirty’ flags to indicate that a object in the structure has changed but worry that the copy operation could negate any performce benefits.

What approach would you use (and why)?

  • 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-30T05:39:24+00:00Added an answer on May 30, 2026 at 5:39 am

    I would create a static method that recursively walks over all properties of 2 instances ( left and right ), which optionally can be controlled by using attributes, and calls the equals method of left over right. When one of the properties indicate inequality, we know that the 2 instances are different. This allows me to implement a minimum amount of code for comparison yet be fully in control in what gets compared and how it gets compared (by marking certain properties with a new attribute like [NoCompare] and by implementing custom equality logic).

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

Sidebar

Related Questions

I have a web service that returns an xml string as results. The return
I have a REST web service that returns a structure containing an array of
I have a WCF web service that returns JSON data back to an app
I have a RESTful web service that returns JSON-serialized data. It can successfully serialize
I have a JAX-RPC (Java) web service that needs to return a complex polymorphic
I have a web service that returns the binary array of an object. Is
I have a WSE web service that returns a list of items in a
I have a synchronous web service call that returns a message. I need to
I have a third party web service that returns this xml <book> <release_date>0000-00-00</release_date> </book>
I have a web service which has a generic function that returns a dataset

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.