Hi Esteban,
just to clarify what your question is about:
You want to do certain operations after a PRCommand was executed,
right? So I wonder why you don't do them in the command's doExecute
method...
Now, in order to do stuff after executing the command, you added a
method like doPostExecute to PRCommand, and you hooked that into the
execution logic defined in PRCommand, right?
Your problem is that you execute a PRAddCommand and you want to tell
the new child somehow to bePersistent. And you don't know how to do
that except for going into PRAddCommand and changing methods there.
The more general question is: how do I access the new child that is
created by a PRAddCommand, after it is created.
Am I understanding the problem correctly?
Maybe you can use a subclass of PRAddCommand that overrides
#doValidate, or #validateChild:in: ?
BTW: as far as I understand Piers design, persistency is supposed to
be managed by the Pier kernel: PRCommand>>execute says self kernel
persistency execute: self.
Cheers
Matthias
On Mon, Aug 25, 2008 at 10:41 PM, Esteban Lorenzano <estebanlm(a)gmail.com> wrote:
Hi,
I'm using pier in a project who needs execute certain operations after
a command is executed (journal/persistence stuff) and I added a method
PRCommand, who is executed after doExecute... so... what is the
problem? well, I have to mark an object as "persistent", in
PRAddCommand, and then I do: self child bePersistent... but, as #child
answer a ew instance of #type, the operation is lost...
I changed #child to use an instVar and just instantiate once....
everything seems to be working now, but I want to know if there is a
possible problem with this change...
what do you think? the change works?
Thanks,
Esteban
_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki