--
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
To post to this group, send email to object-co...@googlegroups.com.
Visit this group at https://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.
Den 12. feb. 2018 kl. 09.08 skrev Vlad Lyga <lyv...@gmail.com>:Can i ask my original question again then, on a practical level when i try to write this program down:I've got Elephant class.ElephantA ... ElephantZ are objects instances of Elephant.
ElephantA ... ElephantZ are assigned to play TrainedElephant role in a ElephantCircleWalkStunt context.
Have CircleOfElephants role in ElephantCircleWalkStunt holding all the TrainedElephants.
Have ElephantTrainer role in ElephantCircleWalkStunt.When executing 'ElephantCircleWalkStunt.start()' - the ElephantTrainer arranges the TrainedElephants in the CircleOfElephants,and makes "CircleOfElephants.move()".This is important for me for two reasons:1) I'm trying to expose as much people to DCI as i can, organising meetups and demos, and holding discussions.Therefore its important for me to able to explain this stuff.2) I have my humble PyDCI helper library/framework that i use for demos to let peple start exploring DCI without up-front investment.And it's imperative that all the DCI core abilities would be supported. Right now i don't have ability to assign multiple role playersto the same role in the same context.
Never saw it necessary, but this article got me thinking so i want to make sure i get it.
On Monday, February 12, 2018 at 9:30:39 AM UTC+2, Cope wrote:For elephants to go in a circle, Elephant A would have to know how to follow Elephant B. Those are objects. Mix-ins work with classes. There is no notion of object identity.
> Right now i don't have ability to assign multiple role playersto the same role in the same context. Never saw it necessary, but this article got me thinking so i want to make sure i get it.
Do you mean assigning multiple role players to the same role (in the same context) at the same time? That would be confusing.
On the other hand, if you are asking about binding an object to a role, and then later (within the execution of that same context) binding a different object to that same role, that is used in the activity frontloading example - we call it role re-binding. But some of us are skeptical as to whether allowing the re-binding of roles is a good idea in the first place.
Have CircleOfElephants role in ElephantCircleWalkStunt holding all the TrainedElephants.That’s a bit strange, but: O.K. If you wrote the use case, would this role appear?
Have ElephantTrainer role in ElephantCircleWalkStunt.When executing 'ElephantCircleWalkStunt.start()' - the ElephantTrainer arranges the TrainedElephants in the CircleOfElephants,and makes "CircleOfElephants.move()".
Normally, you shouldn’t be able to do this. If you are in a restaurant and describing the behaviours adopted by the waiters so they don’t run into each other, then they need to play different roles: Waiter1, Waiter2, etc.. They can’t all do the same thing. But there is some finessing one can do, as mentioned above. It’s basically a syntactic shortcut. I don’t view it as part of the paradigm but as a convenience provided by the programming language.
Having ElephantTrainer orchestrate that all elephants walk in a circle is very different from one elephants being able to follow another elephant.
A trait describes an ability. So a trait could describe the abilities a fireman should have but it doesn’t provide a single specific object anything. A role is objected centric not class centric, so the fireman trait says that there are some people who could be firemen, the role says this person is a fireman
Den 13. feb. 2018 kl. 10.09 skrev Vlad Lyga <lyv...@gmail.com>:
Roles are also written as classes.
On Mon, Feb 12, 2018 at 3:08 AM, Vlad Lyga <lyv...@gmail.com> wrote:> Right now i don't have ability to assign multiple role playersto the same role in the same context. Never saw it necessary, but this article got me thinking so i want to make sure i get it.Do you mean assigning multiple role players to the same role (in the same context) at the same time? That would be confusing.
On the other hand, if you are asking about binding an object to a role, and then later (within the execution of that same context) binding a different object to that same role, that is used in the activity frontloading example - we call it role re-binding. But some of us are skeptical as to whether allowing the re-binding of roles is a good idea in the first place.
Den 13. feb. 2018 kl. 10.09 skrev Vlad Lyga <lyv...@gmail.com>:
So what is this 'grouping by behaviour' that is described in the paper, and how to achieve it in practice?
Den 13. feb. 2018 kl. 10.13 skrev Vlad Lyga <lyv...@gmail.com>:I think re-binding can be very useful in some cases, wouldn't discard it as of now.
Den 13. feb. 2018 kl. 10.52 skrev Vlad Lyga <lyv...@gmail.com>:You mean make binding atomic?Because the initial binding should already be atomic, so i can 're-bind' by redoing the initial binding with another role player.
3. CircleOfElephants role is a role for what Data instance? Array? I am not sure you need it.
4. ElephantTrainer role is a role for what Data instance?
--
You received this message because you are subscribed to a topic in the Google Groups "object-composition" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/object-composition/kWqvBOFGQLc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to object-composit...@googlegroups.com.
Den 19. feb. 2018 kl. 13.47 skrev Vlad Lyga <lyv...@gmail.com>:For example look here for Transcript = null in the Trygve borrow_library_panel2
Den 19. feb. 2018 kl. 14.32 skrev Matthew Browne <mbro...@gmail.com>:The trygve language is designed to prevent role methods from calling Context method. As I understand it, this is because after the initial invocation of the Context, all subsequent operations should happen via roles, according to the DCI paradigm (this also aligns with how use cases work).
But since the Context itself can play a role, it's possible to circumvent this.
Is that an acceptable loophole? What would be the use case for it?
Den 19. feb. 2018 kl. 14.45 skrev Vlad Lyga <lyv...@gmail.com>:And one of the things i have right now, is that in my case Roles can access their Contexts methods.
Den 19. feb. 2018 kl. 13.47 skrev Vlad Lyga <lyv...@gmail.com>:
For example look here for Transcript = null in the Trygve borrow_library_panel2
That is not "circumventing it,” unless by “it” you mean something at the Turing level of modeling computation. It is just proper trygve behaviour based on the facts that any instance (including a Context instance) can play a Role, and Role methods can invoke methods of other Roles in the same Context.
Is that an acceptable loophole? What would be the use case for it?
I often use this idiom if I find a Role that I think needs data (e.g., a method invocation counter). Those data can go in the Context and can be accessed with methods of a Role for which the Context is the Role-player.
Den 19. feb. 2018 kl. 16.19 skrev Vlad Lyga <lyv...@gmail.com>:No - that's just an unintended consequence of the implementation at this point.I'm personally not using it. But yes, the ability is there. For now.
It may be that another domain analysis would create a new class with some of the methods we currently find in the Role, and with some history state or current-color or current-font state, and that we would have an instance of that class play the Role. This example is less sophisticated, which is why null works.
One thing I’m carefully managing with trygve is whether to make it a tyrannical language or an anarchical language, or something in between. The problem with an anarchical language is that it will allow people to do non-OO things and to develop bad habits. The problems with a tyrannical language are 1. We are not yet sure we can formally prove that our way is the best, and 2. it dampens the purpose of the language as a research vehicle.A recent example arose, which is that trygve allows re-binding Roles to objects after they once have been bound under control of the Context constructor (usually in a helper method called rebind or something like that). Leaving this totally open was based on the fact that Trygve does it in some of his code (he assigns a different object to a Role for each iteration of a loop) so I thought it might not be a totally verboten idea. It’s not clear this was the right choice — but, of course, we can change it. We can probably enforce the binding of all Roles to be atomic. That is a separate issue from deciding whether Roles and bind-once identifiers, and whether all Roles can be assigned en masse within a given context. Again, re-assignment is allowed because Trygve does this. I avoid it by recurring on Context instantiation, as I believe recursion is cleaner.So I think carefully about leaving loose ends and frills in the language that could lead people to believe that DCI is something other than what it is. I’m not saying that should be your goal, but you might be conscious of whether that is or is not your goal.— Cope