[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: New package structure
timfox
do-not-reply at jboss.com
Wed Feb 27 08:02:45 EST 2008
"ataylor"
That was my point, we shouldn't be Dependant on the implementation for anything if we use interfaces. If its pluggable it should be an interface and should be injected, if it isnt, then do we really need an interface?
Just playing devils advocate! :) [/quote wrote :
|
| It's not all or nothing.
|
| Being dependent on the implementation on the implementation in one place (at construction) is better than being dependent on the implementation in N places (each place the class is used), so it's an improvement.
|
| Also, other advantages:
|
| 1) Makes testing a whole lot easier since can easily create mock / fake implementions
|
| 2) Makes code easier to read / understand
|
| 3) If user wants to create their own implementation of the interface they can. If it's a concrete class they'd have to extend that class. That may not be possible desirable.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4132489#4132489
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4132489
More information about the jboss-dev-forums
mailing list