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

  • Home
  • SEARCH
  • 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 9119197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:20:19+00:00 2026-06-17T05:20:19+00:00

I have two classes named Parent and Child . The Parent class contains a

  • 0

I have two classes named Parent and Child. The Parent class contains a reference to the Child class. When I create an instance of the Parent class I will pass an instance of a Child object.

As per my knowledge we pass this Child instance as reference. Then I cache this Parent object in an external cache. Then I retrieve this object from another system. I think in that system the instance of the Child object may not be present.

As per theory ‘_child’ contains reference of object in the heap not the actual object am i right?

Just think in server farm scenario, your object instance should be available to other system and the system once generated that object

public class Parent
{
    public Child _child = null;

    public Parent(Child c)
    {
        _child=c;   
    }
}

public class Child
{
    public string Name;
}

static void Main()
{
    Child c = new Child();
    c.Name="vivek";
    Parent p = Parent(c);
    string key = ExternalCache.Add(p);
}

Now what will happen if I try to retrieve this Parent object in another system or application?

static void Main()
{
   Parent p = (Parent)ExternalCache.Get(Key)
   Console.WriteLine(p._child.Name);
}
  • 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-06-17T05:20:20+00:00Added an answer on June 17, 2026 at 5:20 am

    It’s not possible to pass the same references of objects to different machines simply because they won’t be running within the same memory space so even if you could the references wouldn’t be any use. However, what you can do is serialize the object graph & re-contruct the object at the other end – this is known as object serialization, or just serialization in general.

    The .NET Framework has various built-in serializers which allow different types of serialization e.g.

    • Xml – DataContractSerializer, XmlSerializer
    • JSON – DataContractJsonSerializer, JavaScriptSerializer
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two classes named BaseCatalog and City. BaseCatalog is the parent class of
I have two classes A and B. Class A contains a UIView named myView
I have two classes with a parent-child relationship (the Parent class has-a Child class),
I have two classes: public class Parent { public virtual long? ID { get;
Let's say I have two classes, Parent and Child. These two are related via
Say I have two classes: Parent and Child . A Parent has a property
Say I have two classes that can reference a third UI object (in this
I have two classes, Parent and Child. The code for the classes are like
i have made two classes, which is person - the parent class and a
I have the following two classes: Claim (parent) and ClaimInsurance (child). They are as

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.