after object create callback?

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

after object create callback?

sergio_101
hey, all..

i was wondering how to implement an 'after_create' callback in smalltalk..

the idea is, immediately after creating an object, some predefined
methods get called.

any ideas? thanks!


--
----
peace,
sergio
photographer, journalist, visionary

http://www.ThoseOptimizeGuys.com
http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101

Reply | Threaded
Open this post in threaded view
|

Re: after object create callback?

Guillermo Polito
Hi!

In Pharo, when an object is created, the #initialize message is sent to it automatically. You can create an #initialize method in your class and put whatever you want in it :).

BTW, I copy this question to the pharo_users mailing list, since it looks a more appropiate place for it.

Cheers,
GuilleĀ 

On Fri, Sep 7, 2012 at 3:29 PM, sergio_101 <[hidden email]> wrote:
hey, all..

i was wondering how to implement an 'after_create' callback in smalltalk..

the idea is, immediately after creating an object, some predefined
methods get called.

any ideas? thanks!


--
----
peace,
sergio
photographer, journalist, visionary

http://www.ThoseOptimizeGuys.com
http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101


Reply | Threaded
Open this post in threaded view
|

Re: after object create callback?

sergio_101
thanks, guille.. let me check to see if i am joined up there..

On Fri, Sep 7, 2012 at 9:44 AM, Guillermo Polito
<[hidden email]> wrote:

> Hi!
>
> In Pharo, when an object is created, the #initialize message is sent to it
> automatically. You can create an #initialize method in your class and put
> whatever you want in it :).
>
> BTW, I copy this question to the pharo_users mailing list, since it looks a
> more appropiate place for it.
>
> Cheers,
> Guille
>
>
> On Fri, Sep 7, 2012 at 3:29 PM, sergio_101 <[hidden email]> wrote:
>>
>> hey, all..
>>
>> i was wondering how to implement an 'after_create' callback in smalltalk..
>>
>> the idea is, immediately after creating an object, some predefined
>> methods get called.
>>
>> any ideas? thanks!
>>
>>
>> --
>> ----
>> peace,
>> sergio
>> photographer, journalist, visionary
>>
>> http://www.ThoseOptimizeGuys.com
>> http://www.CodingForHire.com
>> http://www.coffee-black.com
>> http://www.painlessfrugality.com
>> http://www.twitter.com/sergio_101
>> http://www.facebook.com/sergio101
>>
>



--
----
peace,
sergio
photographer, journalist, visionary

http://www.ThoseOptimizeGuys.com
http://www.CodingForHire.com
http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101