in reply to Moose and BUILD and 'ro' attributes
Thank You for pointing out at Moose::Manual::Construction, which is not about Moose construction, but constructing objects in Moose. I should not have ignored that :-(
In short, the problem is I read Log4Perl initialization from a file, for two logfiles, one technical log and one specialized log changing over the time. To create the second one on-the-fly I use the patterns from the config to create a layout class and an appender, which is later used to generate the second logfile. The reason for this is that File-Appenders create the files on construction, but I do not have a filename at that time. So I gather and create all things I need at the beginning to use them when I first have a logfilename. Later I can use file_switch() on the appender but that is Log4Perl. Expensive? I really do not know. My philosophy/religion is that constant things should be initialized at the beginning, when they are used more than once.
I think You are right, I might solve this by reordering my builders and revisting the examples.
Thank You again for Your patience
And it came to pass that in time the Great God Om spake unto Brutha, the Chosen One: "Psst!"
(Terry Pratchett, Small Gods)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Moose and BUILD and 'ro' attributes
by tospo (Hermit) on Dec 15, 2010 at 11:39 UTC |