| MATLAB Central > MATLAB Newsreader > Object's dependent properties |
|
|
|
I have two objects. Object1 has a property obj2 which is of type object2. They both have a property called failed. I would like the failed property of object2 to be dependent on the failed property of object1. |
|
Subject: Object's dependent properties From: per isakson Date: 20 Aug, 2011 18:51:08 Message: 2 of 7 |
|
"crc" wrote in message <j2jasn$hig$1@newscl01ah.mathworks.com>... |
|
In this specific case (for these example classes of object1 and object 2) I would like object2.failed to mirror object1.failed. In a more general sense, I was wondering what the commonly accepted way to make object1's properties accessible to object2 for use. The problem I am running into with these example classes is that passing object1 into the constructor of object2 and storing it into owner, is setting object1 as a child of object2. This creates a parent child loop that would go into infinite recursion if I were to look at nested properties of the classes with a property inspector. |
|
Subject: Object's dependent properties From: Steven_Lord Date: 23 Aug, 2011 13:09:51 Message: 4 of 7 |
|
|
|
Steve - thanks for your input. That is what I originally wanted to do. However, I don't know how to access the properties of object1 from within a method of object2 without passing object1 into the constructor of object2 and storing it as a property of object2. I would love for the object2's set.failed method to get the value of object1's failed property. |
|
Sorry - typo in the last sentence. --> I would love for object2's get.failed method to have access to the value of object1's failed property. |
|
Subject: Object's dependent properties From: Steven_Lord Date: 23 Aug, 2011 18:48:28 Message: 7 of 7 |
|
|
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.
| Tag Activity for This Thread | ||
|---|---|---|
| Tag | Applied By | Date/Time |
| oop | per isakson | 20 Aug, 2011 14:41:06 |
Contact us at files@mathworks.com
