--
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 http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/groups/opt_out.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composition+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
Total aside, but if DCI was retitled: "Role-Playing Objects", it would take the geek world by storm.
While we are at it, I think "Context" would be better named "Algorithm" or "Use case" instead. Everytime I explain DCI to someone I have to explain that Context means Use case/Algorithm. But maybe there are rationales for this naming that gives other advantages.
Hmmm. �I like it.
On Jul 15, 2013, at 12:24 , Christopher �nd Shalan Galtenberg wrote:
Total aside, but if DCI was retitled: "Role-Playing Objects", it would take the geek world by storm.
I'm now off to play RPO for the afternoon.
On Saturday, July 13, 2013 8:53:28 AM UTC-7, Cope wrote:
The rule of thumb is that all roles are bound atomically (as a transaction, as it were).
The more-or-less "canonical DCI" provides that this binding happens once near Context initialization. However, for recursive algorithms, it's possible to re-bind all the roles in the middle of a Context lifetime. I would suggest that this be done carefully and only at that critical point in tail recursion where the snake just bites the tip of its tail :-) I think Trygve does this in his front-loading example. The alternative is to implement method recursion with instance recursion on the Context, which is my preferred technique (see the Dijkstra example), in which case role-to-object binding takes place exactly once per Context instantiation.
In your particular example, I would be sympathetic if the selection of the role-playing objects were a sequential operation with prescribed ordering. However, in theory, I could choose the amount, and the accounts, in any order � a modeless and largely stateless interface. That kind of behavior doesn't lend itself well to use cases, which are sequential. So I don't think it belongs in the Context. Where it belongs � well, your mileage may vary, but it would likely be in the Controller if I were to take a stab at an answer.
If you start introducing objects into the middle of a use case, you have to assign them to a role at that point and (here's the tricky bit) you have to ensure that the use case is written in a way that it is impossible to use that role name before the binding takes place. That lands you in Turing hell, and the code becomes unreadable (i.e., you cannot reason about the safety of the binding of any role � you've added one more failure mode to worry about). The policies we've put together in DCI make this consternation unnecessary. Good discipline comes with constraints.
On Jul 13, 2013, at 5:27 , Larry O'Brien wrote:
Is the Context typically constructed as immutable, with all its Role members passed in at once, or is it valid to add them over time? In MVC, I would think of the selection of, say, the Source bank account, the Sink bank account, and the amount as a series of View interactions, not a single calculation. After the selection of the Source but before the other interactions, would one typically store a reference to a `TransferSource` or to an (incomplete) `TransferContext` object?�
The bank transfer examples all seem to use an immutable Context, with the Role objects passed in during construction. This has the advantage that the `Run` function is guaranteed its preconditions. On the other hand, if the determination of the Role objects is complex, and the Context is not constructed until they are fully determined, it has the disadvantage of smearing that Model responsibility into the realm of the Controllers. If, though, the Context is mutable, the `Run` function necessarily begins to become a little more complex:
void�TransferContext�Run()
{
��������ValidatePreconditions();
��������Source.TransferTo(Sink,�Amount);
}��
private�void�ValidatePreconditions()
{
��������AssertNotNull(Source);
��������AssertNotNull(Sink);
��������AssertNotNull(Amount);}� ...etc...
And once the Context completes its `Run` / `DoIt` behavior, how are the results of that function propagated? If one is using an event-driven architecture, for instance, would one expect the `TransferContext.Run()` behavior to generate `TransferCompleted` and `TransferFailed` events? Or would one expect it to return a result to the Controller object and have the Controller propagate the results? (Which seems strange, since they are logically domain / Model events).�
--
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-composition+unsub...@googlegroups.com.
To post to this group, send email to object-co...@googlegroups.com.
Visit this group at http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/groups/opt_out.
�
�
--
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 http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/groups/opt_out.
�
�
--
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 http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/groups/opt_out.
�
�
... I could choose the amount, and the accounts, in any order — a modeless and largely stateless interface. That kind of behavior doesn't lend itself well to use cases, which are sequential. So I don't think it belongs in the Context. Where it belongs — well, your mileage may vary, but it would likely be in the Controller if I were to take a stab at an answer....
A valid Source Account and Destination Account have been identified and the amount to be transferred is known.
But "Role-Playing Objects" is very narrow, it may be better suited as a new name for the Interaction
I have been exploring another renaming:
true OO = static OO + dynamic OO.
but have scrapped the idea since DCI is getting pretty well known and I do not want to add confusion without an provable gain.
Hmmm. I like it.
On Jul 15, 2013, at 12:24 , Christopher ánd Shalan Galtenberg wrote:
Total aside, but if DCI was retitled: "Role-Playing Objects", it would take the geek world by storm.
I'm now off to play RPO for the afternoon.
On Saturday, July 13, 2013 8:53:28 AM UTC-7, Cope wrote:
The rule of thumb is that all roles are bound atomically (as a transaction, as it were).
The more-or-less "canonical DCI" provides that this binding happens once near Context initialization. However, for recursive algorithms, it's possible to re-bind all the roles in the middle of a Context lifetime. I would suggest that this be done carefully and only at that critical point in tail recursion where the snake just bites the tip of its tail :-) I think Trygve does this in his front-loading example. The alternative is to implement method recursion with instance recursion on the Context, which is my preferred technique (see the Dijkstra example), in which case role-to-object binding takes place exactly once per Context instantiation.
In your particular example, I would be sympathetic if the selection of the role-playing objects were a sequential operation with prescribed ordering. However, in theory, I could choose the amount, and the accounts, in any order — a modeless and largely stateless interface. That kind of behavior doesn't lend itself well to use cases, which are sequential. So I don't think it belongs in the Context. Where it belongs — well, your mileage may vary, but it would likely be in the Controller if I were to take a stab at an answer.
If you start introducing objects into the middle of a use case, you have to assign them to a role at that point and (here's the tricky bit) you have to ensure that the use case is written in a way that it is impossible to use that role name before the binding takes place. That lands you in Turing hell, and the code becomes unreadable (i.e., you cannot reason about the safety of the binding of any role — you've added one more failure mode to worry about). The policies we've put together in DCI make this consternation unnecessary. Good discipline comes with constraints.
On Jul 13, 2013, at 5:27 , Larry O'Brien wrote:
Is the Context typically constructed as immutable, with all its Role members passed in at once, or is it valid to add them over time? In MVC, I would think of the selection of, say, the Source bank account, the Sink bank account, and the amount as a series of View interactions, not a single calculation. After the selection of the Source but before the other interactions, would one typically store a reference to a `TransferSource` or to an (incomplete) `TransferContext` object?
The bank transfer examples all seem to use an immutable Context, with the Role objects passed in during construction. This has the advantage that the `Run` function is guaranteed its preconditions. On the other hand, if the determination of the Role objects is complex, and the Context is not constructed until they are fully determined, it has the disadvantage of smearing that Model responsibility into the realm of the Controllers. If, though, the Context is mutable, the `Run` function necessarily begins to become a little more complex:
void TransferContext Run()
{
ValidatePreconditions();
Source.TransferTo(Sink, Amount);
}
private void ValidatePreconditions()
{
AssertNotNull(Source);
AssertNotNull(Sink);
AssertNotNull(Amount);
} ...etc...
And once the Context completes its `Run` / `DoIt` behavior, how are the results of that function propagated? If one is using an event-driven architecture, for instance, would one expect the `TransferContext.Run()` behavior to generate `TransferCompleted` and `TransferFailed` events? Or would one expect it to return a result to the Controller object and have the Controller propagate the results? (Which seems strange, since they are logically domain / Model events).
--
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-composition+unsub...@googlegroups.com.
To post to this group, send email to object-co...@googlegroups.com.
Visit this group at http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/groups/opt_out.
--
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 http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/groups/opt_out.
--
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 http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/groups/opt_out.
--
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
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/N5D3eBCvZhE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to object-composit...@googlegroups.com.
--
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 http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Jim,
Thank you for your insightful reply.
> A good way to teach new paradigms is to approach the pedagogy without dependence on any prior knowledge.
> If you really want to immerse people in a paradigm shift, I'd go with Actors rather than DCI.
I was talking about teaching my coworker the basics of OOP, not DCI (yet).
Thanks for the suggestion of using Actors as a starting point. Do you mean this meaning of Actors:
http://en.m.wikipedia.org/wiki/Actor_model
Or something else?
So Marvin is a real object-oriented language but C# is not?
Thanks for the suggestion of using Actors as a starting point. Do you mean this meaning of Actors:
Is Marvin more OO than C#?
i suspect you have to qualify what programming language you are using to define 'class' since what you wrote in my mind doesn't hold true for Java, C#, etc.Of course not, since they are not really object oriented languages.
It might surprise you that, for me, that's a toss-up between C++ and other assembly languages. Objective-C drives me nuts with its surprises as do most other class-oriented languages.
--
I think are�very�clear distinction has to be made�in the name.�DCI is about how people think, and not really about programming. Variants of the concept that DCI describes has been used in other fields.I like the analogy, and I agree that being able to use a less than ideal object (a knife in this case) that is still is capable of doing the job (tightening the screw) is a great benefit of having roles as code constructs in their own right.
You�use a screwdriver�to�screw-drive�a�screw.
What Trygve R. is trying to teach us, is that, in practice(the real world), it's better to�have "the ability" of the screwdriver to screw-drive�modeled as a separate mental bucket (object).�Why?�Because if you don't have a screwdriver at hand and you have to get that loose screw tightened (Apollo mission, your life depends on it), you might use a knife that "fits" the peculiarities of that exact context and screw.
I think the greatest benefit is that in DCI, you no longer need to have a one-to-one mapping between roles and data objects
you can have multiple data objects that play the same role
On Jul 21, 2013, at 10:25 , Matthew Browne wrote:
I think the greatest benefit is that in DCI, you no longer need to have a one-to-one mapping between roles and data objects
Greatest benefit... over what?
you can have multiple data objects that play the same roleWell, not at the same time.
So "object-oriented programming language" is really a misnomer. But what I understood Trygve to mean was that the idiomatic style of programming to which Java, C#, and presumably C++ lend themselves, at least if one has learned any of those languages from the official literature, is not fully object-oriented.
My real question is about what programming languages are the most natural fit for OOP.
The same question could be asked about DCI (although since DCI is really just true OO, the answer is likely to be the same).
Define OOP, and we'll go from there. Do you take the Treaty of Orlando to be the definition? 'Cause that's what I use.
--
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/N5D3eBCvZhE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to object-composit...@googlegroups.com.
To post to this group, send email to object-co...@googlegroups.com.
Visit this group at http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/groups/opt_out.
�
�
On 2013.07.22 22:49, James O Coplien wrote:Treaty of Orlando object definition? Unfortunately, I have never seen it.
Define OOP, and we'll go from there. Do you take the Treaty of Orlando to be the definition? 'Cause that's what I use.
I googled "Treaty of Orlando" and ""Treaty of Orlando" object definition" and got an unbelievable number of dead links.
What I found had something to do with delegation and prototypes, but I did not find a definition of 'object'. It should be very interesting to see it.
I've been so deeply attached to my own notion of an object that I haven't realized it may be weird. The following is my most recent definition taken from a draft article::
Like a computer, a true object offers three basic capabilities that are essential for representing system state and system behavior:
storing, transforming, and communicating:
- Like a computer, the true object has memory called its attributes. Think of the object as a database record that is encapsulated within the object boundary.
- Like a computer, the true object can transform data with its methods. Think of them as local procedures that are only visible within the object.
- Like a computer, a true object can communicate with other objects by sending messages to them. Think of it as a universe of objects connected trough a communication bus.
- Like a computer, a true object has a unique and immutable identity that lets other objects address messages to it.
- Like a computer, a true object is encapsulated within an abstraction boundary. The object exhibits a message interface just as a computer exhibits an instruction repertoire. In both cases, the actual realization by software method or hardware is not visible outside the object’s encapsulation boundary. Different objects may employ different methods for the same message, this is called polymorphism and makes the distinction between message and method crucial for the understanding of an object system.
The following is my most recent definition taken from a draft article::
Like a computer, a true object offers three basic capabilities that are essential for representing system state and system behavior:
storing, transforming, and communicating
On 7/23/13 9:25 AM, Trygve Reenskaug wrote:
The following is my most recent definition taken from a draft article::I find it interesting that these are the same 3 properties that Carl Hewitt highlighted (except he used the word "processing" and not "transforming") in a video session with him I watched the other day after Jim recommended looking into Actors. Quote from the video:
Like a computer, a true object offers three basic capabilities that are essential for representing system state and system behavior:
storing, transforming, and communicating
"An Actor is the fundamental unit of computation which embodies the 3 things – processing, storage and communications – that are essential to computation."
http://channel9.msdn.com/Shows/Going+Deep/Hewitt-Meijer-and-Szyperski-The-Actor-Model-everything-you-wanted-to-know-but-were-afraid-to-ask
I'm glad Jim mentioned it; I hadn't heard of it either. Below is the link I found...yes, it does talk a lot about delegation and prototypes...the treaty begins on the third page:
http://web.media.mit.edu/~lieber/Lieberary/OOP/Treaty/Treaty.ps
Unless Jim is talking about something else that happened in Orlando at the same conference where the treaty was written, I think this falls short of a definition of OOP, but I do think it adds to the discussion.
On 7/23/13 9:25 AM, Trygve Reenskaug wrote:
On 2013.07.22 22:49, James O Coplien wrote:
Treaty of Orlando object definition? Unfortunately, I have never seen it.Define OOP, and we'll go from there. Do you take the Treaty of Orlando to be the definition? 'Cause that's what I use.
I googled "Treaty of Orlando" and ""Treaty of Orlando" object definition" and got an unbelievable number of dead links.
What I found had something to do with delegation and prototypes, but I did not find a definition of 'object'. It should be very interesting to see it.
I've been so deeply attached to my own notion of an object that I haven't realized it may be weird. The following is my most recent definition taken from a draft article::
Like a computer, a true object offers three basic capabilities that are essential for representing system state and system behavior:
storing, transforming, and communicating:
- Like a computer, the true object has memory called its attributes. Think of the object as a database record that is encapsulated within the object boundary.
- Like a computer, the true object can transform data with its methods. Think of them as local procedures that are only visible within the object.
- Like a computer, a true object can communicate with other objects by sending messages to them. Think of it as a universe of objects connected trough a communication bus.
- Like a computer, a true object has a unique and immutable identity that lets other objects address messages to it.
- Like a computer, a true object is encapsulated within an abstraction boundary. The object exhibits a message interface just as a computer exhibits an instruction repertoire. In both cases, the actual realization by software method or hardware is not visible outside the object’s encapsulation boundary. Different objects may employ different methods for the same message, this is called polymorphism and makes the distinction between message and method crucial for the understanding of an object system.
--
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/N5D3eBCvZhE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to object-composit...@googlegroups.com.
To post to this group, send email to object-co...@googlegroups.com.
Visit this group at http://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/groups/opt_out.
--
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.
�I find it reassuring.
When you talk to someone you infer meaning from his words and language right? When i say "Spin Motor" or "Spin Hand" no language writes the first Spin differently from second Spin to indicate the actual "spinning" is different in the case of the Motor or your Hand. There are similarities, but it's not the exact same thing. Similar enough = you write them the same way…. Too much difference = you should have chose completely different words.Reading it backwards (and extracting something useful for code) you can't infer the difference in the "Spin" action in "Spin Motor" and "Spin Hand" you are about to take unless you take into account the entire context the word is used in.But the context is invisible(hidden), "Spin Motor" and "Spin Hand" have the same structure "Spin + another word" and "Spin" is written the same way. The other word "Motor" or "Hand" couldn't possibly have anything to do with "Spinning" in general… when i say "Hand" you don't think of "Spin Hand" as the precise and only action you can do with your Hand. Also there are other ways to interact with a "Motor", there are motors that don't spin, actually.
In their effort to make code more readable, Trygve and Cope have actually brought Smalltalk closer to my free understanding of language. Bringing Context into play as a definite visible object, so now i have something that i can use as a "loci" (a place) for the different meaning(s) "Spin" can take on according to what i want to "Spin". The true genius of the idea is in fusing the normal "Object" (aka Data) with its meaning-pregnant Roles in that Context at runtime essentially mimicking the word "Spin" as it takes precise meaning only when used with another word (ex: "Spin Hand") what further clarifies what exactly we are talking about here.They essentially created what i expected all along, for code to mean something to me as a human being. Which is very valuable, if it weren't we would all be using Assembler or Byte Core directly.
ConclusionI used to have a word to describe this in my head, i've searched for it while writing this... "band" or "bound"
"Objects work together to achieve a common goal." should in the case of DCI be replaced withObjects band together to achieve a meaningful goal.Objects are bound together to achieve a meaningful goal.
"DCI limits all permissible networks of communicating objects to networks that share common topologies"Essentially the system is bound to have meaning (if any was put in by the programmer :)
Take this very nice music video for example: http://vimeo.com/33293128Why do the performers change instruments while the piece is played. Pretty good music would have come out if they kept their current ones. They do this to achieve a new role in the song… and therefore greater meaning. Now he plays the guitar and he takes care of the highs… the he switches to something else… he can reuse his talents.Essentially we can keep coding in classic OO Smalltalk because it's actually good enough. But DCI is just a whole different piece of cake, i might go as far as to say it might bring "coding to the masses".
Now, why would we choose the word "chef" for both? Because, as I said before, the activities involved are "conceptually similar". If there weren't any similarity, we probably wouldn't use the same word. I'm sure I could think of other examples of similar activities with the same name that are still different roles if this still isn't clear enough.
--
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/N5D3eBCvZhE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to object-composit...@googlegroups.com.
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.
--
If everyone is fine with these kind of discussions I'll just skim them through, no problem, but wouldn't some emerging resolution be nice, eventually? Sorry for my impatience. :)
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/N5D3eBCvZhE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to object-composit...@googlegroups.com.
I think you're right about the pattern of conversion between me and Cope.