in reply to Re^6: a State machine with Roles - possible? (class or instance)
in thread a State machine with Roles - possible?
Let's say I want to model a house with 100 doors.
The Ruby code allows to call 100 times new() from class "Door" to create 100 door objects with independent states, because the methods of the mixins belong to the objects.
The shown Moose code OTOH needs 100 packages achieve this, cause all objects of such a package share the same roles. This doesn't sound very handy or scalable.
And I couldn't see any code to generate such classes, hence we have to manually name them Door1, Door2, ...Door100.
Plz correct me if I'm wrong.
Cheers Rolf
( addicted to the Perl Programming Language)
oops, I just realized that you already explained the mechanism behind apply_all_roles further up this thread. Sorry, I wasn't aware we are talking about the same approach.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: a State machine with Roles - possible? (class or instance)
by mascip (Pilgrim) on May 31, 2013 at 16:41 UTC | |
by LanX (Saint) on May 31, 2013 at 19:40 UTC | |
by mascip (Pilgrim) on Jun 01, 2013 at 10:15 UTC | |
by LanX (Saint) on Jun 01, 2013 at 10:36 UTC | |
by mascip (Pilgrim) on Jun 01, 2013 at 11:13 UTC |