Re: incomplete role consumption?

[email protected] (Daniel Hermann) Thu, 26 Feb 2015 18:58:34 +0100
Newsgroups perl.moose
Message-ID <[email protected]>
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