what is the Manager.manager and Manager.components used for?

7 views
Skip to first unread message

damantou

unread,
Sep 26, 2011, 9:34:59 AM9/26/11
to circuits
It seems the "manager" and "components" attributes only being used
during the component registeration.
What is the purpose to have these two attributes indeed?

James Mills

unread,
Sep 26, 2011, 4:22:56 PM9/26/11
to circuit...@googlegroups.com
.manager and .components are used to maintain
state and maintain the component structure of a system.

They are used by internal tools such as:

circuits.tools.graph(...)

Hope this helps!

cheers
James

James Mills / prologic

Developer | circuits, sahriswiki
E: prol...@shortcircuit.net.au
S: therealprologic




--
You received this message because you are subscribed to the Google Groups "circuits" group.
To post to this group, send email to circuit...@googlegroups.com.
To unsubscribe from this group, send email to circuits-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/circuits-users?hl=en.


Michael Lipp

unread,
Sep 26, 2011, 4:47:38 PM9/26/11
to circuits
Indeed I'd like to emphasize that it is important to have access to
the hierarchical structure of the components.

There is an interesting point about the combination of a component
framework and an event framework as provided by circuits. I admit that
I find myself using the component hierarchy in only a few cases. If
your component framework is not event based, hierarchy information is
important, because you often e.g. iterate over the child components or
climb up to the anchestors to find a specific component.

Having the events available, instead of searching for a specific
component in the tree (and invoking one of its methods), you simply
emit an event and hope that it hits the right component. But sometimes
there are still occations when I want to do something with all
(sub)components (of a specific type).

- Michael

On 26 Sep., 22:22, James Mills <prolo...@shortcircuit.net.au> wrote:
> .manager and .components are used to maintain
> state and maintain the component structure of a system.
>
> They are used by internal tools such as:
>
> circuits.tools.graph(...)
>
> Hope this helps!
>
> cheers
> James
>
> James Mills / prologic
>
> Developer | circuits, sahriswiki
> E: prolo...@shortcircuit.net.au

James Mills

unread,
Sep 27, 2011, 4:57:57 AM9/27/11
to circuit...@googlegroups.com
Current stable version of circuits doesn't take into account
the hierarchy of components -however- this has changed in
the most recent developments of circuits (circuits-dev branch).

cheers
James

James Mills / prologic

Developer | circuits, sahriswiki

damantou

unread,
Sep 27, 2011, 8:18:50 AM9/27/11
to circuits
Anyway, the current implementation of the component tree is a bit
vulnerable. It is quite easy to get a dead circle, like the following
case:

c1, c2, c3 = [Component() for i in range(3)]
c1.register(c2)
c2.register(c1)
c3.register(c1)


On Sep 27, 5:57 pm, James Mills <prolo...@shortcircuit.net.au> wrote:
> Current stable version of circuits doesn't take into account
> the hierarchy of components -however- this has changed in
> the most recent developments of circuits (circuits-dev branch).
>
> cheers
> James
>
> James Mills / prologic
>
> Developer | circuits, sahriswiki

James Mills

unread,
Sep 27, 2011, 4:31:22 PM9/27/11
to circuit...@googlegroups.com
This doesn't really pose a problem. You might get a few duplicated
events, but no event deadlock or loop.

cheers
James

Sent from my iPad

Reply all
Reply to author
Forward
0 new messages