--
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.
I am not sure Contexts are necessary objects/instances
Code in the Context perspective specifies runtime networks of interconnected objects
Code in the Context perspective specifies runtime networks of interconnected objects(Emphasis mine)
--
For example, many black boxes (objects) can play the role of Controller, but inside of this role, Controller is actually Context that has a script for Models and Views roles.
--
I don't understand. You said: "I am not sure Contexts are necessary objects/instances - this is just how it was chosen to implement contexts in specific languages" and I simply replied that by definition contexts are objects and a context can't be a role but it can be a roleplayer in a higher level context
To avoid confusion I would advice to using standard terminology. A role is played by a roleplayer. A context can be a roleplayer but not a role
On 26 Feb 2019, at 19.50, Oleh Novosad <oleh.n...@gmail.com> wrote:"can be a roleplayer in a higher level context"Yes, this is what I mean when I say that "context is role when looking from outside".
On 26 Feb 2019, at 20.03, Oleh Novosad <oleh.n...@gmail.com> wrote:Are you saying that I cannot assign Theatre role to other buildings?
Try restating this more precisely. “Assign” is not DCI-ese.
I think, my point is that Theatre is Context for humans/instances to play Dancer role.But at the same time Theatre is Role for buildings to play Theatre.
--
I would argue that the context isn’t the Theater building but that there’s a play-context that has several roles and that play-context plays a play role in the Theater context where “my house” (or another more suitable building) plays the role of venue
On 27 Feb 2019, at 00.06, Oleh Novosad <oleh.n...@gmail.com> wrote:Is there a way I can help you to understand what I am trying to say?
I would argue that the context isn’t the Theater building but that there’s a play-context that has several roles and that play-context plays a play role in the Theater context where “my house” (or another more suitable building) plays the role of venue
Is there a way I can help you to understand what I am trying to say?
context PlayContext {the point seems to be that a Context can play a role in another Context.
role CLAUDIUS {} // played by a human actor
role HAMLET {} // played by a human actor
...
}
context TheatreContext {
role VENUE {} // played by some building such as "my house"
role PERFORMANCE {} // played by an instance of PlayContext
...
}
I would argue that the context isn’t the Theater building but that there’s a play-context that has several roles and that play-context plays a play role in the Theater context where “my house” (or another more suitable building) plays the role of venue
############################################################################### This example shows pretty normal way of doint things
# Role definitionrole DANCER # dance method def dance() #... end end
context Theater # play show in theatre def play_show(dancer as DANCER) dancer.dance() end end
# Create human instance/objectbob = Human.new
# Create Theatre instance, check if bob can play DANCER role and pass it to play_show() script,
# execute play_show() scriptTheather.new.play_show(bob as DANCER)
############################################################################### This example shows how context could be not an object, # everything else is pretty standard
# Role definitionrole DANCER # dance method def dance() #... end end
context Theater # static/class method of Theather context def self.play_show(dancer as DANCER) dancer.dance() end end
# create human instancebob = Human.new
# here we call static/class method of TheatreTheather.play_show(bob as DANCER)
############################################################################### This example shows how previously Theatre context could be transformed into role
# Role definitionrole DANCER # dance method def dance() #... end end
role THEATHER # play show in theatre def play_show(dancer as DANCER) dancer.dance() end end
# create human instancebob = Human.new # create building instancebuilding = Building.new
(building as THEATHER).play_show(bob as DANCER)
############################################################################### Same as above but dancer being "inside" of building
# Role definitionrole DANCER # dance method def dance() #... end end
role THEATHER dancer as DANCER
# play show in theatre def play_show() dancer.dance() end end
# create human instancebob = Human.new # create building instancebuilding = Building.new(dancer: bob)
# budiling plays theatre role and execute show(building as THEATHER).play_show()
--
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.
The essence of object orientation is
that objects collaborate to achieve a
goal.
Trygve Reenskaug mailto: try...@ifi.uio.no
Morgedalsvn.
5A http://folk.uio.no/trygver/
N-0378
Oslo http://fullOO.info
Norway Tel:
(+47) 22 49 57 27
the point seems to be that a Context can play a role in another Context.
the point seems to be that a Context can play a role in another Context.I think the opposite is also true, Role is Context for other Roles.
On 28 Feb 2019, at 19.24, Oleh Novosad <oleh.n...@gmail.com> wrote:I think the opposite is also true, Role is Context for other Roles.
On 28 Feb 2019, at 19.50, Oleh Novosad <oleh.n...@gmail.com> wrote:If Context can be Role it means Role is Context for what was inside of that Context. So it is just a logical conclusion that "Role is Context for other Roles".
I think you get too much into the language debate.In DCI:- Every object can play a Role in a Context- Context is an object so it can PLAY a Role in a Context (even within itself)Your theory does not make sense:You said:- a Context can play a role in another Context --> Yes- If Context can be Role it means Role is Context for what was inside of that Context --> does not make sense hereTo PLAY is not TO BE- So there is not such thing Context is Role and Role is Context.... --> this just has gone too far in the land of language mystery :)
Contexts can play Roles. Contexts are not Roles.