You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Olaf Krueger <ma...@olafkrueger.net> on 2019/02/11 14:13:49 UTC

How to identify object instances (StableObjectId)?

Hi 
IIRIC, in Flex/AS3 each object is identified by a unique id, something like
MyClass@aa77fdre7ee.

I need to identify a certain object instance while debugging a Royale app
but didn't find this kind of identifier.

Instead, I found this:

[[StableObjectId]]:35

Is this the pendant to the object id which I described above?
IOW: 
When I want to make sure that I am working with the right instance of an
object, is this StableObjectId a proper way to trace this?

Thanks,
Olaf



--
Sent from: http://apache-royale-development.20373.n8.nabble.com/

RE: How to identify object instances (StableObjectId)?

Posted by Yishay Weiss <yi...@hotmail.com>.
That’s my understanding too.



________________________________
From: Olaf Krueger <ma...@olafkrueger.net>
Sent: Tuesday, February 12, 2019 12:34:00 PM
To: dev@royale.apache.org
Subject: Re: How to identify object instances (StableObjectId)?

Thanks, Yishay... it really seems that StableObjectId is coming from Chrome.

> You can use an object’s dimensions, className, etc. to make sure it’s the
> one you need.
> I do this all the time to break on specific values.

Just to make sure that I got it right:
What if we create a couple of instances of the same class, all objects are
in the same initial state, all objects are total equal e.g.:

var instance1:MySuperComponent = new MySuperComponent();
var instance2:MySuperComponent = new MySuperComponent();
var instance3:MySuperComponent = new MySuperComponent();

In Flex, the object id can be used to distinguish between those objects out
of the box.
Is my understanding right that in Royale, we have to modify or add an object
property (e.g UUID) of/to each particular object in order to be able to
distinguish between all instances.

Thanks,
Olaf





--
Sent from: http://apache-royale-development.20373.n8.nabble.com/

Re: How to identify object instances (StableObjectId)?

Posted by Piotr Zarzycki <pi...@gmail.com>.
Sure! Let's do this! :)

On Wed, Feb 13, 2019, 9:12 PM Olaf Krueger <ma...@olafkrueger.net> wrote:

> Thanks, Alex for this proposal!
>
> @Piotr
> I created a new issue [1] and a related feature branch.
> We'll maybe find some free cycles soon in order to achieve this together...
> with your help? ;-))))
>
> Thank you!
> Olaf
>
> [1] https://github.com/apache/royale-asjs/issues/394
>
>
>
>
> --
> Sent from: http://apache-royale-development.20373.n8.nabble.com/
>

Re: How to identify object instances (StableObjectId)?

Posted by Olaf Krueger <ma...@olafkrueger.net>.
Thanks, Alex for this proposal!

@Piotr
I created a new issue [1] and a related feature branch.
We'll maybe find some free cycles soon in order to achieve this together...
with your help? ;-))))

Thank you!
Olaf

[1] https://github.com/apache/royale-asjs/issues/394




--
Sent from: http://apache-royale-development.20373.n8.nabble.com/

Re: How to identify object instances (StableObjectId)?

Posted by Piotr Zarzycki <pi...@gmail.com>.
+1 for that idea! Go ahead Olaf! I can help you if you need.

Thanks, Piotr

śr., 13 lut 2019 o 18:05 Alex Harui <ah...@adobe.com.invalid> napisał(a):

> Hi Olaf,
>
> As soon as you say a scenario is rare, then it definitely shouldn't be
> baked into the base classes for PAYG reasons.
>
> It occurs to me that for any component that implements IStrand (like
> UIBase), you could define a bead that goes on the strand that would
> generate an identifier.  Or document the pattern that folks could use to
> add an identifier to a subclass of an existing bead (so you can swap out a
> bead instead of having to alter the app to inject an additional bead).
>  Maybe you can write that up and contribute it.
>
> -Alex
>
> On 2/13/19, 1:36 AM, "Olaf Krueger" <ma...@olafkrueger.net> wrote:
>
>     Hi Alex,
>
>     >I'd be interested in understanding the scenario where you create
> multiple
>     instances with the exact same set of properties.
>
>     Even if these scenarios are probably rare:
>     One scenario is to display multiple instances of the same UI component
> at
>     the same time. After initialization, they are all identical.
>     Another scenario is when you create whatever other object instances
>     dynamically at runtime it could occur, that you accidentally created
> more
>     instances than needed (without knowing about this issue). With a unique
>     identifier, such a thing could be more obvious.
>
>     >For PAYG reasons, identifiers are not added to every object
> "just-in-case".
>     If you need them, add them.
>     > Import org.apache.royale.utils.UIDUtil;
>
>     I already understood it and I am totally fine with this workaround!
>     I don't want to complain, I just want to understand it entirely! ;-)
>
>     Thanks for the help,
>     Olaf
>
>
>
>     --
>     Sent from:
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-royale-development.20373.n8.nabble.com%2F&amp;data=02%7C01%7Caharui%40adobe.com%7C7477d3b48cb848232e3808d69196c7ba%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636856474114574690&amp;sdata=9dhhyEPghMOxTTgw7Kdwec8GbGbD6fQS6UzCTg8Sn6Y%3D&amp;reserved=0
>
>
>

-- 

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
<https://www.patreon.com/piotrzarzycki>*

Re: How to identify object instances (StableObjectId)?

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Hi Olaf,

As soon as you say a scenario is rare, then it definitely shouldn't be baked into the base classes for PAYG reasons.

It occurs to me that for any component that implements IStrand (like UIBase), you could define a bead that goes on the strand that would generate an identifier.  Or document the pattern that folks could use to add an identifier to a subclass of an existing bead (so you can swap out a bead instead of having to alter the app to inject an additional bead).   Maybe you can write that up and contribute it.

-Alex

On 2/13/19, 1:36 AM, "Olaf Krueger" <ma...@olafkrueger.net> wrote:

    Hi Alex,
    
    >I'd be interested in understanding the scenario where you create multiple
    instances with the exact same set of properties. 
    
    Even if these scenarios are probably rare:
    One scenario is to display multiple instances of the same UI component at
    the same time. After initialization, they are all identical.
    Another scenario is when you create whatever other object instances
    dynamically at runtime it could occur, that you accidentally created more
    instances than needed (without knowing about this issue). With a unique
    identifier, such a thing could be more obvious.
    
    >For PAYG reasons, identifiers are not added to every object "just-in-case". 
    If you need them, add them. 
    > Import org.apache.royale.utils.UIDUtil; 
    
    I already understood it and I am totally fine with this workaround!
    I don't want to complain, I just want to understand it entirely! ;-)
    
    Thanks for the help,
    Olaf
    
    
    
    --
    Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-royale-development.20373.n8.nabble.com%2F&amp;data=02%7C01%7Caharui%40adobe.com%7C7477d3b48cb848232e3808d69196c7ba%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636856474114574690&amp;sdata=9dhhyEPghMOxTTgw7Kdwec8GbGbD6fQS6UzCTg8Sn6Y%3D&amp;reserved=0
    


Re: How to identify object instances (StableObjectId)?

Posted by Olaf Krueger <ma...@olafkrueger.net>.
Hi Alex,

>I'd be interested in understanding the scenario where you create multiple
instances with the exact same set of properties. 

Even if these scenarios are probably rare:
One scenario is to display multiple instances of the same UI component at
the same time. After initialization, they are all identical.
Another scenario is when you create whatever other object instances
dynamically at runtime it could occur, that you accidentally created more
instances than needed (without knowing about this issue). With a unique
identifier, such a thing could be more obvious.

>For PAYG reasons, identifiers are not added to every object "just-in-case". 
If you need them, add them. 
> Import org.apache.royale.utils.UIDUtil; 

I already understood it and I am totally fine with this workaround!
I don't want to complain, I just want to understand it entirely! ;-)

Thanks for the help,
Olaf



--
Sent from: http://apache-royale-development.20373.n8.nabble.com/

Re: How to identify object instances (StableObjectId)?

Posted by Alex Harui <ah...@adobe.com.INVALID>.
For PAYG reasons, identifiers are not added to every object "just-in-case".  If you need them, add them.

I'd be interested in understanding the scenario where you create multiple instances with the exact same set of properties.  I would think it would be better to share one instance in that case.

It should be simple to add uid's where you need them unless I'm missing something:

Import org.apache.royale.utils.UIDUtil;
...
   Private var _uid:String;
   Public function MyConstructor(){
      _uid = UIDUtil(this);
   }

HTH,
-Alex

On 2/12/19, 2:34 AM, "Olaf Krueger" <ma...@olafkrueger.net> wrote:

    Thanks, Yishay... it really seems that StableObjectId is coming from Chrome.
    
    > You can use an object’s dimensions, className, etc. to make sure it’s the
    > one you need. 
    > I do this all the time to break on specific values. 
    
    Just to make sure that I got it right:
    What if we create a couple of instances of the same class, all objects are
    in the same initial state, all objects are total equal e.g.:
    
    var instance1:MySuperComponent = new MySuperComponent();
    var instance2:MySuperComponent = new MySuperComponent();
    var instance3:MySuperComponent = new MySuperComponent();
    
    In Flex, the object id can be used to distinguish between those objects out
    of the box.
    Is my understanding right that in Royale, we have to modify or add an object
    property (e.g UUID) of/to each particular object in order to be able to
    distinguish between all instances.
    
    Thanks,
    Olaf
    
    
    
    
    
    --
    Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-royale-development.20373.n8.nabble.com%2F&amp;data=02%7C01%7Caharui%40adobe.com%7Ce1eae98d87e3478b753308d690d59d34%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636855644507811920&amp;sdata=5dFh2otgxkQXCoEN6ycomKZYSZorwCEhZyuDKfFQcAQ%3D&amp;reserved=0
    


Re: How to identify object instances (StableObjectId)?

Posted by Olaf Krueger <ma...@olafkrueger.net>.
Thanks, Yishay... it really seems that StableObjectId is coming from Chrome.

> You can use an object’s dimensions, className, etc. to make sure it’s the
> one you need. 
> I do this all the time to break on specific values. 

Just to make sure that I got it right:
What if we create a couple of instances of the same class, all objects are
in the same initial state, all objects are total equal e.g.:

var instance1:MySuperComponent = new MySuperComponent();
var instance2:MySuperComponent = new MySuperComponent();
var instance3:MySuperComponent = new MySuperComponent();

In Flex, the object id can be used to distinguish between those objects out
of the box.
Is my understanding right that in Royale, we have to modify or add an object
property (e.g UUID) of/to each particular object in order to be able to
distinguish between all instances.

Thanks,
Olaf





--
Sent from: http://apache-royale-development.20373.n8.nabble.com/

Re: How to identify object instances (StableObjectId)?

Posted by Harbs <ha...@gmail.com>.
+1.

I do this all the time to break on specific values.

> On Feb 12, 2019, at 11:40 AM, Yishay Weiss <yi...@hotmail.com> wrote:
> 
> For what it’s worth, I find using conditional breakpoints will get me around the need to record instance names most of the time. You can use an object’s dimensions, className, etc. to make sure it’s the one you need.
> 
> 
> 
> ________________________________
> From: Olaf Krueger <ma...@olafkrueger.net>
> Sent: Monday, February 11, 2019 4:13:49 PM
> To: dev@royale.apache.org
> Subject: How to identify object instances (StableObjectId)?
> 
> Hi
> IIRIC, in Flex/AS3 each object is identified by a unique id, something like
> MyClass@aa77fdre7ee.
> 
> I need to identify a certain object instance while debugging a Royale app
> but didn't find this kind of identifier.
> 
> Instead, I found this:
> 
> [[StableObjectId]]:35
> 
> Is this the pendant to the object id which I described above?
> IOW:
> When I want to make sure that I am working with the right instance of an
> object, is this StableObjectId a proper way to trace this?
> 
> Thanks,
> Olaf
> 
> 
> 
> --
> Sent from: http://apache-royale-development.20373.n8.nabble.com/


RE: How to identify object instances (StableObjectId)?

Posted by Yishay Weiss <yi...@hotmail.com>.
For what it’s worth, I find using conditional breakpoints will get me around the need to record instance names most of the time. You can use an object’s dimensions, className, etc. to make sure it’s the one you need.



________________________________
From: Olaf Krueger <ma...@olafkrueger.net>
Sent: Monday, February 11, 2019 4:13:49 PM
To: dev@royale.apache.org
Subject: How to identify object instances (StableObjectId)?

Hi
IIRIC, in Flex/AS3 each object is identified by a unique id, something like
MyClass@aa77fdre7ee.

I need to identify a certain object instance while debugging a Royale app
but didn't find this kind of identifier.

Instead, I found this:

[[StableObjectId]]:35

Is this the pendant to the object id which I described above?
IOW:
When I want to make sure that I am working with the right instance of an
object, is this StableObjectId a proper way to trace this?

Thanks,
Olaf



--
Sent from: http://apache-royale-development.20373.n8.nabble.com/

Re: How to identify object instances (StableObjectId)?

Posted by Piotr Zarzycki <pi...@gmail.com>.
In Intelij debugger there is unique number for each instance. I can see
this during debugging, so maybe it's a matter of support from IDE sight. It
is very helpful when you wanted to compare instance of some object in one
place of app with another place.

On Mon, Feb 11, 2019, 10:13 PM Alex Harui <ah...@adobe.com.invalid> wrote:

> I've never seen that.
>
> For PAYG reasons, fewer objects are assigned ids just in case in Royale.
>
> For debugging, you might be able to call UIDUtil on the objects to assign
> then a UID.  But often in the debugger you can identify an object by the
> properties it has and its parent.
>
> HTH,
> -Alex
>
> On 2/11/19, 6:14 AM, "Olaf Krueger" <ma...@olafkrueger.net> wrote:
>
>     Hi
>     IIRIC, in Flex/AS3 each object is identified by a unique id, something
> like
>     MyClass@aa77fdre7ee.
>
>     I need to identify a certain object instance while debugging a Royale
> app
>     but didn't find this kind of identifier.
>
>     Instead, I found this:
>
>     [[StableObjectId]]:35
>
>     Is this the pendant to the object id which I described above?
>     IOW:
>     When I want to make sure that I am working with the right instance of
> an
>     object, is this StableObjectId a proper way to trace this?
>
>     Thanks,
>     Olaf
>
>
>
>     --
>     Sent from:
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-royale-development.20373.n8.nabble.com%2F&amp;data=02%7C01%7Caharui%40adobe.com%7C22dc0afa678b415c838208d6902b2b6b%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636854912435514864&amp;sdata=HAzJOsrnLa5J2IYv9snB7hhTk3Q8%2F5EdchdknDLdtBg%3D&amp;reserved=0
>
>
>

Re: How to identify object instances (StableObjectId)?

Posted by Olaf Krueger <ma...@olafkrueger.net>.
Interesting, thanks for sharing!

Olaf



--
Sent from: http://apache-royale-development.20373.n8.nabble.com/

Re: How to identify object instances (StableObjectId)?

Posted by Piotr Zarzycki <pi...@gmail.com>.
Hi Olaf,

This is how it looks like in intellij [1] - Each object has such unique
number. If it's the same instance of object you will have the same number
in other place of applications.

[1] https://imgur.com/jG9MM2f

Thanks,
Piotr

wt., 12 lut 2019 o 09:59 Olaf Krueger <ma...@olafkrueger.net> napisał(a):

> Hi,
>
> just for the case of completeness, the StableObjectId looks like this in
> VSCode [1].
>
> > ... you can identify an object by the properties it has and its parent
>
> IIUIC, this is valid for objects which do not differ.
> But if we have (for whatever reason) identical object instances it's hard
> to
> identify an object without having a unique object ID.
> However, UIDUtil idea is definitely a way to go if this [[StableObjectId]]
> doesn't work.
>
> @Piotr
> I am interested in how it looks like in Intelij, could you share a
> screenshot?
>
> Thanks for the help!
>
> Olaf
>
> [1]  https://snag.gy/YlMPW1.jpg
>
>
>
> --
> Sent from: http://apache-royale-development.20373.n8.nabble.com/
>


-- 

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
<https://www.patreon.com/piotrzarzycki>*

RE: How to identify object instances (StableObjectId)?

Posted by Yishay Weiss <yi...@hotmail.com>.
Not sure exactly where it’s manufactured but it looks [1] like StableObjectID id a property created by Chrome. I guess, use at your own risk.



[1] https://github.com/ChromeDevTools/devtools-frontend/commit/fa54b2abcc2055e965ce972e9d42ac31a8a7caa3



________________________________
From: Olaf Krueger <ma...@olafkrueger.net>
Sent: Tuesday, February 12, 2019 10:52:36 AM
To: dev@royale.apache.org
Subject: Re: How to identify object instances (StableObjectId)?

Hi,

just for the case of completeness, the StableObjectId looks like this in
VSCode [1].

> ... you can identify an object by the properties it has and its parent

IIUIC, this is valid for objects which do not differ.
But if we have (for whatever reason) identical object instances it's hard to
identify an object without having a unique object ID.
However, UIDUtil idea is definitely a way to go if this [[StableObjectId]]
doesn't work.

@Piotr
I am interested in how it looks like in Intelij, could you share a
screenshot?

Thanks for the help!

Olaf

[1]  https://snag.gy/YlMPW1.jpg



--
Sent from: http://apache-royale-development.20373.n8.nabble.com/

Re: How to identify object instances (StableObjectId)?

Posted by Olaf Krueger <ma...@olafkrueger.net>.
Hi,

just for the case of completeness, the StableObjectId looks like this in
VSCode [1].

> ... you can identify an object by the properties it has and its parent

IIUIC, this is valid for objects which do not differ.
But if we have (for whatever reason) identical object instances it's hard to
identify an object without having a unique object ID.
However, UIDUtil idea is definitely a way to go if this [[StableObjectId]]
doesn't work.

@Piotr
I am interested in how it looks like in Intelij, could you share a
screenshot?

Thanks for the help!

Olaf

[1]  https://snag.gy/YlMPW1.jpg



--
Sent from: http://apache-royale-development.20373.n8.nabble.com/

Re: How to identify object instances (StableObjectId)?

Posted by Alex Harui <ah...@adobe.com.INVALID>.
I've never seen that.

For PAYG reasons, fewer objects are assigned ids just in case in Royale.

For debugging, you might be able to call UIDUtil on the objects to assign then a UID.  But often in the debugger you can identify an object by the properties it has and its parent.

HTH,
-Alex

On 2/11/19, 6:14 AM, "Olaf Krueger" <ma...@olafkrueger.net> wrote:

    Hi 
    IIRIC, in Flex/AS3 each object is identified by a unique id, something like
    MyClass@aa77fdre7ee.
    
    I need to identify a certain object instance while debugging a Royale app
    but didn't find this kind of identifier.
    
    Instead, I found this:
    
    [[StableObjectId]]:35
    
    Is this the pendant to the object id which I described above?
    IOW: 
    When I want to make sure that I am working with the right instance of an
    object, is this StableObjectId a proper way to trace this?
    
    Thanks,
    Olaf
    
    
    
    --
    Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-royale-development.20373.n8.nabble.com%2F&amp;data=02%7C01%7Caharui%40adobe.com%7C22dc0afa678b415c838208d6902b2b6b%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636854912435514864&amp;sdata=HAzJOsrnLa5J2IYv9snB7hhTk3Q8%2F5EdchdknDLdtBg%3D&amp;reserved=0