Re: Why interface

2005-08-11 Thread Dave Newton
This got long-ish as I'm partially thinking out loud about this work-in-progress. Sorry. The whole thing got blown out of proportion late last week and I shouldn't be doing this with Struts at all, I think. More of a Dave's Java Playground project, this. Adam Hardy wrote: if you have a whole

Re: Why interface

2005-08-11 Thread Dakota Jack
You missed the point, Adam. No one is so daft as to be saying that having an interface makes the implementations of that interface less than specific implementations. The point is that you can switch them out. On 8/11/05, Adam Hardy <[EMAIL PROTECTED]> wrote: > Dave Newton on 10/08/05 16:25, wro

Re: Why interface

2005-08-11 Thread Adam Hardy
Dave Newton on 10/08/05 16:25, wrote: (4) Dependency Injection/Configurability. Classes that implement interfaces can be instantiated at runtime allowing for config-file-level application modification. This can translate into HUGE wins over the life of an application. As a recent thread on

RE: Why interface

2005-08-10 Thread Paranj, Bala
"Program to an interface, not an implementation." This concept is different from deciding whether to use Java Interfaces or abstract classes. The term interface in this context actually means "type". This is basically the same thing as the Liskov's Substitution Principle. LSP is a well defined pr

Re: Why interface

2005-08-10 Thread Ulrich Elsner
On 8/10/05, Laurie Harper <[EMAIL PROTECTED]> wrote: > Carl Smith wrote: > > In Java/J2EE community, it seems that a lot of experienced developers tend > > to use a lot of interfaces, however, a lot of junior developers ignore > > using interface. I am not sure why interfaces seem to be favorite

Re: Why interface

2005-08-10 Thread Michael Jouravlev
On 8/10/05, Dave Newton <[EMAIL PROTECTED]> wrote: > Laurie Harper wrote: > > > As a more general example, consider if you wrote all your code to use > > ArrayList and later found, after profiling, that you needed to switch > > to LinkedList for performance reasons. You'd have to update all your

Re: Why interface

2005-08-10 Thread Dave Newton
Laurie Harper wrote: As a more general example, consider if you wrote all your code to use ArrayList and later found, after profiling, that you needed to switch to LinkedList for performance reasons. You'd have to update all your code -- including all the clients of all the methods that accep

Re: Why interface

2005-08-10 Thread Laurie Harper
Carl Smith wrote: In Java/J2EE community, it seems that a lot of experienced developers tend to use a lot of interfaces, however, a lot of junior developers ignore using interface. I am not sure why interfaces seem to be favorite to some experienced developers. Can some one explain this?Can yo

Re: Why interface

2005-08-10 Thread Dave Newton
Frank W. Zammetti wrote: I think it usually comes down to three reasons... I'd add a fourth, although really it's just a result of the reasons you mention. But I think it's important enough to warrant attention :) (4) Dependency Injection/Configurability. Classes that implement interfaces

Re: Why interface

2005-08-10 Thread Frank W. Zammetti
I think it usually comes down to three reasons... (1) A class can only extend a single class, whereas it can implement multiple interfaces (Interfaces are Java's version of multiple inheritance in C). So, as soon as you get to the point where extending a single class just isn't sufficient, it's n

[OT] Re: Why interface

2005-08-10 Thread Jerry Tan
At the end of the day, some would say there's really no functional difference between the two. But as for a preference for interfaces, well, partly it's due to the limitation of single inheritance in Java. Using interfaces provides the functionality of acting as a derivative of multiple base clas

[OT ]Re: Why interface

2005-08-10 Thread DGraham
"Program to an interface, not an implementation." #1 principle from GoF. Here's a recent interview with Erich Gamma: http://www.artima.com/lejava/articles/designprinciples.html -Dennis Carl Smith <[EMAIL PROTECTED]> 08/10/2005 10:47 AM Please respond to "Struts Users Mailing List" To S