SOLID -Clean Code For Mere Mortals

  • 474 views
Uploaded on

 

More in: Self Improvement
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
474
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
14
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. SOLIDClean code formere mortals
  • 2. { What is software development? ‹ Software development is not (only) programming ‹ Agile Software Development: Principles, Patterns, and Practices ‹ The Pragmatic Programmer ‹ Manifesto for Software Craftsmanship
  • 3. { Software requirements ‹ Notoriously fluid ‹ Changes in scope ‹ Changes in functionalities ‹ Changes in environments ‹ The only constant is change ‹ We should embrace change!
  • 4. { Software Rot ‹ Occurs to any software that survives the first version ‹ Rigidity ‹ Fragility ‹ Immobility ‹ Viscosity
  • 5. { SOLID Principles ‹ Introduced by Robert C. Martin (Uncle Bob) ‹ An acronym of acronyms ‹ Not a piece of code ‹ Tool for “code smell” detection
  • 6. { SOLID Principles ‹ Single Responsibility Principle ‹ Open Closed Principle ‹ Liskov Substitution Principle ‹ Interface Segregation Principle ‹ Dependency Inversion Principle
  • 7. { SOLID ‹ Single Responsibility Principle ‹ Single Level of abstraction ‹ Just one reason to change ‹ Antithesis of the “God” object
  • 8. SRP IN ACTION
  • 9. { SOLID ‹ Open Closed Principle ‹ Inspired from work on Eiffel ‹ Open for extensions ‹ Closed for modification ‹ Use polymorphic behaviours
  • 10. OCP IN ACTION
  • 11. { SOLID ‹ Liskov Substitution Principle ‹ Named after Barbara Liskov ‹ Subclasses should be substitutable for their base classes. ‹ Design by Contract ‹ A Circle is not an Ellipse
  • 12. LSP IN ACTION
  • 13. { SOLID ‹ Interface Segregation Principle ‹ It’s not always about the `interface` keyword ‹ An interface should have a single purpose ‹ An interface should define a client
  • 14. ISP IN ACTION
  • 15. { SOLID ‹ Dependency Inversion ‹ Depend upon abstractions. ‹ Do not depend upon concretions. ‹ Object creation problems – use object factories. ‹ The principle behind Inversion-of- control and Dependency Injection
  • 16. DIP IN ACTION
  • 17. { Bonus Principle: YAGNI ‹ You Ain’t Gonna Need It ‹ Just-in-time implementation ‹ Avoid architecture astronauts ‹ Simpler code is easier to refactor ‹ Keep it as simple as possible, but not simpler
  • 18. Questions?• Complete the electronic evaluation forms on the computers in the hall and enter to win! – Telerik Ultimate Collection – RedGate .NET Reflector VSPro – ComponentOne Enterprise Studio Suite – Pluralsight yearly subscriptions – CodeSmith Tools Generator Pro Personal – JetBrains ReSharper – Semos Education Training Voucher – and many more…