def log(message) puts('Transaction log: ' + message.to_s) end
Account = Struct.new(:name, :balance) do
alias_method :to_s, :name
end
Transfer = Struct.new(:amount, :source, :destination) do
def execute
raise "Insufficient Funds" unless source.balance >= amount
source.balance -= amount
destination.balance += amount
end
end
source = Account.new('checking', 100)
destination = Account.new('savings', 0)
log("#{source} has #{source.balance}")
log("#{destination} has #{destination.balance}")
log("Transferring 30")
Transfer.new(30, source, destination).execute
log("#{source} has #{source.balance}")
log("#{destination} has #{destination.balance}")
Hi Jonah, I think this FAQ question does a good job answering your question: http://fulloo.info/doku.php?id=what_is_the_advantage_of_distributing_the_interaction_algorithm_in_the_rolemethods_as_suggested_by_dci_instead_of_centralizing_it_in_a_context_method
With no RoleMethods, things become overly procedural, centralized, and the mental model is lost in programmer concepts.
/Andreas
--
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.
On 12/7/14 6:56 AM, Hai Quang Kim wrote:
I don't think this is even close to 90% of DCI - the OO concepts are arguably the most important part. And don't forget that there's OO in the data model too - "what the system does" is only half the system in the first place (the other half is "what the system is").In that sense, Context is a meta instruction/system operation that can recursively use sub-instruction/sub-operation.So we just need to put Role Objects in, it all depends on how the programmer implements that Context.The result is important.
That is about 90% of DCI, a network of OO or a set of functions run on that set of Role Object is less important to me.
Yes, taking some inspiration from DCI and keeping use case logic together is great and is something I try to do when working on non-DCI projects. But it's important to be clear that it's not DCI. Even calling it a substitute for DCI would be a stretch - better to call it what it is: a mix of procedural programming (for the use cases) and object-oriented programming (for the data model). Cope mentioned his book on multi-paradigm design, and we have also previously discussed Ant's concept of "micro SOA" on this list. I think such approaches offer big advantages over traditional OO for projects with significant use case logic. But DCI has advantages that go beyond that, as is hopefully becoming clearer as you explore it further...In many examples, to have a few lines of readable DCI, the cost now I need to pay is to type many Role Classes, maintain Stack of Contexts....In a few cases I even need to change the compiler to make it work.Can we at least encourage people to scale down DCI to DCA so that they start to have the benefit of DC_A/I?And no need to wait until we can convince all of the programming language authors to provide us an official way to do pure DCI.
Another thing I have noticed when working with the absence of roles is that often there's behavior that's tied to a particular object, but it's only needed in a particular context (or maybe two contexts), so I find myself not wanting to put it into the domain class because those get messy if they have too many methods, and also it might need to interact with other objects specific to a context. But if I just put it as a method in the service class (or whatever you're using to encapsulate the use case), there's no good sub-grouping for the roles.One from Rune:
> Den 10/12/2014 kl. 15.09 skrev Hai Quang Kim <wan...@gmail.com>:Finally, here's a quote from Lean Architecture:
>
> I am trying to challenge the need of OOP in Context to see what I am going to loose if I simplify that. What I am going to win is: no trait, no Context stack, and the easy of applying DCI in any programming language.
The ability to express several mental models through the use of compression and composition and through that you'll loose the ability of communicating with stockholders in terms of their mental model of the system and because of that you'll loose validation opportunity which will impact quality and/or cost
(Talking about larger complex systems here, if simple or small for all sake you could use assembles with no loss) :)
Why not Put the Algorithm into a Procedure, and Combine the Procedural Paradigm with the Object Paradigm in a Single Program?Coplien, James O.; Bjørnvig, Gertrud (2011-01-06). Lean Architecture: for Agile Software Development (p. 296). Wiley. Kindle Edition.
This is the old C++ approach and in fact is the approach advocated in Multi-paradigm design for C++ (Coplien 1998). The main problem with this approach is that it doesn’t express relationships between related algorithms, or between related algorithm fragments, that exist in the end user’s head. It obfuscates the role structure. These algorithms are not single closed copies of procedural code, but they play out through object roles.
A scenario that runs through objects frequently needs intimate knowledge about those objects. A closed procedure can access the internals of an object only through its public interface. If we put the use case scenarios in closed procedures, it would cause the interfaces of the objects to bloat to support this close relationship between the use case and the objects. By instead injecting the procedure (bit by bit) into the objects, we allow the code of the algorithms to gain access to object internals (such as domain object private methods) if needed. We need to add new interfaces to domain objects only for business-level functionality that is germane to the use case, rather than adding low-level access methods needed by the use case.
Does this mean that procedural design is completely dead? Of course not. There are still algorithms that are just algorithms (Freud’s “sometimes a cigar is just a cigar”). We can encapsulate algorithms in the private implementation of classes using procedural decomposition. There’s nothing wrong with that. However, those concerns are rarely architectural concerns; we leave those to the cleverness of designers and architects as they come to low-level design and the craftsmanship of implementation.
Hi Jonah,
You can get a lot of the benefits of DCI from doing what you described, but there are important differences and unique advantages of DCI. These benefits are not that obvious in simple examples like the money transfer, but become more apparent with larger use cases (...one of the reasons we need more larger examples).
That's a good FAQ entry that Andreas pointed to. We have also discussed this question quite a bit on this list, although the relevant posts are a bit buried...
Here's the most recent thread where we discussed this (quoting from myself):
https://groups.google.com/d/msg/object-composition/pzwEHIZGPis/0vJUz9FtntAJ
On 12/7/14 6:56 AM, Hai Quang Kim wrote:
I don't think this is even close to 90% of DCI - the OO concepts are arguably the most important part. And don't forget that there's OO in the data model too - "what the system does" is only half the system in the first place (the other half is "what the system is").In that sense, Context is a meta instruction/system operation that can recursively use sub-instruction/sub-operation.So we just need to put Role Objects in, it all depends on how the programmer implements that Context.The result is important.
That is about 90% of DCI, a network of OO or a set of functions run on that set of Role Object is less important to me.
Yes, taking some inspiration from DCI and keeping use case logic together is great and is something I try to do when working on non-DCI projects. But it's important to be clear that it's not DCI. Even calling it a substitute for DCI would be a stretch - better to call it what it is: a mix of procedural programming (for the use cases) and object-oriented programming (for the data model). Cope mentioned his book on multi-paradigm design, and we have also previously discussed Ant's concept of "micro SOA" on this list. I think such approaches offer big advantages over traditional OO for projects with significant use case logic. But DCI has advantages that go beyond that, as is hopefully becoming clearer as you explore it further...In many examples, to have a few lines of readable DCI, the cost now I need to pay is to type many Role Classes, maintain Stack of Contexts....In a few cases I even need to change the compiler to make it work.Can we at least encourage people to scale down DCI to DCA so that they start to have the benefit of DC_A/I?And no need to wait until we can convince all of the programming language authors to provide us an official way to do pure DCI.Another thing I have noticed when working with the absence of roles is that often there's behavior that's tied to a particular object, but it's only needed in a particular context (or maybe two contexts), so I find myself not wanting to put it into the domain class because those get messy if they have too many methods, and also it might need to interact with other objects specific to a context. But if I just put it as a method in the service class (or whatever you're using to encapsulate the use case), there's no good sub-grouping for the roles.One from Rune:
To unsubscribe from this group and stop receiving emails from it, send an email to object-composition+unsub...@googlegroups.com.
Specifically, I'm having trouble coming up with an example for role's accessing object's private methods as described in the passage below.
Den 03/01/2016 kl. 19.05 skrev Jonah S <jona...@gmail.com>:What's a good example of an appropriate time to do this, versus a time when it's clearly not ideal?
The code for balancing a balanced B-tree or binary tree would be in a private method, rather than in another class or object. It is not of business concern. It’s commodity code.
The code to print a B-tree to output is perhaps a good candidate for a DCI context. It is not commodity code; it has substantial variations in formatting that could be factored into Role-players, and it may be generalised to work with other kinds of trees and a variety of output media.
Den 03/01/2016 kl. 21.05 skrev Jonah S <jona...@gmail.com>:That makes sense, it certainly feels different and I would naturally do what you're suggesting. If we're going to define the difference between "business concern" and "commodity code", is it just a matter of rates of change?
The algorithm for balancing binary trees is highly stable, whereas the various ways and reasons we might have to print them are relatively volatile?The code to print a B-tree to output is perhaps a good candidate for a DCI context. It is not commodity code; it has substantial variations in formatting that could be factored into Role-players, and it may be generalised to work with other kinds of trees and a variety of output media.So the context might be "BTreePrinting." I could see initializing this context with formatting options (print the tree downwards, sideways, with rounded or right-angled branches, etc). What would be examples of the role players?
And, within these roles, can you think of an example that shows the advantage of role injection over an "injectionless" approach?
regardless, i am asking for a non trivial example where DCI role binding is clearly superior to fake DCI or procedural or whatever you want to call it. this should be really, really easy for anyone claiming to fully understand DCI. it should take 10-15 minutes to do. yet here we are deep into another thread on this subject and it has yet to be done.
> To unsubscribe from this group and stop receiving emails from it, send an email to object-composition+unsub...@googlegroups.com.
> Perhaps if you gave an example that clearly demonstrates why OO is better than Algol-68 style programming, we’d have a concrete example to follow.Absolutely. First, let's clarify: I didn't ask you or anyone else to explain DCI in 15 minutes. I asked for code a sample that showed how using DCI role binding improved a "fake DCI" approach that used data objects and contexts without role binding. That is, a short (but nontrivial) example, with "before" code and "after" code. And (optionally) some explanation about the benefits of the "after" code.
Let's take a simpler example from OO (using Go as the language)
Hi Egan,
Let's take a simpler example from OO (using Go as the language)
It's a little off the thread topic, but I thought your statement misleading.
Does the fact that Go (Golang) as a language supports the implicit passing of an instance of a struct (or a type or a function) to a method make Go Object Oriented? Just because something (A) uses or exhibits a characteristic of something else (B), is A a B?
Just on Go...
Go's inclusion of interfaces as a first class concept directly supports differing sets of behavior acting on data. Sounds like a role?
Food for thought... look to work with interfaces not structs in Go. Rather than instantiate a new struct directly, consider creating a "new" method that returns an interface. In that way, one could argue your programming against a "role" that encapsulates it's data. Unless you do this, the encapsulation boundary in Go is the "package".
I agree that 90% of the difficulty of programming is the thinking part, and preventing your natural way of thinking from getting overwhelmed by implementation details.
> It depends what you mean — “injectionless” probably tends to mean something on this mailing list, other than what you mean...
I mean simply: no dynamic role binding on the data objects inside the context. Instead, the context itself has (mostly private) methods that work directly with the data objects public interface. These do the work that role methods do in "true" DCI. Others have called this fake DCI.
Oops, no....but I do intend to send this one to the list to clear things up...I guess you didn't intend to send that message to the list :)
--
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.
Matthew,
Thanks for taking the time to dig up the relevant discussions. I greatly appreciate it.
Andreas,
Thanks for the wiki link, too.
Some followup questions:
After reading the wiki link, I think to "tldr" answer to my original question about the value of runtime role methods is simply: "the same value OO has in the first place, to avoid top-down, all-knowing procedural code." Which makes sense. But I'm still struggling to find good examples, and to locate the kinds of exceptions trygve mentions at the end.
Here's something specific:
Consider this role-based version of the transfer example from Jim's excellent casting library, in ruby: https://github.com/saturnflyer/casting/blob/master/examples/delegation_dci.rb. I actually find the decomposition into roles unnatural in this case: asking the destination to increase its balance, and letting the destination be responsible for decreasing the balance of the source. My natural mental model in this case is top-down procedural. If I were explaining it to a child, I'd say, "First you take money out of this one, and then you move the money over to this one." Granted, maybe that only feels natural and easy because the algorithm is so simple....
Even more intriguing to me is the Lean Architecture passage Matthew quoted. That feels, hazily, to have the answer I'm looking for, but I just can't fully grasp it without a specific example.
> A scenario that runs through objects frequently needs intimate knowledge> about those objects. A closed procedure can access the internals of an object> only through its public interface. If we put the use case scenarios in closed> procedures, it would cause the interfaces of the objects to bloat to support> this close relationship between the use case and the objects. By instead> injecting the procedure (bit by bit) into the objects, we allow the code of> the algorithms to gain access to object internals (such as domain object> private methods) if needed. We need to add new interfaces to domain objects> only for business-level functionality that is germane to the use case, rather> than adding low-level access methods needed by the use case.
Specifically, I'm having trouble coming up with an example for role's accessing object's private methods as described in the passage below. If the objects are dumb data, what private methods are we talking about? And perhaps more significantly, is this just a matter of source file level separation of the "data object" methods and "role" methods? That is, if the role's have full access to the internals, isn't the coupling the same as the case where we have data objects bloated with use case methods (classic 1000 line Rails AR class), except with the advantage that the use case methods are now together in their own file? More importantly, if the roles do depend on the private methods of the data objects, don't those private methods just become part of a de facto public interface?
I feel I must still be missing something... I need that concrete example.
> Does this mean that procedural design is completely dead? Of course not. There> are still algorithms that are just algorithms (Freud’s “sometimes a cigar is> just a cigar”). We can encapsulate algorithms in the private implementation of> classes using procedural decomposition. There’s nothing wrong with that.> However, those concerns are rarely architectural concerns; we leave those to> the cleverness of designers and architects as they come to low-level design and> the craftsmanship of implementation.
What's a good example of an appropriate time to do this, versus a time when it's clearly not ideal?
On Sunday, January 3, 2016 at 9:03:47 AM UTC-6, Matthew Browne wrote:Hi Jonah,
You can get a lot of the benefits of DCI from doing what you described, but there are important differences and unique advantages of DCI. These benefits are not that obvious in simple examples like the money transfer, but become more apparent with larger use cases (...one of the reasons we need more larger examples).
That's a good FAQ entry that Andreas pointed to. We have also discussed this question quite a bit on this list, although the relevant posts are a bit buried...
Here's the most recent thread where we discussed this (quoting from myself):
https://groups.google.com/d/msg/object-composition/pzwEHIZGPis/0vJUz9FtntAJ
On 12/7/14 6:56 AM, Hai Quang Kim wrote:
I don't think this is even close to 90% of DCI - the OO concepts are arguably the most important part. And don't forget that there's OO in the data model too - "what the system does" is only half the system in the first place (the other half is "what the system is").In that sense, Context is a meta instruction/system operation that can recursively use sub-instruction/sub-operation.So we just need to put Role Objects in, it all depends on how the programmer implements that Context.The result is important.
That is about 90% of DCI, a network of OO or a set of functions run on that set of Role Object is less important to me.
Yes, taking some inspiration from DCI and keeping use case logic together is great and is something I try to do when working on non-DCI projects. But it's important to be clear that it's not DCI. Even calling it a substitute for DCI would be a stretch - better to call it what it is: a mix of procedural programming (for the use cases) and object-oriented programming (for the data model). Cope mentioned his book on multi-paradigm design, and we have also previously discussed Ant's concept of "micro SOA" on this list. I think such approaches offer big advantages over traditional OO for projects with significant use case logic. But DCI has advantages that go beyond that, as is hopefully becoming clearer as you explore it further...In many examples, to have a few lines of readable DCI, the cost now I need to pay is to type many Role Classes, maintain Stack of Contexts....In a few cases I even need to change the compiler to make it work.Can we at least encourage people to scale down DCI to DCA so that they start to have the benefit of DC_A/I?And no need to wait until we can convince all of the programming language authors to provide us an official way to do pure DCI.Another thing I have noticed when working with the absence of roles is that often there's behavior that's tied to a particular object, but it's only needed in a particular context (or maybe two contexts), so I find myself not wanting to put it into the domain class because those get messy if they have too many methods, and also it might need to interact with other objects specific to a context. But if I just put it as a method in the service class (or whatever you're using to encapsulate the use case), there's no good sub-grouping for the roles.One from Rune:
On Wed, Dec 10, 2014 at 9:19 AM, Rune Funch Søltoft <funch...@gmail.com> wrote:
> Den 10/12/2014 kl. 15.09 skrev Hai Quang Kim <wan...@gmail.com>:Finally, here's a quote from Lean Architecture:
>
> I am trying to challenge the need of OOP in Context to see what I am going to loose if I simplify that. What I am going to win is: no trait, no Context stack, and the easy of applying DCI in any programming language.
The ability to express several mental models through the use of compression and composition and through that you'll loose the ability of communicating with stockholders in terms of their mental model of the system and because of that you'll loose validation opportunity which will impact quality and/or cost
(Talking about larger complex systems here, if simple or small for all sake you could use assembles with no loss) :)
Why not Put the Algorithm into a Procedure, and Combine the Procedural Paradigm with the Object Paradigm in a Single Program?Coplien, James O.; Bjørnvig, Gertrud (2011-01-06). Lean Architecture: for Agile Software Development (p. 296). Wiley. Kindle Edition.
This is the old C++ approach and in fact is the approach advocated in Multi-paradigm design for C++ (Coplien 1998). The main problem with this approach is that it doesn’t express relationships between related algorithms, or between related algorithm fragments, that exist in the end user’s head. It obfuscates the role structure. These algorithms are not single closed copies of procedural code, but they play out through object roles.
A scenario that runs through objects frequently needs intimate knowledge about those objects. A closed procedure can access the internals of an object only through its public interface. If we put the use case scenarios in closed procedures, it would cause the interfaces of the objects to bloat to support this close relationship between the use case and the objects. By instead injecting the procedure (bit by bit) into the objects, we allow the code of the algorithms to gain access to object internals (such as domain object private methods) if needed. We need to add new interfaces to domain objects only for business-level functionality that is germane to the use case, rather than adding low-level access methods needed by the use case.
Does this mean that procedural design is completely dead? Of course not. There are still algorithms that are just algorithms (Freud’s “sometimes a cigar is just a cigar”). We can encapsulate algorithms in the private implementation of classes using procedural decomposition. There’s nothing wrong with that. However, those concerns are rarely architectural concerns; we leave those to the cleverness of designers and architects as they come to low-level design and the craftsmanship of implementation.
--
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 https://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.
After learning DCI, I look at my code base (11 mil of c++/C# code).A few things I can see it in different ways now: (replace number with your number)
1) less than 1000 LOC, procedural programming will do well enough2) more than 1000+ LOC, procedural programming starts to fall, classic OOP can do well3) more than 10K LOC, classic OOP starts to fall, and DCI OOP may do better
So the problem is about scaling not about coding an example...How good you can scale your code base (LOC, number of people, number of features...)
Sorry I can't be more helpful.
BTW, I have been told that the hardest tasks facing text book authors is to device simple and illustrative examples.
Something that says: Here's the standard OO way, here's the DCI version, where I can see the advantages.
Den 05/01/2016 kl. 21.24 skrev rune funch <funchs...@gmail.com>:The point is even working together with one of the founders of DCI I didn't learn anything until I started experimenting with DCI.
Something that says: Here's the standard OO way, here's the DCI version, where I can see the advantages.
If you’re implying that I was a worthless teacher
Den 05/01/2016 kl. 21.58 skrev Matthew Browne <mbro...@gmail.com>:I don't think a single example would be able to showcase that because his question is bigger than I think he realizes, but an example could still be helpful
Den 05/01/2016 kl. 22.20 skrev rune funch <funchs...@gmail.com>:On the contrary, I was stating that even with one of the best teacher I could have hoped for, I still didn't learn much until I personally invested in it
Now I was really disappointed, Jonah. I had hoped you would offer to start writing DCI code while looking for the missing example. Instead, you ask me to do more work for you ... This begins to smell like trolling to me -- I hope I'm wrong.
On 05.01.2016 20:49, Jonah S wrote:
Thanks for the reply, trygve.
Sorry I can't be more helpful.
BTW, I have been told that the hardest tasks facing text book authors is to device simple and illustrative examples.
This rings very true. I think it appease not only to text book authors, but to anyone looking to communicate complex ideas well. Finding good examples is very hard, but doing it well reaps great rewards.
Based on what you wrote, I'd add that (for me at least) a "killer app" example isn't even necessary, though of course it would be nice. But really, a half baked, not exactly right but still illustrative example will probably work too. I can probably fill in the blanks. I'm just looking for something specific to hang my hat on. Something that says: Here's the standard OO way, here's the DCI version, where I can see the advantages.
Jonah
Den 05/01/2016 kl. 21.24 skrev rune funch <funchs...@gmail.com>:
I think it was PJ Plaugher who said that the (only? best?) way to learn a programming language was by writing a compiler for it.
It’s how I learned C++.
--
Den 05/01/2016 kl. 21.58 skrev Matthew Browne <mbro...@gmail.com>:
I don't think a single example would be able to showcase that because his question is bigger than I think he realizes, but an example could still be helpful
From a pedagogical and historic perspective I have to strongly disagree even with the last part. Individual examples leverage some level of pre-existing understanding, and the OP had not yet demonstrated enough proficiency even in the most rudimentary concepts to benefit from such an example.
I do think examples can help, but they must be very carefully constructed with learning gaps in mind, must complement each other and build on each other, and rarely work in isolation. A formal background in learning gap analysis and even´curriculum development can help. Yes, there is a science to this, and there are methodologies for developing such material, and I don’t think many people here have a clue about it.
Matt, you were the one who said not to let Cope dissuade further interaction, and that you would be more than willing to offer help. If you want to field those questions, more power to you. I’d propose perhaps setting up an alternative mailing list so the rest of us won’t have to re-read the same answers every time someone asks. (We once had that — remember? — and then got back to the point where most people coming here had done their homework, so we folded the other list. Maybe it’s time to re-enact that list.)
Welcome to object-composition, it is a DCI research work-group for improving the state of programming.
Fastest way to understand DCI is to write a few examples, we suggest starting with Dijkstra. It's expected that you have done or tried to do that before asking questions.
For more information see ...
Rune, you seem like a good guy, after all. Honestly.
Den 06/01/2016 kl. 02.25 skrev Matthew Browne <mbro...@gmail.com>:If there had been a larger body of community examples (particularly larger examples) when I was first learning DCI, I think it would have enhanced my learning process even more.
It's very possible of course to learn DCI with the great number of published materials already available, and spending time practicing (and/or using it in real projects). And I know that we have many competing priorities, and I'm not sure where creating more examples fits in at the moment.
But I think you are overly downplaying the usefulness of examples as one part of the learning process
Den 06/01/2016 kl. 00.47 skrev Matthew Browne <mbro...@gmail.com>:So it's puzzling to me why you seem to be making the barrier to entry so high that it's completely unfeasible for many busy professionals.
I’ll likely include the shopping cart example (if that’s O.k., Marc).
Den 06/01/2016 kl. 00.47 skrev Matthew Browne <mbro...@gmail.com>:
So it's puzzling to me why you seem to be making the barrier to entry so high that it's completely unfeasible for many busy professionals.
It’s puzzling to me that you extrapolated my statement that far. I am stipulating no barrier. I’m not even making a suggestion.
On the other hand, Plaugher isn’t the only one to have said this and, when it comes to programming language, I think he’s right. So what he says does apply to the trygve effort and, I think, to the Marvin and Maroon efforts.
Those unwilling to make the commitment to the learning path have often in the past worn us down looking for the shortcut. It is better that they discover early that it is not appreciated here, and that they either become lurkers or leave. We have made one step of progress in this area in the past day.
Den 06/01/2016 kl. 02.25 skrev Matthew Browne <mbro...@gmail.com>:If there had been a larger body of community examples (particularly larger examples) when I was first learning DCI, I think it would have enhanced my learning process even more.The key point here is that you need a body of examples — not, as all recent posters have been asking, a Demonstration of Superiority. As you say, a body of examples can be a part of the learning process. But they need to be designed. They don’t stand alone (that was part of the danger of many of the OO examples I discussed earlier), so they need a lot of supporting material, and it’s non-trivial to create that material. It’s hard to develop a set of examples. I know, because I’ve done it (not only for DCI but for other design approaches and programming languages as well).
Den 06/01/2016 kl. 14.44 skrev Matthew Browne <mbro...@gmail.com>:I didn't mean to put words in your mouth, and I may have gone too far here. I read too much into your comment, and it's not accurate to say you're demanding that someone write a compiler in order to pass some barrier to entry. But your tone and comments when you begin to suspect laziness could very easily give that impression to someone new to our community.
On the other hand, Plaugher isn’t the only one to have said this and, when it comes to programming language, I think he’s right. So what he says does apply to the trygve effort and, I think, to the Marvin and Maroon efforts.I'm not sure if you were hinting something here, but FYI, I have worked on DCI source transformation solutions (in addition to pseudo-DCI implementations like for PHP and native Javascript of which you're aware). Granted that's not the same as building a true compiler, but it still requires a significant investment in understanding DCI to do it. I recently got an initial proof-of-concept working for a new source transformation solution for Javascript with a real parser (which I will be presenting to the group soon), and I also earlier wrote an implementation for Typescript. And writing those implementations has indeed helped me to understand DCI more deeply.
Those unwilling to make the commitment to the learning path have often in the past worn us down looking for the shortcut. It is better that they discover early that it is not appreciated here, and that they either become lurkers or leave. We have made one step of progress in this area in the past day.But the thing is, Jonah was willing to make the commitment.
Den 06/01/2016 kl. 14.44 skrev Matthew Browne <mbro...@gmail.com>:
I don't think I explained what I mean about the examples well enough, and I apologize for that. In retrospect I realize why it sounded like I was (perhaps impatiently) asking you, Trygve, and others to create more examples. That wasn't what I meant at all. I was simply pointing out that I think a larger body of examples would be helpful, which we clearly agree about. I greatly respect the wisdom and experience of you and Trygve and I think you should proceed however you see fit with regard to the creation of future resources and the evolution of DCI in general.
The point of my comments about examples was that even with all our current resources and examples, it can be very hard for a newcomer to connect all the dots, and we should be sensitive to that. If someone asks a question because they are still confused about something after reading quite a bit about DCI, we shouldn't immediately assume the worst of their intentions and imply that they're lazy. As to the culture of the group, it seems there are still some critical misunderstandings to be cleared up before we move on, so I'll clarify myself as concisely as I can…
The point I have stated again and again which you still seem not to have acknowledged is how our goals of sharing DCI with the world can be obstructed by giving off an impression that we are unfriendly and unhelpful and that DCI is so complex that it requires an unfeasibly large investment of time to understand even the basics. I don't think you or anyone here is doing that intentionally, but I do think a lot of people end up getting that impression, much more than you may be aware. Some more comments inline...
Den 06/01/2016 kl. 08.13 skrev Egon Elbre <egon...@gmail.com>:I believe there are several issues with newcomers.1. This forum looks like a regular forum -- however it's more a research work-group.
Den 06/01/2016 kl. 08.13 skrev Egon Elbre <egon...@gmail.com>:
a. The introduction to DCI should start with Role modeling, how it is related to the world.... probably some more thinking parts, i.e. System / Interaction etc.b. Then the importance of mental-model mapping directly to code.c. And finally all the gritty technical aspects.
If a newcomer wants to commit to learning this, there are many community resources that are adequate to get started. That is what I hear you failing to acknowledge;-)
Den 06/01/2016 kl. 16.16 skrev Matthew Browne <mbro...@gmail.com>:StackOverflow is a good example. If someone comes to StackOverflow with a well-written question and is respectful of the people answering it, there is a great community effort to give a good answer. Yes, there is an expectation of professionalism and it's not about hand-holding, but I think what's happening here is different -- immediately assuming the worst of people and implying that they're lazy. People get called out for being lazy on StackOverflow too but only if the question clearly demonstrated laziness and/or lack of respect. Well-meaning people don't react well to such implications and get turned off even if they were previously eager to learn and do whatever homework is needed. I'm sure some of the people really are lazy, or want to spend only a small amount of time trying to understand DCI and then immediately start challenging it, which of course is unfair and annoying. But between the tone of some of our responses here and the wrong impressions we're giving about the barrier to entry being incredibly high, I think we're turning a lot of people off from DCI in a way that is sad and unnecessary, and as I said before, could ultimately lead to DCI being nothing more than a footnote in history.
If a newcomer wants to commit to learning this, there are many community resources that are adequate to get started. That is what I hear you failing to acknowledge;-)Yes, I acknowledge that. I am saying that we can improve on those resources,
not that a smart and dedicated person can't learn DCI from the resources we already have. But if someone has already gone through those resources and is still struggling to understand the value and distinction of DCI from other approaches, we shouldn't respond in a way that actually dissuades them from wanting to pursue it further or makes it seem like even basic DCI is unsuitable for dedicated and open-minded adults with limited time, let alone children who aren't mature enough yet to understand advanced concepts and theory.
Den 06/01/2016 kl. 08.13 skrev Egon Elbre <egon...@gmail.com>:a. The introduction to DCI should start with Role modeling, how it is related to the world.... probably some more thinking parts, i.e. System / Interaction etc.b. Then the importance of mental-model mapping directly to code.c. And finally all the gritty technical aspects.Again: I like the concreteness as a foundation for something to discuss.I wonder that if before Roles we need people to understand use cases?
The Roles to me are a way of chunking use cases in two dimension: one, chunking them along the time dimension so the parts (Role methods) can individually be understood, and, two chunking together Role methods that are mutually coupled in the traditional sense of coupling. I suppose one could start anywhere, including with Roles, but I think use cases provide the necessary context (literally and figuratively) to give Roles meaning.
I think a good way to illustrate Roles is with CRC cards, at least as a metaphor, and perhaps as a “best practice” design technique.
You’re still young and perhaps you haven’t yet been burned. Ten times burned, twice cautious.
I wonder that if before Roles we need people to understand use cases? The Roles to me are a way of chunking use cases in two dimension: one, chunking them along the time dimension so the parts (Role methods) can individually be understood, and, two chunking together Role methods that are mutually coupled in the traditional sense of coupling. I suppose one could start anywhere, including with Roles, but I think use cases provide the necessary context (literally and figuratively) to give Roles meaning.
Originally, this list was for newbies who were curious to learn about DCI.� A helpful community should help them across the chasm from class oriented to object oriented thinking and coding.
I haven't seen any newbies on this list lately. Perhaps they have been frightened away by the esoteric nature of the discussions. Jim created the new evolution list for the kind of discussions we have had for the last month? year? years?.� I admit I have contributed to this sad state of affairs.
One of the DCI goals is that end users shall be empowered to understand DCI programs, to be able to read the code and some may even write code. Things happen in the world around us. I have seen that there is a growing movement "teaching kids programming", [C2P]. A key question is what to teach: Fortran? C? Java?. PHP? One serious contender is MS SmallBasic. I believeDCI is a better choice because a bod can start very simple and grow to full fledged professional programming without ever changing the fundamental model.
My current task is to write an article on DCI aimed at the membership of ACM. It shall adhere to the Scientific American motto:
Never underestimate your reader's intelligence. Never overestimate your reader's prior knowledge.
My readership knows about computing seen from one angle or another. Only a minority has a computer science education. The goal is to build a powerful model of computing in the reader's mind. This means that there must be a minimum of new concepts in the article, and each of them has to be carefully explained. The article describes DCI as I see it. Some key concepts are data, information, data processing; the DCI object with its encapsulation and key class and role abstractions; representation of end user information: Data classes; representation of end user model of data processing with representation of system behavior: messages and methods. And more.