Interface naming in Java
Posted
by Allain Lalonde
on Stack Overflow
See other posts from Stack Overflow
or by Allain Lalonde
Published on 2009-02-12T15:51:33Z
Indexed on
2010/05/25
3:51 UTC
Read the original article
Hit count: 310
Most OO languages prefix their interface names with a capital I, why does Java not do this? What was the rationale for not following this convention?
To demonstrate what I mean, if I wanted to have a User interface and a User implementation I'd have two choices in Java:
- Class = User, Interface = UserInterface
- Class = UserImpl, Interface = User
Where in most languages:
Class = User, Interface = IUser
Now, you might argue that you could always pick a most descriptive name for the user implementation and the problem goes away, but Java's pushing a POJO approach to things and most IOC containers use DynamicProxies extensively. These two things together mean that you'll have lots of interfaces with a single POJO implementation.
So, I guess my question boils down to: "Is it worth following the broader Interface naming convention especially in light of where Java Frameworks seem to be heading?"
© Stack Overflow or respective owner