[PR] #doInitialize

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

[PR] #doInitialize

Damien Cassou-3
In PRCommand, there is no more #doInitialize method. I've read the
Monticello comment, but don't understand why you remove it.

--
Damien Cassou

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
_______________________________________________
Smallwiki mailing list
[hidden email]
http://impara.de/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: [PR] #doInitialize

Lukas Renggli-2
Hi Damien,

sorry for the slow answer ...

> In PRCommand, there is no more #doInitialize method. I've read the  
> Monticello comment, but don't understand why you remove it.

there are several reasons, but mainly this is a speed optimization:  
commands are often instantiated to check permissions and query  
availability, without actually requiring them fully initialized.

Using lazy-initialization ensures that we don't have to fully  
initialize them if not required. Moreover it is easier to load  
objects from different (older) sources and the initialization always  
happens in the right (natural) order. This is especially useful if  
the class evolves or we have class-extensions within the command.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch



_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
_______________________________________________
Smallwiki mailing list
[hidden email]
http://impara.de/mailman/listinfo/smallwiki