• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
The Solid Principles
 

The Solid Principles

on

  • 2,609 views

My presentation slides from the recent Reading Geek Night event

My presentation slides from the recent Reading Geek Night event

Statistics

Views

Total Views
2,609
Views on SlideShare
2,554
Embed Views
55

Actions

Likes
2
Downloads
53
Comments
0

3 Embeds 55

http://blog.lukesmith.net 50
http://www.slideshare.net 4
http://static.slidesharecdn.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • What is SOLID
  • Collection of object orientated design best practicesSpaghetti code often due to poor dependency management
  • Collection of object orientated design best practicesSpaghetti code often due to poor dependency management
  • 0
  • SRP

The Solid Principles The Solid Principles Presentation Transcript

  • The SOLID Principles
    Reading Geek Night
  • My digital identity
    Blog: http://blog.lukesmith.net
    Twitter: @lukesmith
  • What the?
    An acronym of acronyms
    Collection of best-practices
    loose-coupling
    Maintainability
    Principles – not Rules
    Focus on dependency management
  • Dependency management
    Poor dependency management
    Hard to change
    Fragile
    Non-reusable
    Good dependency management
    Flexible
    Robust
    Reusable
  • Single Responsibility Principle
    A class should have one, and only one, reason to change
  • Single Responsibility Principle
    Benefits
    More readable code
    More robust
    More maintainable
    Smaller functions
  • Open Closed Principle
    Software entities should be open for extension, but closed for modification
  • Open Closed Principle
    • Change to an entity cascades changes to dependent modules
    • Fragile
    • Unpredictable
    • Modules should never change
    • Extend behaviour – add new code
    • Don’t change existing working code
  • Liskov Substitution Principle
    Derived classes must be substitutable for their base classes
  • Liskov Substitution Principle
    • Important for any program conforming to OCP
    • Caller should not be surprised by substituting base type for subtype
    • Virtual members must exist in derived classes
    • Must do useful + expected work
  • Liskov Substitution Principle
    • Useful work
    • Must be implemented
    • Expected work
    • Should keep behaviour of base class
  • Interface Segregation Principle
    Make fine grained interfaces that are client specific
  • Interface Segregation Principle
    Deals with disadvantage of “fat” interfaces
    Clients forced to depend on interfaces they don’t use subjected to changes in that interface
    MembershipProvider – forces 27 methods/properties
    Benefits
    Lower coupling – better maintainability
    Higher cohesion – better robustness
  • Dependency Inversion Principle
    Depend on abstractions, not concretions
  • Dependency Inversion Principle
    Modules should not depend on modules implementing details
    Depend on abstractions
  • Dependency Inversion Principle
  • Further info
    http://www.butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod