Skip to main content
6 events
when toggle format what by license comment
Nov 6, 2014 at 6:20 vote accept 9a3eedi
Sep 19, 2014 at 5:49 comment added jhdrn Well, I don't think using dynamic is wrong per se, but it is not suitable to use in a message because the message can potentially be handled by many handlers and you will loose type checking at as many places. In the solution posted above, you will be using dynamic at one place (you should implement a message "bus" that takes care of resolving and executing handlers). That way, you hide the use of dynamic from the message API and makes life happier for everyone :)
Sep 19, 2014 at 1:13 comment added 9a3eedi This seems like a potentially great solution, but you still end up using dynamic, as well as some reflection (getType). What I don't understand is why is it "ok" to use it in this case, but not in the message object case? And yes, "payload" is a terrible name :) sorry I couldn't think of a better name
Sep 18, 2014 at 19:33 history edited jhdrn CC BY-SA 3.0
added 74 characters in body
Sep 18, 2014 at 15:31 comment added Benjamin Hodgson +1, this is exactly what I would've suggested (and indeed it's how we built our platform at my place of work)
Sep 18, 2014 at 11:02 history answered jhdrn CC BY-SA 3.0