develooper Front page | perl.moose | Postings from February 2015

Re: incomplete role consumption?

Thread Previous | Thread Next
From:
Daniel Hermann
Date:
February 26, 2015 17:59
Subject:
Re: incomplete role consumption?
Message ID:
54EF5ECA.8070405@1und1.de
Hi Ben,

On 02/26/2015 02:17 PM, Ben Tilly wrote:
> I would suggest that you don't need to use Node and VM in the Cluster
> class.  In order to use the Cluster class properly, someone will have
> to pass in Node and VM objects, but it is their responsibility to make
> sure that Node and VM are loaded.
>
> That won't work smoothly if the Cluster class offers convenience
> methods which generate Node and VM objects.  In that case you should
> put requires inside of those convenience methods.  That way you
> guarantee that those classes exist when you need them, and break the
> circular dependencies while loading.

That sounds doable. The functionality in the Cluster class dealing
with Node and Vm objects is small, so additional requires inside
the relevant methods are a good compromise.

thanks,
Daniel

--
Daniel Hermann

Operations Developer
1&1 Internet AG


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About