Money Transfer of dead horses kicked again.

47 views
Skip to first unread message

Raoul Duke

unread,
Apr 30, 2016, 11:15:18 AM4/30/16
to object-co...@googlegroups.com

Looking at the Scala & Have MoneyTransfer, I find the code odd in that the source Role withdraw function also knows about the destination. I'd have wanted that up another level of abstraction in purely Context code. Just saying I think maybe it could be a road bump for some readers potentially.

James O Coplien

unread,
Apr 30, 2016, 12:52:46 PM4/30/16
to object-co...@googlegroups.com
I’m beginning to believe it’s time to shoot that horse, dead or not.

Den 30/04/2016 kl. 17.15 skrev Raoul Duke <rao...@gmail.com>:

Looking at the Scala & Have MoneyTransfer, I find the code odd in that the source Role withdraw function also knows about the destination. I'd have wanted that up another level of abstraction in purely Context code. Just saying I think maybe it could be a road bump for some readers potentially.


--
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.

Matthew Browne

unread,
Apr 30, 2016, 6:47:45 PM4/30/16
to object-co...@googlegroups.com

Hi Raoul,
I agree with Cope, but I also realize it's possible you missed some recent discussions about this that were buried in other threads. Here are some relatively recent posts where I gave my two cents:

https://groups.google.com/d/msg/object-composition/ABXXVbyOk10/cJE-ZZNkCAAJ
https://groups.google.com/d/msg/object-composition/nnxDYYMC5qc/poosyPCTVcYJ

My thinking has evolved somewhat on this, especially after Cope's assertion that my "Bank" role may as well have been called "main". I changed my JS example to use "Banker" instead which is of course only a small semantic change, but I think it gets a little closer to the idea of a "Teller" role which I avoided because I and presumably others in my generation don't associate a money transfer with walking up to a teller. Perhaps it would have been better if I had gone back to the original example and used Source.transferFrom() and Destination.transferTo(), but I've moved on at this point.

Anyway, the money transfer example was never intended to be a flagship example of roles and role binding, and I doubt we're going to gain much benefit or help others understand DCI better by continuing to go back and forth about it ad nauseum. That said, feel free to contact me off-list if you think my familiarity with past discussions about this could be helpful.



On 4/30/16 11:15 AM, Raoul Duke wrote:

Looking at the Scala & Have MoneyTransfer, I find the code odd in that the source Role withdraw function also knows about the destination. I'd have wanted that up another level of abstraction in purely Context code. Just saying I think maybe it could be a road bump for some readers potentially.

--
Reply all
Reply to author
Forward
0 new messages