Re: Does using generics complicate the use of interface-type declarations?
- From: "Oliver Wong" <owong@xxxxxxxxxxxxxx>
- Date: Tue, 06 Sep 2005 20:59:55 GMT
"jan V" <nul@xxxxxx> wrote in message
news:ZnhTe.187397$BI5.10302537@xxxxxxxxxxxxxxxxxxxxxxxx
> List materialsList = new ArrayList();
I'm relatively neutral on this topic in the sense that main reason I use
"ArrayList materialsList = new ArrayList()" instead of "List materialsList =
new ArrayList()" is because I'm too lazy to put in two import statements
(even with the help of Eclipse, that's TWO quickfixes I have to apply
instead of one). This is especially true for local variables that "no one
will ever see", as opposed to when I have to code public interfaces which
"must never change" (in which case I *would* use List over ArrayList, so as
to give myself as much room as possible).
That being said, doesn't the "List materialsList = new ArrayList()"
solution increase dependencies in the sense that your code now relies on two
types (i.e. List and ArrayList) instead of just one (ArrayList)?
- Oliver
.
- Follow-Ups:
- Re: Does using generics complicate the use of interface-type declarations?
- From: Lāʻie Techie
- Re: Does using generics complicate the use of interface-type declarations?
- References:
- Prev by Date: Re: Java v/s ImageMagick
- Next by Date: Re: Does using generics complicate the use of interface-type declarations?
- Previous by thread: Re: Does using generics complicate the use of interface-type declarations?
- Next by thread: Re: Does using generics complicate the use of interface-type declarations?
- Index(es):
Relevant Pages
|