Re: BUILD called twice.

[email protected] (Bill Moseley)
Newsgroups perl.moose
Message-ID <CAKhN_m7B6kC=mq5NXkyGAxWH6_fd+UcDT514d1MkkSdeMMU-0A@mail.gmail.com>
On Fri, Feb 15, 2013 at 7:35 AM, Jesse Luehrs <[email protected]> wrote:

>
> It could easily break things because first of all, it's a global change,
> which could break other code that isn't expecting it, and second of all,
> there's no way to guarantee that your code will continue to do the right
> thing, since a new release could easily add additional functionality
> into BUILD which your overridden version would no longer do (and this
> sort of thing would be quite difficult to track down). Can you perhaps
> override compose_namespace in your schema classes instead? Otherwise,
> again, I highly recommend you ask the Catalyst or DBIC communities for
> help in doing what you want, since they are much more likely to have
> useful solutions.
>

Ok, so it doesn't sound like it's a specific problem related to Moose,
which was what most were curious about.  But just a bad idea in general.
I certainly agree with the risks you enumerate above.

Yes, over the last few days I have asked both Catalyst and DBIC
communities.  #dbix-class response was essentially "No idea why the code is
like that.  Try the change it and report back."   Seems ok so far.

I couldn't get a clear understanding of compose_namespace so I was a
little hesitant to override in the schema class -- not sure what else might
call it.    If the code was in an init() instead of BUILD then overriding
init() would be the answer.


Thanks very much for the feedback,


-- 
Bill Moseley
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.