<pedrocorreia.net ⁄>
 

<Should we discard Interfaces? ⁄ >




clicks: 3223 3223 2008-05-18 2008-05-18 goto misc myNews misc  Bookmark This Bookmark This


Whether we are writing DAO's, services or use case, most of the time we create interfaces for these implementations. It allows us to program against interfaces, a common best practice for all of us. Using interfaces gives us following advantages:

* Enables loose coupling between interacting classes
* Makes it easier to test
* Allows us to easily switch between implementations.

Lately, I've been openly questioning if we should always use interfaces. Are they always required by default and is the extra cost of keeping the interface and the implementation in sync worth the trouble? Lets discuss.

When we are using dependency injection, the coupling between one class and another is very low. It's of course true that by injecting implementation instead of interfaces we are making the coupling a little tighter. The classes are still in isolation, since neither creates a new instance. This is still done by the DI container, which deals with instantiation and configuration.



este é só um excerto do artigo, para aceder ao artigo completo, clique no link em baixo:
this is just a small excerpt from the article, to access the full article please click in the link below:

http://www.inze.be/andries/?p=29




Subscribe News RSS  Subscribe News Updates by E-mail





myNews <myNews show="rand" cat="misc" ⁄>

Adobe Photoshop CS6: Improvements for Web and UI Designers new ...

Photoshop CS6 has been hailed as a huge improvement for web and UI designers. I'm going to share wit (...)

clicks: 17693 17693 2012-05-14 2012-05-14 goto url (new window) webdesign.tutsp... goto myNews misc


Camera Exposure Modes Explained new ...

If you're just getting started with photography, the letters on your camera's dial might feel like h (...)

clicks: 15567 15567 2012-05-13 2012-05-13 goto url (new window) photo.tutsplus.... goto myNews misc


45 Fresh Collection of High Quality Free PSD Files new ...

What else can be so great for a designer than finding out high quality Photoshop PSD files? This is (...)

clicks: 9530 9530 2012-05-09 2012-05-09 goto url (new window) smashingapps.co... goto myNews misc


15 Free High Quality ToolTip PSD's new ...

A tooltip or infotip can be defined as a graphical hint that is incorporated with the website design (...)

clicks: 11148 11148 2012-05-07 2012-05-07 goto url (new window) smashingapps.co... goto myNews misc


40+ Elegant Examples of River Photography

River photography is one of the beautiful type of photography, photographers take pleasure in this w (...)

clicks: 6987 6987 2012-05-04 2012-05-04 goto url (new window) smashingbuzz.co... goto myNews misc


40 Fresh And High Quality Free Icon Sets In PSD Format

Here is yet another exciting collection of high quality Free Icon PSD files for the designers that t (...)

clicks: 7500 7500 2012-02-19 2012-02-19 goto url (new window) smashingapps.co... goto myNews misc


15 jQuery Calendar Date Picker Plugins

In this collection, you will see some of the best jQuery Calendar Date Picker Plugins that will allo (...)

clicks: 7423 7423 2012-02-18 2012-02-18 goto url (new window) smashingapps.co... goto myNews misc


50 Beautiful Yet Free HTML5 And CSS3 Templates

HTML5 templates are getting very popular these days because all professional HTML5 templates are com (...)

clicks: 8002 8002 2012-02-17 2012-02-17 goto url (new window) smashingapps.co... goto myNews misc