Hi, On Wed, 27 Aug 2008 19:44:09 +0200 Emmanuel Lecharny <[EMAIL PROTECTED]> wrote:
> Alex Karasulu wrote: > > Pretty much agree myself but I don't think Adapters need to be > > abstract. > Again, these classes are _not_ adapters, wrt the definition of the > adapter pattern. That's my point. And when the javadoc says that the > class is abstract, I'm expecting to see an 'abstract' keyword. Or > maybe the javadoc is incorrect. Well it's not the only meaning of ..Adapter in Java, for example : http://www.ryerson.ca/~dgrimsha/courses/cps840/adapter.html It's just dummy implementation to listener interface, mainly. Personally I don't care much, but I think if it make some sense as Christian described (adapter for dummy iface implementation and abstract for base classes for implementation) keep it. > > Ok, to be very clear : I don't want to start a debate or a flamewar > about this, because it's really not important. It was just because I > don't find it consistent to have 6 so called Adapters when everywhere > in the code, we are using Abstract classes instead. I really wanted > to know if there were some pretty good reasons to have followed a > different patterns in those cases, something which is absolutely not > an evidence when you look at the javadoc and at the implementation. > That's it. Well here Abstract & Adapter are different, I start to think a lot of Java programmer understand it as Christian. After checking there is a lot of them in the JRE. > > > You may after all want to instantiate a NOOP instance for whatever > > reason. > Very true. But it has to be something you have to need, too. > Otherwise, if it's only for the beauty of instanciating NOOP objects, > well, it enters in the YAGNI category ... :) > Agreeing here, let's avoid the confusion and make them abstract, in no way it's concrete classes. Users will just make an anonymous instance for special cases described by Alex. Julien
signature.asc
Description: PGP signature
