in reply to Abstract class under MooseX-Declare
I'm no expert but since no one already answered this I'll give it a try.
It seems to me that the problem you might encounter is that your protection will work fine for AbstractClass, but not for any abstract child of AstractClass. If you keep this in mind, it should work.
About a better way to do it, I don't know but I'm not sure it is a good idea to redefine "BUILD" for this kind of thing. What about just putting your exception in the constructor?
sub new { die "attempt to instanciate an abstract class" }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Abstract class under MooseX-Declare
by greengaroo (Hermit) on Aug 09, 2012 at 21:15 UTC |