Identifying Objects

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Identifying Objects

Robert Bruce Carleton-4
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have an application where I escalate alert instances up through an instance hierarchy. This is probably a FAQ, but I'd like to clearly identify the instances that generate these alerts. Is there some kind of message I can run on an instance, to retrieve an identifier, that can be stored in the alert?

TIA,

                        --Bruce

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iQEcBAEBAgAGBQJPc8UMAAoJEPy/5L3ndSQstpkH/2AuQ8i64ZDvtaOQcw3UvnTa
x9xog75TMpHmZrelqBHXebXxMVNDhTLEoR6ecB92mRa3TWFh7Ui0x+ZVMoBIpTjH
z1zSRWPyKO+kaEuG2YYBX8wGAA9/CiryfG5gaAxMVKMcbE2HVw1SkQjAsbZnL/It
Qq1TR7qb7YCCqOTwvBDO9ebnFZc6cuEYWLJY4+y4fV98W2aHpc3ZGEc2wZgMN3hR
ZR+d/I6FnUbp9z/iqabewg5YVW3Alr5BdJZRXtHIdN/QKuB+GRIBrXCP55jJ52u3
6e4v5DqslTDz/+DOQ/DAukdJJJ8FFjTMi4VAbfShb4wfLcSRw3bZNcEwOXarnH0=
=Os+C
-----END PGP SIGNATURE-----

Reply | Threaded
Open this post in threaded view
|

Re: Identifying Objects

Tim Felgentreff
On 03/29/2012 04:12 AM, Robert Carleton wrote:
> I have an application where I escalate alert instances up through an instance hierarchy. This is probably a FAQ, but I'd like to clearly identify the instances that generate these alerts. Is there some kind of message I can run on an instance, to retrieve an identifier, that can be stored in the alert?
>
> TIA,
>
> --Bruce
>
>

Not sure what you mean, if the object id works for you, send #asOop

Reply | Threaded
Open this post in threaded view
|

Re: Identifying Objects

Bert Freudenberg
In reply to this post by Robert Bruce Carleton-4
On 29.03.2012, at 04:12, Robert Carleton wrote:
> I have an application where I escalate alert instances up through an instance hierarchy. This is probably a FAQ, but I'd like to clearly identify the instances that generate these alerts. Is there some kind of message I can run on an instance, to retrieve an identifier, that can be stored in the alert?
>
> TIA,
>
> --Bruce


Why not keep a reference to the instance itself?

- Bert -



Reply | Threaded
Open this post in threaded view
|

Re: Identifying Objects

Robert Bruce Carleton-4
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Mar 29, 2012, at 7:59 AM, Bert Freudenberg wrote:

> On 29.03.2012, at 04:12, Robert Carleton wrote:
>> I have an application where I escalate alert instances up through an instance hierarchy. This is probably a FAQ, but I'd like to clearly identify the instances that generate these alerts. Is there some kind of message I can run on an instance, to retrieve an identifier, that can be stored in the alert?
>>
>> TIA,
>>
>> --Bruce
>
>
> Why not keep a reference to the instance itself?
>
> - Bert -
>
>
>

Coincidentally, I was just testing that.

Thanks,

                        --Bruce

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iQEcBAEBAgAGBQJPdFH0AAoJEPy/5L3ndSQsdb0H/Reu+dN0sgzKmkVO+dQMaJPV
3g8xfLMwuF9mX8ymuPk0fQproxt79MdB4/BAunxL6J2gN5BPoszzP3H7RJItKeLx
3SJOixYmFC4hg27W2hRWB7P1+QGUO/ukMDh+GL55hqSsgmxZVnz9npKZys7KZJWf
sLXBMWATwpmLTLtQ78fc+I1FcgSFKs1w8qupFBmZQ5QzNNqWfIYkT1tLNgvbiS3t
G5rB/1uAfoO4sWjACiJo0ffHoiUcNrU4tRxe7g2jVl3knvem0t+B8HCltJLvNjUb
lw00MBW0EtxtpEykS2MggeNSkTLMYw5dg9aQsUR5Mi3B74ar2rV+vTsGCbb1H3E=
=oA4C
-----END PGP SIGNATURE-----

Reply | Threaded
Open this post in threaded view
|

Re: Identifying Objects

Levente Uzonyi-2
In reply to this post by Tim Felgentreff
On Thu, 29 Mar 2012, Tim Felgentreff wrote:

> On 03/29/2012 04:12 AM, Robert Carleton wrote:
>> I have an application where I escalate alert instances up through an instance hierarchy. This is probably a FAQ, but I'd like to clearly identify the instances that generate these alerts. Is there some kind of message I can run on an instance, to retrieve an identifier, that can be stored in the alert?
>>
>> TIA,
>>
>> --Bruce
>>
>>
>
> Not sure what you mean, if the object id works for you, send #asOop
>
>

It's not a good idea to use #asOop in Squeak, since there is no unique and
immutable identifier of the objects. This method works great (except for
the case when #become: is being used) for smalltalks which use an object
table.
As others suggested, using the object itself (optionally wrapped in a
WeakArray) is the best solution.


Levente

Reply | Threaded
Open this post in threaded view
|

Re: Identifying Objects

Robert Bruce Carleton-4
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mar 30, 2012, at 5:33 AM, Levente Uzonyi wrote:

> On Thu, 29 Mar 2012, Tim Felgentreff wrote:
>
>> On 03/29/2012 04:12 AM, Robert Carleton wrote:
>>> I have an application where I escalate alert instances up through an instance hierarchy. This is probably a FAQ, but I'd like to clearly identify the instances that generate these alerts. Is there some kind of message I can run on an instance, to retrieve an identifier, that can be stored in the alert?
>>>
>>> TIA,
>>>
>>> --Bruce
>>>
>>>
>>
>> Not sure what you mean, if the object id works for you, send #asOop
>>
>>
>
> It's not a good idea to use #asOop in Squeak, since there is no unique and
> immutable identifier of the objects. This method works great (except for the case when #become: is being used) for smalltalks which use an object table.
> As others suggested, using the object itself (optionally wrapped in a WeakArray) is the best solution.
>
>
> Levente

Levente,

Thanks for your comments. I went with using a reference to the instance. That works for my application.

Best,

                        --Bruce

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iQEcBAEBAgAGBQJPdYc6AAoJEPy/5L3ndSQsvXsIAI3lE4jX/mwMP+O+yecD4e7F
TZAYZsojg41Actdw7dk02WUPTD9KoKFXWjnL062Oyou/F3nSnVQBcVjaKMwQ+aKq
cSZb88RQJlLD/PVVouKRJaAbpWXYowAQIlr6zqA/+n9D4r1/7JfqpcGysv5GAEwg
cXO3uFaEjWiP3zqn/CeZv6Imzy2hqrQKvzLUh3tUecVqQkb6QRehldCcge8JmrbS
eg91Gq7Sir0yGzpuoLUqhiwj8EMxSwWBsMdmH/7vzqXTWNtoHvAtScNw7e8+jJlQ
nGakxA4F3Inywu/K7FCHYNO9KODx0etld71qoYf3PXUUjYSlLAbCSXGrKleABHc=
=sMCs
-----END PGP SIGNATURE-----