Code Like a Ninja Session 5 - Interface Segregation Principle

9
CODE LIKE A NINJA THE INTERFACE SEGREGATION PRINCIPLE

description

 

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

Page 1: Code Like a Ninja Session 5 - Interface Segregation Principle

CODE LIKE A NINJATHE INTERFACE SEGREGATION PRINCIPLE

Page 2: Code Like a Ninja Session 5 - 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

Page 3: Code Like a Ninja Session 5 - Interface Segregation Principle

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

Page 4: Code Like a Ninja Session 5 - Interface Segregation Principle
Page 5: Code Like a Ninja Session 5 - Interface Segregation 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

Page 6: Code Like a Ninja Session 5 - Interface Segregation Principle

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

Page 7: Code Like a Ninja Session 5 - Interface Segregation Principle

CODE

• Demo the code samples

Page 8: Code Like a Ninja Session 5 - Interface Segregation Principle

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

Page 9: Code Like a Ninja Session 5 - 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