Code Like a Ninja Session 5 - Interface Segregation Principle

Post on 19-Nov-2014

155 views 0 download

Tags:

description

 

Transcript of Code Like a Ninja Session 5 - Interface Segregation Principle

CODE LIKE A NINJATHE INTERFACE SEGREGATION PRINCIPLE

SESSION RESOURCES

• Presentation session notes including link to this session, will be available on http://learningaboutfudge.blogspot.com

• All the source for this session is publically available at: https://github.com/SheepWorx/Training

• RSS Feed: http://learningaboutfudge.blogspot.com/feeds/posts/default?alt=rss

• Local Network: \\dmeyer-m\share\training\Code Like a Ninja

• Source was compiled using Visual Studio 2012

Single Responsibility PrincipleOpen/Close PrincipleLiskov’s Substitution PrincipleInterface Segregation PrincipleDependency Inversion Principle

DEFINITION

The Interface Segregation Principle

If you have an abstract class or interface, its implementers should not be forced to implement parts it doesn’t care about

WHY?

• Interfaces or base classes that tend to get bulky also tend to be unstable

• Unstable interfaces or base classes are rigid and tend to break its implementers

CODE

• Demo the code samples

Next Session: S.O.L.I.D – Dependency Inversion Principle

SESSION RESOURCES

• Presentation session notes including link to this session, will be available on http://learningaboutfudge.blogspot.com

• All the source for this session is publically available at: https://github.com/SheepWorx/Training

• RSS Feed: http://learningaboutfudge.blogspot.com/feeds/posts/default?alt=rss

• Local Network: \\dmeyer-m\share\training\Code Like a Ninja

• Source was compiled using Visual Studio 2012