On Friday, 10 April 2015 17:23:19 UTC+3, Jonah S wrote:I am curious if DCI views itself as a solution to the expression problem:
http://c2.com/cgi/wiki?ExpressionProblem
or is this simply an orthoganal problem from those DCI solves? Perhaps one which is better solved at the language level, as mentioned in the link, via MultiMethods or similar.
Where do you guys locate the expression problem in your own conceptual understanding of design problems, OOP, and FP?
It seems to me that what is really going in is that we have a matrix, with "functions" on one side (imagine labels going down the y-axis) and "types" (or classes) on the other side (the column labels on the x-axis), and behaviors arising from the intersection of these two (cells of the matrix).
Fundamentally, when you add a new "function", a new "row" of behavior data must be calculated -- that is, the new behavior cannot be reduced to any of the existing behavior, it is truly "new". Same goes for a new "column" of data when we add a new type.
The expression problem then arises because the OOP primitive for conceptual grouping is the "column", so it performs well when we add a new column: It simply adds one more primitive. But it performs poorly when we add a new "row": The change ripples across every single one of the existing primitives. FP, whose conceptual primitive is the "row", has precisely the inverse qualities.
But in both cases isn't the real problem that the conceptual primitive is not small enough? The "world" of behavior is made up of the matrix cells, not of rows or columns...The more I studied DCI, the more I started to realize that decomposing systems into very small pieces that can be easily added/removed harms readability. It requires adding a a lot of machinery to make the code readable.But, regarding choosing the conceptual grouping - I'll base my choice based on a prediction in which dimension things will more likely grow. Or slice based on the dimension where things are more likely to change together. If it helps I'll use a custom dispatch/forwarding.For example, if I'm implementing that Shape for a drawing program - I would probably use the "OO" style - because I'm probably more likely to add new shapes that I can draw, rather than new operations on them. If I now need check collision of objects, I would make a separate thing that knows how to check collisions - instead of adding that operation to the "Shape"-s themselves. i.e. https://play.golang.org/p/jnZq3LrT2o (code is a bit messy there)...
Hey Egon,
Thanks for your thoughts. But doesn't your rhetorical question about the house, which implies choosing a "direction" is silly, contradict the advice from your first reply, which argues that it's harmful to readability (or would it be "livability" in the house metaphor :) ) to design a house broken up in both directions? As I read your argument, continuing the house metaphor, you were saying that your approach would be to determine the direction you were more likely to walk across the house most of the time, and divide the rooms in accord with that.
Regarding your concern about breaking things into overly small pieces, my understanding is that DCI frown upon that in so far as spreads what should be a single logical unit of system behavior (collaboration among objects) across a network of objects, obscuring that system behavior in the process. Hence the "error" is not breaking things down into small pieces per se, but shattering coherent units of logic into bits.
However, there is nothing wrong with small pieces when those pieces are the appropriate logical primitives.
--
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/d/optout.
--
Regarding your concern about breaking things into overly small pieces, my understanding is that DCI frown upon that in so far as spreads what should be a single logical unit of system behavior (collaboration among objects) across a network of objects, obscuring that system behavior in the process. Hence the "error" is not breaking things down into small pieces per se, but shattering coherent units of logic into bits. However, there is nothing wrong with small pieces when those pieces are the appropriate logical primitives. That's my understanding, anyway.
--
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.
Roles don't divide anything up, any more than words divide up a sentence. They merely express one perception of a named process that we often describe with words, which we have donned Roles.
I don't recall anyone, ever, on this list, or on any paper, extolling any intrinsic benefit either of role decompsition or of the aggregation of role methods into Roles. All the discussion from the jnjectionless crowd indeed points in the other direction and its mechanics too often become confused with the semantic model.
I'd love to see concrete counter examples of my claim above, if you know of any.
Each of these methodful object roles captures its part of the algorithm of transferring money from one account to another. Each method is a reasonably sized mental chunk of the overall algorithm. This chunking helps us understand the overall transfer in terms of its pieces, instead of overwhelming the reader with a single procedure that captures all the steps of the transfer. Yes, we use procedural decomposition here - or is it just a method invocation? The point is that the right logic is in the right place with respect to the roles that come from the end user mental model. The transfer logic doesn’t belong to any single account class.You're right, this doesn't extoll any intrinsic benefit of decomposition according to roles / role methods - the value comes from considering the roles (and their interactions) in their context. Here's a good quote from you about that:
More precisely, DCI is based more on a metaphor of "cue scripts" than that of a full script or play manuscript. Each role has its own set of instructions on how to act. The Context collectively has the information for the whole play because roles are encapsulated in the Context. But one still has to switch one's locus of attention from role to role to understand the whole, just as one switches attention from procedure to procedure to understand a procedurally-decomposed program. In DCI, the roles, rather than procedures alone, are the units of decomposition — and, in the other dimension, they provide a grouping of the clips of dialogue relevant to a role.(From https://groups.google.com/d/msg/object-composition/MjIHLMxuIJg/mjJY1SuaflUJ)
--On Friday, April 10, 2015 at 12:08:51 PM UTC-4, Jonah S wrote:--Regarding your concern about breaking things into overly small pieces, my understanding is that DCI frown upon that in so far as spreads what should be a single logical unit of system behavior (collaboration among objects) across a network of objects, obscuring that system behavior in the process. Hence the "error" is not breaking things down into small pieces per se, but shattering coherent units of logic into bits. However, there is nothing wrong with small pieces when those pieces are the appropriate logical primitives. That's my understanding, anyway.
Indeed, that's one of the reasons roles are so helpful...they divide system operations into easily comprehensible segments according to the mental model, but you can still see the whole operation in one place.* You could also organize behavior according to roles in FP without DCI, but you'd of course lose the notion of a role player. Perhaps that's why FP by itself doesn't solve the expression problem.
* Except in the case of nested contexts, which is why nested contexts should reflect different levels of abstraction rather than just being used to divide things up arbitrarily
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/d/optout.
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/N0RFIadUgt0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to object-composit...@googlegroups.com.
A Context containing nothing but a sea of disembodied "role" methods would certainly make the folks from the injectionless school happier.
There is an alternative view which one might call "object oriented" where Role actually do have a function. It relates to the cocretisation of identity. However I cannot yet reconcile it either with the way that injectionless implementations have been confounded with DCI semantics here or with some of the recent clarifications presented here on this list.
The fundamental horror of this anti-pattern is that it's so contrary to the basic idea of object-oriented design; which is to combine data and process together. The anemic domain model is really just a procedural style design, exactly the kind of thing that object bigots like me (and Eric) have been fighting since our early days in Smalltalk. What's worse, many people think that anemic objects are real objects, and thus completely miss the point of what object-oriented design is all about.http://www.martinfowler.com/bliki/AnemicDomainModel.html
Den søndag den 12. april 2015 skrev Jonah S <jona...@gmail.com>:
Cope,
Are you saying that the purpose of roles is solely to capture the mental model in code, and that any functional decomposition of the system operation due to the roles is purely incidental?
Assuming I'm hearing you right, couldn't you still say that the purpose of role (I'm speaking now of the conceptual role as it exists in life, with no reference to code) is to divide up our mental concepts in ways that are natural to us? That is, the mental models we are trying to encode implicitly have value because they slice up our world in ways we understand. From that perspective, it wouldn't be entirely wrong to say the decomposition in code imposed by those roles has intrinsic value? Or did I miss your point?
On Sunday, April 12, 2015 at 3:09:43 AM UTC-4, Cope wrote:
Roles don't divide anything up, any more than words divide up a sentence. They merely express one perception of a named process that we often describe with words, which we have donned Roles.
I don't recall anyone, ever, on this list, or on any paper, extolling any intrinsic benefit either of role decompsition or of the aggregation of role methods into Roles. All the discussion from the jnjectionless crowd indeed points in the other direction and its mechanics too often become confused with the semantic model.
I'd love to see concrete counter examples of my claim above, if you know of any.
Sendt fra min iPhone
On Friday, April 10, 2015 at 12:08:51 PM UTC-4, Jonah S wrote:--Regarding your concern about breaking things into overly small pieces, my understanding is that DCI frown upon that in so far as spreads what should be a single logical unit of system behavior (collaboration among objects) across a network of objects, obscuring that system behavior in the process. Hence the "error" is not breaking things down into small pieces per se, but shattering coherent units of logic into bits. However, there is nothing wrong with small pieces when those pieces are the appropriate logical primitives. That's my understanding, anyway.
Indeed, that's one of the reasons roles are so helpful...they divide system operations into easily comprehensible segments according to the mental model, but you can still see the whole operation in one place.* You could also organize behavior according to roles in FP without DCI, but you'd of course lose the notion of a role player. Perhaps that's why FP by itself doesn't solve the expression problem.
* Except in the case of nested contexts, which is why nested contexts should reflect different levels of abstraction rather than just being used to divide things up arbitrarily
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/d/optout.
--
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/d/optout.
--
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/N0RFIadUgt0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to object-composit...@googlegroups.com.
There is not, as far as I know, any statement of philosophical purpose to any part of DCI. We have argued that Roles derived from a mental model but the leverage from any such derivation has sorely been lacking in both our argumentation and implementations.
There is something both more dangerous and deep going on here than I originally feared. Consider again the Dijkstra implementation. It comprises a sea of so-called methods (really functions) that we arbitrarily group into Roles. Yet there are no rules for the grouping and no measures of coupling, cohesion, affinity, or any other kind of association that we think of as owing to Role-ness. Perhaps they precipitate from a volitive model but I am not yet convinced that the Role architecture actually aids the reader either in understanding a use case or in understanding the locus of a necessary change.
In fact the major structure of interest —which is the scenario — is hidden as it is woven into the use cases that hopelessly cut across the Role architecture.
What value — in any software engineering sense — is gained by the presence of role constructs in a context?
I am still sorting this out in my head and some of these questions are provocatively rhetorical. But for now Roles still retain a position of honor in capturing the important names we use for the objects in a use case and as such are a good part of design. They may not however, be a driver of the architectural partitioning or of any structural part of the system. And that was my main point. It makes me wonder if there is any value in including them in the code.
A Context containing nothing but a sea of disembodied "role" methods would certainly make the folks from the injectionless school happier.
There is an alternative view which one might call "object oriented" where Role actually do have a function. It relates to the cocretisation of identity. However I cannot yet reconcile it either with the way that injectionless implementations have been confounded with DCI semantics here or with some of the recent clarifications presented here on this list.
Cope,
Are you saying that the purpose of roles is solely to capture the mental model in code, and that any functional decomposition of the system operation due to the roles is purely incidental?
Assuming I'm hearing you right, couldn't you still say that the purpose of role (I'm speaking now of the conceptual role as it exists in life, with no reference to code) is to divide up our mental concepts in ways that are natural to us? That is, the mental models we are trying to encode implicitly have value because they slice up our world in ways we understand. From that perspective, it wouldn't be entirely wrong to say the decomposition in code imposed by those roles has intrinsic value? Or did I miss your point?
On Sunday, April 12, 2015 at 3:09:43 AM UTC-4, Cope wrote:
Roles don't divide anything up, any more than words divide up a sentence. They merely express one perception of a named process that we often describe with words, which we have donned Roles.
I don't recall anyone, ever, on this list, or on any paper, extolling any intrinsic benefit either of role decompsition or of the aggregation of role methods into Roles. All the discussion from the jnjectionless crowd indeed points in the other direction and its mechanics too often become confused with the semantic model.
I'd love to see concrete counter examples of my claim above, if you know of any.
Sendt fra min iPhone
On Friday, April 10, 2015 at 12:08:51 PM UTC-4, Jonah S wrote:--Regarding your concern about breaking things into overly small pieces, my understanding is that DCI frown upon that in so far as spreads what should be a single logical unit of system behavior (collaboration among objects) across a network of objects, obscuring that system behavior in the process. Hence the "error" is not breaking things down into small pieces per se, but shattering coherent units of logic into bits. However, there is nothing wrong with small pieces when those pieces are the appropriate logical primitives. That's my understanding, anyway.
Indeed, that's one of the reasons roles are so helpful...they divide system operations into easily comprehensible segments according to the mental model, but you can still see the whole operation in one place.* You could also organize behavior according to roles in FP without DCI, but you'd of course lose the notion of a role player. Perhaps that's why FP by itself doesn't solve the expression problem.
* Except in the case of nested contexts, which is why nested contexts should reflect different levels of abstraction rather than just being used to divide things up arbitrarily
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/d/optout.
--
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/d/optout.
--
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/N0RFIadUgt0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to object-composit...@googlegroups.com.
On 12 Apr 2015, at 17:37, Matthew Browne <mbro...@gmail.com> wrote:You raised an important point here that I didn't address in my last post...what if role boundaries are not the most fitting way to decompose a system operation?
Algorithmic versus Object-Oriented Decompositionhttp://www.drdobbs.com/windows/software-complexity-bringing-order-to-ch/199901062
Which is the right way to decompose a complex system—by algorithms or by objects? Actually, this is a trick question because the right answer is that both views are important: The algorithmic view highlights the ordering of events, and the object-oriented view emphasizes the agents that either cause action or are the subjects on which these operations act.
However, the fact remains that we cannot construct a complex system in both ways simultaneously, for they are completely orthogonal views. We must start decomposing a system either by algorithms or by objects and then use the resulting structure as the framework for expressing the other perspective.
Our experience leads us to apply the object-oriented view first because this approach is better at helping us organize the inherent complexity of software systems, just as it helped us to describe the organized complexity of complex systems as diverse as computers, plants, galaxies, and large social institutions. Object-oriented decomposition has a number of highly significant advantages over algorithmic decomposition. Object-oriented decomposition yields smaller systems through the reuse of common mechanisms, thus providing an important economy of expression. Object-oriented systems are also more resilient to change and thus better able to evolve over time because their design is based on stable intermediate forms. Indeed, object-oriented decomposition greatly reduces the risk of building complex software systems because they are designed to evolve incrementally from smaller systems in which we already have confidence. Furthermore, object-oriented decomposition directly addresses the inherent complexity of software by helping us make intelligent decisions regarding the separation of concerns in a large state space.
The algorithmic view highlights the ordering of events, and the object-oriented view emphasizes the agents that either cause action or are the subjects on which these operations act.DCI emphasizes objects and the flow of messages between them, but is less focused on the sequence of events. In one sense, DCI is very concerned with timing — it helps us better conceptualize/imagine future interactions — but I agree with Cope that we may have possibly hit upon a weakness of role-based decomposition here, even if it only turns out to be an issue in a relative minority of cases...