SlideShare a Scribd company logo
1 of 29
SOLID
Single Responsibility Principle
           Open/Closed Principle

                       Dennis van der Stelt               Pascal de Jonge
                          Software Architect            Development Lead
                                      Tellus                         Tellus
      http://bloggingabout.net/blogs/dennis/   http://www.pazquality.com/
                                  @dvdstelt                   @pdejonge
                        dvdstelt@tellus.com           pdejonge@tellus.com




                                                    Software Development Network 2013
Software Development Network 2013
AGENDA




         Software Development Network 2013
SOLID
History




          Software Development Network 2013
Guidance




   Software Development Network 2013
SOLID
Five principles




       Single Responsibility                        SOLID                   Open/Closed




        Liskov Substitution                 Interface Seggregation      Dependency Inversion




     Learn them, love them, live by them…




                                                                     Software Development Network 2013
Software Craftsmanship
is really, really, ridiculously good looking code


                                            Software Development Network 2013
SOLID
Books




        Software Development Network 2013
SOLID
Single Responsibility Principle




                                  Software Development Network 2013
SINGLE RESPONSIBILITY PRINCIPLE




                 there should never be more than
                 one reason for a class to change




                                  Software Development Network 2013
SINGLE RESPONSIBILITY PRINCIPLE




 just because you can, doesn’t mean you should

                                  Software Development Network 2013
SINGLE RESPONSIBILITY PRINCIPLE


Rules that apply to classes
 rule                                            rule   same goes for methods,
           they should be small                         which we count by #
01                                               03     lines
 rule                                            rule
           they should be smaller                       how to measure class
02         than that                             04     size?


        Responsibility : “a reason for change”




                                                              Software Development Network 2013
SINGLE RESPONSIBILITY PRINCIPLE
Why would we want to separate responsibilities?




                                                  Software Development Network 2013
SINGLE RESPONSIBILITY PRINCIPLE
Why would we want to separate responsibilities?




                                                  Software Development Network 2013
SINGLE RESPONSIBILITY PRINCIPLE

Sometimes hard to see…
interface IModem
{
    void Dial(string phoneNumber);
    void Hangup();
    void Send(char c);
    char Receive();
}




                                     Software Development Network 2013
SINGLE RESPONSIBILITY PRINCIPLE
 public interface IConnection
 {
     void Dial(string phoneNumber);
     void Hangup();
 }


 public interface IDataChannel
 {
     void Send(char c);
     char Receive();
 }


 public class Modem
 {
     public Modem(IConnection connection, IDataChannel dataChannel)
     {
         // ...
     }
 }


                                                                 Software Development Network 2013
SINGLE RESPONSIBILITY PRINCIPLE

                     Rule of thumb
             If you can’t come up with a
  name for your class, it’s probably doing too much!




                                        Software Development Network 2013
DEMO
InvoiceCreator




                 Software Development Network 2013
SINGLE RESPONSIBILITY PRINCIPLE
 Violation


• God class unneeded complexity
  Don’t create
• However
   public class OrderService
  {
      public   Order Get(int orderId) { }
      public   Order Get(string name) { }
      public   Order Save(Order order) { }
      public   Order SubmitOrder(Order order) { }
      public   void CancelOrder(Order order) { }
      public   void ProcessOrderReturn(int orderId) { }
      public   void ShipOrder(Order order) { }
  }


                                               Software Development Network 2013
more classes != more
      complex




                       Software Development Network 2013
Software Development Network 2013
SOLID
Open/Closed Principle




                        Software Development Network 2013
OPEN/CLOSED PRINCIPLE




               software entities should be open for
                    extension, but closed for
                          modification




                                 Software Development Network 2013
OPEN/CLOSED PRINCIPLE
Non changed code doesn’t need new…




                                     Software Development Network 2013
DEMO
Useful patterns




                  Software Development Network 2013
TEMPLATE METHOD PATTERN



           AbstractBase class
 Program          Initialize
               SendMessage
                  Finalize
                  Execute

           EmailSende
           r

               SendMessage




                                Software Development Network 2013
Software Development Network 2013
CONCLUSION




  Single Responsibility           SOLID                   Open/Closed




   Liskov Substitution    Interface Seggregation      Dependency Inversion




                                                   Software Development Network 2013
Thank you
                                            questions?

                 Dennis van der Stelt               Pascal de Jonge
                    Software Architect            Development Lead
                                Tellus                         Tellus
http://bloggingabout.net/blogs/dennis/   http://www.pazquality.com/
                            @dvdstelt                   @pdejonge
                  dvdstelt@tellus.com           pdejonge@tellus.com




                                                                        33
                                              Software Development Network 2013

More Related Content

What's hot

SOLID Design Principles applied in Java
SOLID Design Principles applied in JavaSOLID Design Principles applied in Java
SOLID Design Principles applied in JavaIonut Bilica
 
Object Oriented Design Principles
Object Oriented Design PrinciplesObject Oriented Design Principles
Object Oriented Design PrinciplesThang Tran Duc
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design PrinciplesSamuel Breed
 
Learning solid principles using c#
Learning solid principles using c#Learning solid principles using c#
Learning solid principles using c#Aditya Kumar Rajan
 
Writing Maintainable Software Using SOLID Principles
Writing Maintainable Software Using SOLID PrinciplesWriting Maintainable Software Using SOLID Principles
Writing Maintainable Software Using SOLID PrinciplesDoug Jones
 
3.o o design -_____________lecture 3
3.o o design -_____________lecture 33.o o design -_____________lecture 3
3.o o design -_____________lecture 3Warui Maina
 
S.O.L.I.D. Principles for Software Architects
S.O.L.I.D. Principles for Software ArchitectsS.O.L.I.D. Principles for Software Architects
S.O.L.I.D. Principles for Software ArchitectsRicardo Wilkins
 
Introduction to Object Oriented Design
Introduction to Object Oriented DesignIntroduction to Object Oriented Design
Introduction to Object Oriented DesignOleg Yaroshevych
 
Refactoring for Software Design Smells
Refactoring for Software Design SmellsRefactoring for Software Design Smells
Refactoring for Software Design SmellsGanesh Samarthyam
 
Refactoring Applications using SOLID Principles
Refactoring Applications using SOLID PrinciplesRefactoring Applications using SOLID Principles
Refactoring Applications using SOLID PrinciplesSteven Smith
 
"SOLID" Object Oriented Design Principles
"SOLID" Object Oriented Design Principles"SOLID" Object Oriented Design Principles
"SOLID" Object Oriented Design PrinciplesSerhiy Oplakanets
 
The Open Closed Principle - Part 1 - The Original Version
The Open Closed Principle - Part 1 - The Original VersionThe Open Closed Principle - Part 1 - The Original Version
The Open Closed Principle - Part 1 - The Original VersionPhilip Schwarz
 
Design poo my_jug_en_ppt
Design poo my_jug_en_pptDesign poo my_jug_en_ppt
Design poo my_jug_en_pptagnes_crepet
 
Applying Design Principles in Practice
Applying Design Principles in PracticeApplying Design Principles in Practice
Applying Design Principles in PracticeTushar Sharma
 
CodeCamp Iasi 10 march 2012 - Scratching-SOLID
CodeCamp Iasi 10 march 2012 - Scratching-SOLIDCodeCamp Iasi 10 march 2012 - Scratching-SOLID
CodeCamp Iasi 10 march 2012 - Scratching-SOLIDCodecamp Romania
 
Principles of Object Oriented Design
Principles of Object Oriented DesignPrinciples of Object Oriented Design
Principles of Object Oriented DesignJon Kartago Lamida
 

What's hot (20)

SOLID Design Principles applied in Java
SOLID Design Principles applied in JavaSOLID Design Principles applied in Java
SOLID Design Principles applied in Java
 
Object Oriented Design Principles
Object Oriented Design PrinciplesObject Oriented Design Principles
Object Oriented Design Principles
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design Principles
 
Learning solid principles using c#
Learning solid principles using c#Learning solid principles using c#
Learning solid principles using c#
 
Writing Maintainable Software Using SOLID Principles
Writing Maintainable Software Using SOLID PrinciplesWriting Maintainable Software Using SOLID Principles
Writing Maintainable Software Using SOLID Principles
 
3.o o design -_____________lecture 3
3.o o design -_____________lecture 33.o o design -_____________lecture 3
3.o o design -_____________lecture 3
 
S.O.L.I.D. Principles for Software Architects
S.O.L.I.D. Principles for Software ArchitectsS.O.L.I.D. Principles for Software Architects
S.O.L.I.D. Principles for Software Architects
 
Principle of OOD
Principle of OODPrinciple of OOD
Principle of OOD
 
Introduction to Object Oriented Design
Introduction to Object Oriented DesignIntroduction to Object Oriented Design
Introduction to Object Oriented Design
 
Refactoring for Software Design Smells
Refactoring for Software Design SmellsRefactoring for Software Design Smells
Refactoring for Software Design Smells
 
Refactoring Applications using SOLID Principles
Refactoring Applications using SOLID PrinciplesRefactoring Applications using SOLID Principles
Refactoring Applications using SOLID Principles
 
IoC and Mapper in C#
IoC and Mapper in C#IoC and Mapper in C#
IoC and Mapper in C#
 
Solid principles
Solid principlesSolid principles
Solid principles
 
"SOLID" Object Oriented Design Principles
"SOLID" Object Oriented Design Principles"SOLID" Object Oriented Design Principles
"SOLID" Object Oriented Design Principles
 
The Open Closed Principle - Part 1 - The Original Version
The Open Closed Principle - Part 1 - The Original VersionThe Open Closed Principle - Part 1 - The Original Version
The Open Closed Principle - Part 1 - The Original Version
 
Design poo my_jug_en_ppt
Design poo my_jug_en_pptDesign poo my_jug_en_ppt
Design poo my_jug_en_ppt
 
Applying Design Principles in Practice
Applying Design Principles in PracticeApplying Design Principles in Practice
Applying Design Principles in Practice
 
CodeCamp Iasi 10 march 2012 - Scratching-SOLID
CodeCamp Iasi 10 march 2012 - Scratching-SOLIDCodeCamp Iasi 10 march 2012 - Scratching-SOLID
CodeCamp Iasi 10 march 2012 - Scratching-SOLID
 
Design Smells
Design SmellsDesign Smells
Design Smells
 
Principles of Object Oriented Design
Principles of Object Oriented DesignPrinciples of Object Oriented Design
Principles of Object Oriented Design
 

Viewers also liked

Open Closed Principle kata
Open Closed Principle kataOpen Closed Principle kata
Open Closed Principle kataPaul Blundell
 
Smolen Alex Securing The Mvc Architecture Part Two
Smolen Alex Securing The Mvc Architecture Part TwoSmolen Alex Securing The Mvc Architecture Part Two
Smolen Alex Securing The Mvc Architecture Part Twoalsmola
 
Solid principles
Solid principlesSolid principles
Solid principlesViet Vu
 
Open Close Principle
Open Close PrincipleOpen Close Principle
Open Close PrincipleThaichor Seng
 
Implementing The Open/Closed Principle
Implementing The Open/Closed PrincipleImplementing The Open/Closed Principle
Implementing The Open/Closed PrincipleSam Hennessy
 
STL ALGORITHMS
STL ALGORITHMSSTL ALGORITHMS
STL ALGORITHMSfawzmasood
 
Operator overloading
Operator overloadingOperator overloading
Operator overloadingfarhan amjad
 
Improving The Quality of Existing Software
Improving The Quality of Existing SoftwareImproving The Quality of Existing Software
Improving The Quality of Existing SoftwareSteven Smith
 
C++ Advanced
C++ AdvancedC++ Advanced
C++ AdvancedVivek Das
 
Bjarne Stroustrup - The Essence of C++: With Examples in C++84, C++98, C++11,...
Bjarne Stroustrup - The Essence of C++: With Examples in C++84, C++98, C++11,...Bjarne Stroustrup - The Essence of C++: With Examples in C++84, C++98, C++11,...
Bjarne Stroustrup - The Essence of C++: With Examples in C++84, C++98, C++11,...Complement Verb
 

Viewers also liked (20)

Open Closed Principle kata
Open Closed Principle kataOpen Closed Principle kata
Open Closed Principle kata
 
Dependency Inversion Principle
Dependency Inversion PrincipleDependency Inversion Principle
Dependency Inversion Principle
 
SOLID Principles part 2
SOLID Principles part 2SOLID Principles part 2
SOLID Principles part 2
 
Smolen Alex Securing The Mvc Architecture Part Two
Smolen Alex Securing The Mvc Architecture Part TwoSmolen Alex Securing The Mvc Architecture Part Two
Smolen Alex Securing The Mvc Architecture Part Two
 
Solid principles
Solid principlesSolid principles
Solid principles
 
Open Close Principle
Open Close PrincipleOpen Close Principle
Open Close Principle
 
jeas_0816_4883
jeas_0816_4883jeas_0816_4883
jeas_0816_4883
 
[Webinar] Refatoração em PHP
[Webinar] Refatoração em PHP[Webinar] Refatoração em PHP
[Webinar] Refatoração em PHP
 
Implementing The Open/Closed Principle
Implementing The Open/Closed PrincipleImplementing The Open/Closed Principle
Implementing The Open/Closed Principle
 
The Style of C++ 11
The Style of C++ 11The Style of C++ 11
The Style of C++ 11
 
Idiomatic C++
Idiomatic C++Idiomatic C++
Idiomatic C++
 
Distributed Systems Design
Distributed Systems DesignDistributed Systems Design
Distributed Systems Design
 
STL ALGORITHMS
STL ALGORITHMSSTL ALGORITHMS
STL ALGORITHMS
 
Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
Improving The Quality of Existing Software
Improving The Quality of Existing SoftwareImproving The Quality of Existing Software
Improving The Quality of Existing Software
 
C++ Advanced
C++ AdvancedC++ Advanced
C++ Advanced
 
Web Service Basics and NWS Setup
Web Service  Basics and NWS SetupWeb Service  Basics and NWS Setup
Web Service Basics and NWS Setup
 
Bjarne Stroustrup - The Essence of C++: With Examples in C++84, C++98, C++11,...
Bjarne Stroustrup - The Essence of C++: With Examples in C++84, C++98, C++11,...Bjarne Stroustrup - The Essence of C++: With Examples in C++84, C++98, C++11,...
Bjarne Stroustrup - The Essence of C++: With Examples in C++84, C++98, C++11,...
 
SOLID principles
SOLID principlesSOLID principles
SOLID principles
 
Operator overloading
Operator overloading Operator overloading
Operator overloading
 

Similar to SOLID Principles part 1

ElizabethPrattConsulting_DellPortfolio
ElizabethPrattConsulting_DellPortfolioElizabethPrattConsulting_DellPortfolio
ElizabethPrattConsulting_DellPortfolioLiz Pratt
 
JDXA, The KISS ORM for Android
JDXA, The KISS ORM for AndroidJDXA, The KISS ORM for Android
JDXA, The KISS ORM for AndroidDamodar Periwal
 
It’s All About Developers. Discover Cisco DevNet. - Jason Goecke - Codemotion...
It’s All About Developers. Discover Cisco DevNet. - Jason Goecke - Codemotion...It’s All About Developers. Discover Cisco DevNet. - Jason Goecke - Codemotion...
It’s All About Developers. Discover Cisco DevNet. - Jason Goecke - Codemotion...Codemotion
 
Are You a SOLID Coder?
Are You a SOLID Coder?Are You a SOLID Coder?
Are You a SOLID Coder?Steve Green
 
Curious Coders Java Web Frameworks Comparison
Curious Coders Java Web Frameworks ComparisonCurious Coders Java Web Frameworks Comparison
Curious Coders Java Web Frameworks ComparisonHamed Hatami
 
Create first android app with MVVM Architecture
Create first android app with MVVM ArchitectureCreate first android app with MVVM Architecture
Create first android app with MVVM Architecturekhushbu thakker
 
Applying DevOps, PaaS and cloud for better citizen service outcomes - IBM Fe...
Applying DevOps, PaaS and cloud for better citizen service  outcomes - IBM Fe...Applying DevOps, PaaS and cloud for better citizen service  outcomes - IBM Fe...
Applying DevOps, PaaS and cloud for better citizen service outcomes - IBM Fe...Sanjeev Sharma
 
From desktop to the cloud, cutting costs with Virtual kubelet and ACI
From desktop to the cloud, cutting costs with Virtual kubelet and ACIFrom desktop to the cloud, cutting costs with Virtual kubelet and ACI
From desktop to the cloud, cutting costs with Virtual kubelet and ACIAdi Polak
 
GDSC NIET ORIENTATION ).pdf
GDSC NIET ORIENTATION ).pdfGDSC NIET ORIENTATION ).pdf
GDSC NIET ORIENTATION ).pdfYashiGupta410690
 
.NET Architecture for Enterprises
.NET Architecture for Enterprises.NET Architecture for Enterprises
.NET Architecture for EnterprisesWade Wegner
 
JAVA Magazine Sep-Oct 2013
JAVA Magazine Sep-Oct 2013JAVA Magazine Sep-Oct 2013
JAVA Magazine Sep-Oct 2013Erik Gur
 
Pense fora da caixa: Aplique Agilidade com Domain Driven Design. Você ainda u...
Pense fora da caixa: Aplique Agilidade com Domain Driven Design. Você ainda u...Pense fora da caixa: Aplique Agilidade com Domain Driven Design. Você ainda u...
Pense fora da caixa: Aplique Agilidade com Domain Driven Design. Você ainda u...Yan Justino
 
Dependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and PatternsDependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and PatternsJuan Lopez
 
Deploy Angular to the Cloud
Deploy Angular to the CloudDeploy Angular to the Cloud
Deploy Angular to the CloudSimona Cotin
 
Intro to Open Cloud Initiative
Intro to Open Cloud InitiativeIntro to Open Cloud Initiative
Intro to Open Cloud InitiativeJohn Mark Walker
 
bGenius kennissessie_20120510
bGenius kennissessie_20120510bGenius kennissessie_20120510
bGenius kennissessie_20120510bgenius
 
Gdsc lbce offline accelerator meet -1
Gdsc lbce offline accelerator meet -1Gdsc lbce offline accelerator meet -1
Gdsc lbce offline accelerator meet -1Diksha71
 
CampDevOps keynote - DevOps: Using 'Lean' to eliminate Bottlenecks
CampDevOps keynote - DevOps: Using 'Lean' to eliminate BottlenecksCampDevOps keynote - DevOps: Using 'Lean' to eliminate Bottlenecks
CampDevOps keynote - DevOps: Using 'Lean' to eliminate BottlenecksSanjeev Sharma
 
JavaOne 2015: 14 Key Lessons, you should learn
JavaOne 2015: 14 Key Lessons, you should learnJavaOne 2015: 14 Key Lessons, you should learn
JavaOne 2015: 14 Key Lessons, you should learnACA IT-Solutions
 

Similar to SOLID Principles part 1 (20)

ElizabethPrattConsulting_DellPortfolio
ElizabethPrattConsulting_DellPortfolioElizabethPrattConsulting_DellPortfolio
ElizabethPrattConsulting_DellPortfolio
 
JDXA, The KISS ORM for Android
JDXA, The KISS ORM for AndroidJDXA, The KISS ORM for Android
JDXA, The KISS ORM for Android
 
It’s All About Developers. Discover Cisco DevNet. - Jason Goecke - Codemotion...
It’s All About Developers. Discover Cisco DevNet. - Jason Goecke - Codemotion...It’s All About Developers. Discover Cisco DevNet. - Jason Goecke - Codemotion...
It’s All About Developers. Discover Cisco DevNet. - Jason Goecke - Codemotion...
 
Are You a SOLID Coder?
Are You a SOLID Coder?Are You a SOLID Coder?
Are You a SOLID Coder?
 
Curious Coders Java Web Frameworks Comparison
Curious Coders Java Web Frameworks ComparisonCurious Coders Java Web Frameworks Comparison
Curious Coders Java Web Frameworks Comparison
 
Create first android app with MVVM Architecture
Create first android app with MVVM ArchitectureCreate first android app with MVVM Architecture
Create first android app with MVVM Architecture
 
Applying DevOps, PaaS and cloud for better citizen service outcomes - IBM Fe...
Applying DevOps, PaaS and cloud for better citizen service  outcomes - IBM Fe...Applying DevOps, PaaS and cloud for better citizen service  outcomes - IBM Fe...
Applying DevOps, PaaS and cloud for better citizen service outcomes - IBM Fe...
 
From desktop to the cloud, cutting costs with Virtual kubelet and ACI
From desktop to the cloud, cutting costs with Virtual kubelet and ACIFrom desktop to the cloud, cutting costs with Virtual kubelet and ACI
From desktop to the cloud, cutting costs with Virtual kubelet and ACI
 
GDSC NIET ORIENTATION ).pdf
GDSC NIET ORIENTATION ).pdfGDSC NIET ORIENTATION ).pdf
GDSC NIET ORIENTATION ).pdf
 
.NET Architecture for Enterprises
.NET Architecture for Enterprises.NET Architecture for Enterprises
.NET Architecture for Enterprises
 
JAVA Magazine Sep-Oct 2013
JAVA Magazine Sep-Oct 2013JAVA Magazine Sep-Oct 2013
JAVA Magazine Sep-Oct 2013
 
Pense fora da caixa: Aplique Agilidade com Domain Driven Design. Você ainda u...
Pense fora da caixa: Aplique Agilidade com Domain Driven Design. Você ainda u...Pense fora da caixa: Aplique Agilidade com Domain Driven Design. Você ainda u...
Pense fora da caixa: Aplique Agilidade com Domain Driven Design. Você ainda u...
 
Dependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and PatternsDependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and Patterns
 
Deploy Angular to the Cloud
Deploy Angular to the CloudDeploy Angular to the Cloud
Deploy Angular to the Cloud
 
Intro to Open Cloud Initiative
Intro to Open Cloud InitiativeIntro to Open Cloud Initiative
Intro to Open Cloud Initiative
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
bGenius kennissessie_20120510
bGenius kennissessie_20120510bGenius kennissessie_20120510
bGenius kennissessie_20120510
 
Gdsc lbce offline accelerator meet -1
Gdsc lbce offline accelerator meet -1Gdsc lbce offline accelerator meet -1
Gdsc lbce offline accelerator meet -1
 
CampDevOps keynote - DevOps: Using 'Lean' to eliminate Bottlenecks
CampDevOps keynote - DevOps: Using 'Lean' to eliminate BottlenecksCampDevOps keynote - DevOps: Using 'Lean' to eliminate Bottlenecks
CampDevOps keynote - DevOps: Using 'Lean' to eliminate Bottlenecks
 
JavaOne 2015: 14 Key Lessons, you should learn
JavaOne 2015: 14 Key Lessons, you should learnJavaOne 2015: 14 Key Lessons, you should learn
JavaOne 2015: 14 Key Lessons, you should learn
 

More from Dennis van der Stelt

More from Dennis van der Stelt (16)

Change your architecture during deployment
Change your architecture during deploymentChange your architecture during deployment
Change your architecture during deployment
 
Dealing with eventual consistency
Dealing with eventual consistencyDealing with eventual consistency
Dealing with eventual consistency
 
Dealing with eventual consistency
Dealing with eventual consistencyDealing with eventual consistency
Dealing with eventual consistency
 
Death of the batch job
Death of the batch jobDeath of the batch job
Death of the batch job
 
Death of the batch job - NServiceBus Sagas
Death of the batch job - NServiceBus SagasDeath of the batch job - NServiceBus Sagas
Death of the batch job - NServiceBus Sagas
 
Distributed Systems Principles
Distributed Systems PrinciplesDistributed Systems Principles
Distributed Systems Principles
 
Building reliable applications with messaging
Building reliable applications with messagingBuilding reliable applications with messaging
Building reliable applications with messaging
 
Distributed Systems principles
Distributed Systems principlesDistributed Systems principles
Distributed Systems principles
 
Een andere kijk op Microservices
Een andere kijk op MicroservicesEen andere kijk op Microservices
Een andere kijk op Microservices
 
Duplicating data or replicating data in Micro Services
Duplicating data or replicating data in Micro ServicesDuplicating data or replicating data in Micro Services
Duplicating data or replicating data in Micro Services
 
LIDNUG : Reliable applications with messaging
LIDNUG : Reliable applications with messagingLIDNUG : Reliable applications with messaging
LIDNUG : Reliable applications with messaging
 
Silverlight & WCF RIA
Silverlight & WCF RIASilverlight & WCF RIA
Silverlight & WCF RIA
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
AppFabric Velocity
AppFabric VelocityAppFabric Velocity
AppFabric Velocity
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
App fabric introduction
App fabric introductionApp fabric introduction
App fabric introduction
 

Recently uploaded

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 

Recently uploaded (20)

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 

SOLID Principles part 1

  • 1. SOLID Single Responsibility Principle Open/Closed Principle Dennis van der Stelt Pascal de Jonge Software Architect Development Lead Tellus Tellus http://bloggingabout.net/blogs/dennis/ http://www.pazquality.com/ @dvdstelt @pdejonge dvdstelt@tellus.com pdejonge@tellus.com Software Development Network 2013
  • 3. AGENDA Software Development Network 2013
  • 4. SOLID History Software Development Network 2013
  • 5. Guidance Software Development Network 2013
  • 6. SOLID Five principles Single Responsibility SOLID Open/Closed Liskov Substitution Interface Seggregation Dependency Inversion Learn them, love them, live by them… Software Development Network 2013
  • 7. Software Craftsmanship is really, really, ridiculously good looking code Software Development Network 2013
  • 8. SOLID Books Software Development Network 2013
  • 9. SOLID Single Responsibility Principle Software Development Network 2013
  • 10. SINGLE RESPONSIBILITY PRINCIPLE there should never be more than one reason for a class to change Software Development Network 2013
  • 11. SINGLE RESPONSIBILITY PRINCIPLE just because you can, doesn’t mean you should Software Development Network 2013
  • 12. SINGLE RESPONSIBILITY PRINCIPLE Rules that apply to classes rule rule same goes for methods, they should be small which we count by # 01 03 lines rule rule they should be smaller how to measure class 02 than that 04 size? Responsibility : “a reason for change” Software Development Network 2013
  • 13. SINGLE RESPONSIBILITY PRINCIPLE Why would we want to separate responsibilities? Software Development Network 2013
  • 14. SINGLE RESPONSIBILITY PRINCIPLE Why would we want to separate responsibilities? Software Development Network 2013
  • 15. SINGLE RESPONSIBILITY PRINCIPLE Sometimes hard to see… interface IModem { void Dial(string phoneNumber); void Hangup(); void Send(char c); char Receive(); } Software Development Network 2013
  • 16. SINGLE RESPONSIBILITY PRINCIPLE public interface IConnection { void Dial(string phoneNumber); void Hangup(); } public interface IDataChannel { void Send(char c); char Receive(); } public class Modem { public Modem(IConnection connection, IDataChannel dataChannel) { // ... } } Software Development Network 2013
  • 17. SINGLE RESPONSIBILITY PRINCIPLE Rule of thumb If you can’t come up with a name for your class, it’s probably doing too much! Software Development Network 2013
  • 18. DEMO InvoiceCreator Software Development Network 2013
  • 19. SINGLE RESPONSIBILITY PRINCIPLE Violation • God class unneeded complexity Don’t create • However public class OrderService { public Order Get(int orderId) { } public Order Get(string name) { } public Order Save(Order order) { } public Order SubmitOrder(Order order) { } public void CancelOrder(Order order) { } public void ProcessOrderReturn(int orderId) { } public void ShipOrder(Order order) { } } Software Development Network 2013
  • 20. more classes != more complex Software Development Network 2013
  • 22. SOLID Open/Closed Principle Software Development Network 2013
  • 23. OPEN/CLOSED PRINCIPLE software entities should be open for extension, but closed for modification Software Development Network 2013
  • 24. OPEN/CLOSED PRINCIPLE Non changed code doesn’t need new… Software Development Network 2013
  • 25. DEMO Useful patterns Software Development Network 2013
  • 26. TEMPLATE METHOD PATTERN AbstractBase class Program Initialize SendMessage Finalize Execute EmailSende r SendMessage Software Development Network 2013
  • 28. CONCLUSION Single Responsibility SOLID Open/Closed Liskov Substitution Interface Seggregation Dependency Inversion Software Development Network 2013
  • 29. Thank you questions? Dennis van der Stelt Pascal de Jonge Software Architect Development Lead Tellus Tellus http://bloggingabout.net/blogs/dennis/ http://www.pazquality.com/ @dvdstelt @pdejonge dvdstelt@tellus.com pdejonge@tellus.com 33 Software Development Network 2013

Editor's Notes

  1. There are other talks that will go into Big Data and Hadoop so we’ll only do a quick overview of that right now. We’ll spend most of our time on Hive.
  2. 5 basic principles of OOPDIntroduced in 2000By Robert C. Martin (Uncle Bob)Whenapplied, more likelyto have a bettermaintainableandextendable system over time.
  3. Guidelines, not hard rules, not a dogmaUse common senseDon’tjustthrowthemaway
  4. Major problem, as we have toinclude GUI related .dll’stoourGeometryService, but it NEVER uses these.
  5. Major problem, as we have toinclude GUI related .dll’stoourGeometryService, but it NEVER uses these.
  6. What is wrong with this modem interface?Answer :Connection & Data Transfer are combined
  7. What is wrong with this modem interface?Answer :Connection & Data Transfer are combined
  8. Don’tcreatedunneededcomplexityHowever, more classes != more complexityThis is supposedto make your life easier!But noteasiertobelazy
  9. Classes are organized, as top left pictureNot chaos, like bottom right picture
  10. What do you like more?Changing other people’s code?Or writing new code?
  11. OCPExisting code should not be edited when new functionality is added, because…don’tneedto re-test working code;don’tneed new code reviews;don’tneedtoexamindependent code
  12. Some examples of organizations that delivering new value based in the form of revenue growth, cost savings or creating entirely new business models.Yahoo - AS with Hive, Klout - AS with Hive (white paper), GE - Hive AnalyticsYahoo! (Gartner BI Excellence Award Winner) is driving growth for existing revenue streams:Yahoo! manages a powerful, scalable advertising exchange that includes publishers and advertisers.Advertisers want to get the most out of their investment by reaching their targeted audiences effectively and efficiently.Yahoo! needs visibility into how consumers are responding to ads alongmany dimensions (websites, creative, time of day, gender, age, location) to make the exchangework as efficiently and effectivelyas possible.Yahoo! doubled its revenue by allowing campaign managers to “tune” campaign targeting and creative.Yahoo! drove an increase in spending from advertisers since they got better performance by advertising through Yahoo!.Yahoo! TAO exposed customer segment performance to campaign managers and advertisers for the first time.Klout is creating new businesses and revenue streams:Klout’s mission is to help everyone understand and leverage their influence. Klout uses Big Data to unify the social web (consumers, brands, and partners) with social networking and activity, along with data to generate a Klout score and enable analysis, targeting, and social graphs.Helps consumers manage their “social brand.”Helps brands reach influencers at scale.Helps data partners enhance their services (customer loyalty, CRM, media and identity, and marketing). For example, the Palms uses Klout scores in addition to their normal customer rewards program to determine whether or not to upgrade their customers to a better room during their stay. The Huffington Post uses Klout to help serve the best curated Twitter content.Klout Case Study: http://www.microsoft.com/casestudies/Microsoft-SQL-Server-2012-Enterprise/Klout/Data-Services-Firm-Uses-Microsoft-BI-and-Hadoop-to-Boost-Insight-into-Big-Data/710000000129Case Study on Thailand’s Department of Special Investigations : http://www.microsoft.com/casestudies/Microsoft-SQL-Server-2012-Enterprise/Department-of-Special-Investigation/Thai-Law-Enforcement-Agency-Optimizes-Investigations-with-Big-Data-Solution/710000001175 GE is driving operational efficiencies:GE is running several use cases on its Hadoop cluster while incorporating several different disparate sources to produce results. Along with sentiment analysis, GE is running web analytics on its internal cloud structure and looking at load usage, user analytics, and failure mode analytics. GE built a recommendation engine for its intranet involving various press releases users might be interested in based on their function, user profiles, and prior visits to its site. GE is working with several types of remote monitoring and diagnostic data from energy and wind businesses.
  13. Big data is often described as problems that have one or more of the 3 (or 4) Vs – volume, velocity, variety, variability. Think about big data when you describe a problem with terms like tame the chaos, reduce the complexity, explore, I don’t know what I don’t know, unknown unknowns, unstructured, changing quickly, too much for what my environment can handle now, unused data.Volume = more data than the current environment can handle with vertical scaling, need to make sure of data that it is currently too expensive to useVelocity = Small decision window compared to data change rate, ask how quickly you need to analyze and how quickly data arrivesVariety = many different formats that are expensive to integrate, probably from many data sources/feedsVariability = many possible interpretations of the data
  14. Append only, bulk data operations