[josm-dev] Jumbo Patch
Gervase Markham
gerv at gerv.net
Sat Dec 15 08:44:24 GMT 2007
Dave Hansen wrote:
> Yeah, now that I look at it, very few people were actually poking the
> Way.nodes in any significant ways. We could allow direct access to the
> nodes, I just worry a bit that people will _start_ to poke it in bad
> ways, or forget to update the node->way cache. Although, I guess we
> could also just override the list functions in a subclass and get some
> of the same behavior.
If you are finding yourselves writing lots of stub functions that don't
do anything, then the Adapter pattern (or, at least, what Sun calls the
Adapter pattern) is what you need :-) Example:
http://java.sun.com/j2se/1.4.2/docs/api/java/awt/event/MouseAdapter.html
Then, your derivative class extends FooAdapter, and you don't have to
stub out all the methods; you just implement the ones you need.
Gerv
More information about the josm-dev
mailing list