On 29.1.14 3:35 , Jukka Zitting wrote:
Hi,

On Wed, Jan 29, 2014 at 4:44 AM, Michael Dürig <[email protected]> wrote:
I don't like how this relies on side effects: generate() puts the events
into a queue owned by QueueingHandler and referenced by this class
(EventQueue).

Those aren't side effects, they're the explicitly what the classes are
wired  up to do. There's no other effects of that wiring.

I didn't doubt that this works as designed. But still the design relies on side effects of the parameterless method generate(). If there weren't any side effect generate() could as well be substituted by a constant.

To make this more explicit, we could replace the direct
LinkedList accesses in QueueingHandler with something like
EventQueue.addEvent(), which would encapsulate the queue entirely
within EventQueue.

Yes, let's do that.

Michael


BR,

Jukka Zitting

Reply via email to