Content deleted Content added
Refactored example slightly. |
m Task 70: Update syntaxhighlight tags - remove use of deprecated <source> tags |
||
Line 8:
An event-driven solution would implement a [[Observer pattern|listener interface]]:
<
String key = null;
String value = null;
Line 34:
}
}
</syntaxhighlight>
But without the listener, it becomes an example of the antipattern:
<
// parse a key, a value, then three parameters
String key = null;
Line 56:
}
}
</syntaxhighlight>
And here is the refactored solution:
<
// parse a key and value
String key = stream.parse();
Line 69:
params.add(stream.parse());
}
</syntaxhighlight>
==References==
|