You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by Zaid Mohsin <za...@cloudsoftcorp.com> on 2014/09/29 15:31:12 UTC

First member entity reference

Hi Dev,
I’ve been using the new attributes in DynamicCluster that reference the first member entity and sets a boolean attribute (cluster.first) on each group member to indicate if that is the first member of the cluster. I think it would be more useful to add an additional attribute that references the first node to the other non-first members (non-first has attribute of type Entity that references the first member). Is that feasible? Bad or good design?

Currently to access the first node attributes I’m doing this:

entity.getAttribute(DynamicCluster.CLUSTER).getAttribute(DynamicCluster.FIRST).getAttribute(MY_ATTRIBUTE);

where if we include the first entity reference it would look something like this

entity.getAttribute(DynamicCluster.FIRST).getAttribute(MY_ATTRIBUTE);

Regards

Re: First member entity reference

Posted by Andrew Kennedy <an...@cloudsoftcorp.com>.
Zaid,

Yes, there's no reason that the FIRST entity attribute couldn't be set
on the cluster children as well. It would save a level of indirection,
and we can always keep the atrribute on the cluster as well. If nobody
objects, I'll change it.

Andrew.
--
-- andrew kennedy ? cloud engineer : http://blog.abstractvisitorpattern.co.uk/ ;


On 29 September 2014 14:31, Zaid Mohsin <za...@cloudsoftcorp.com> wrote:
> Hi Dev,
> I’ve been using the new attributes in DynamicCluster that reference the first member entity and sets a boolean attribute (cluster.first) on each group member to indicate if that is the first member of the cluster. I think it would be more useful to add an additional attribute that references the first node to the other non-first members (non-first has attribute of type Entity that references the first member). Is that feasible? Bad or good design?
>
> Currently to access the first node attributes I’m doing this:
>
> entity.getAttribute(DynamicCluster.CLUSTER).getAttribute(DynamicCluster.FIRST).getAttribute(MY_ATTRIBUTE);
>
> where if we include the first entity reference it would look something like this
>
> entity.getAttribute(DynamicCluster.FIRST).getAttribute(MY_ATTRIBUTE);
>
> Regards