 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ben Guest
|
Posted: Sat Dec 02, 2006 1:21 am Post subject: Interfaces are they always needed - best practise debate? |
|
|
Hi,
I'd like your views on the following to help settle an in team debate.
Common best design practise is to interface business and data access
objects.
I work in a team where this is being done for non ejb based projects
that use struts and spring, but the design and implementations don't
(currently) require any other implementations of these objects. We
follow an XP methodology.
So the question is - for these approximately 30 classes in one non ejb
project, are interfaces necessary for these singular implementations?
My personal opinion "thinking out of the box" is that I believe they are
not, since it goes against XP methodology, that it is following the
interface design paradigm blindly, it increases complexity, it increases
the required maintenance and can even reduce performance (very
debateable last point I know). IMHO Interfaces should be implemented
when the design specifically calls for it, e.g. for Spring beans that
can have multiple implementations.
I am however in the minority for thinking this in my team.
Thanks,
Ben |
|
| Back to top |
|
 |
William Guest
|
Posted: Thu Jan 04, 2007 8:04 am Post subject: Re: Interfaces are they always needed - best practise debate |
|
|
i think to use or not depends on the scale of your project.
in my project, there are 170 classes, and we have to use
interfaces to take use of AOP of spring.
On Sat, 02 Dec 2006 03:21:48 +0800, Ben <na (AT) na (DOT) com> wrote:
| Quote: | Hi,
I'd like your views on the following to help settle an in team debate.
Common best design practise is to interface business and data access
objects.
I work in a team where this is being done for non ejb based projects
that use struts and spring, but the design and implementations don't
(currently) require any other implementations of these objects. We
follow an XP methodology.
So the question is - for these approximately 30 classes in one non ejb
project, are interfaces necessary for these singular implementations?
My personal opinion "thinking out of the box" is that I believe they are
not, since it goes against XP methodology, that it is following the
interface design paradigm blindly, it increases complexity, it increases
the required maintenance and can even reduce performance (very
debateable last point I know). IMHO Interfaces should be implemented
when the design specifically calls for it, e.g. for Spring beans that
can have multiple implementations.
I am however in the minority for thinking this in my team.
Thanks,
Ben |
|
|
| Back to top |
|
 |
Kris W. Keener Guest
|
Posted: Sun Sep 28, 2008 6:10 pm Post subject: Re: Interfaces are they always needed - best practise debate |
|
|
On 2006-12-01, Ben <na (AT) na (DOT) com> wrote:
| Quote: | Hi,
I'd like your views on the following to help settle an in team debate.
Common best design practise is to interface business and data access
objects.
I work in a team where this is being done for non ejb based projects
that use struts and spring, but the design and implementations don't
(currently) require any other implementations of these objects. We
follow an XP methodology.
So the question is - for these approximately 30 classes in one non ejb
project, are interfaces necessary for these singular implementations?
My personal opinion "thinking out of the box" is that I believe they are
not, since it goes against XP methodology, that it is following the
interface design paradigm blindly, it increases complexity, it increases
the required maintenance and can even reduce performance (very
debateable last point I know). IMHO Interfaces should be implemented
when the design specifically calls for it, e.g. for Spring beans that
can have multiple implementations.
I am however in the minority for thinking this in my team.
Thanks,
Ben
|
Spring's AOP and IOC leverage interfaces. I tend to use interfaces
for this reason. For example, you never know when you'll need to apply an
interceptor or IOC in a new class to facilitate a testing scenario.
On a small project, these may not be important issues. But small
projects often turn into large projects and on large projects, IOC is
extremely helpful.
I don't blame you for being concerned about following a design principle
blindly. It is crucial that everyone on the team understands the design
decisions.
Good luck with your project.
-KK |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|