SlideShare une entreprise Scribd logo
1  sur  109
Télécharger pour lire hors ligne
Rediscovering
Modularity
Chris Chedgey
Structure101
@chedgey


Stuttgart, Munich, Nuremberg
November 20th – 22nd 2012
Modularity
Manage complexity
       by
Encapsulation
Information hiding



  Modularity
  Manage complexity
         by
  Encapsulation
Information hiding
Defined interface



                Modularity
                Manage complexity
                       by
                Encapsulation
Information hiding
Defined interface
                                 Clear responsibility


                Modularity
                Manage complexity
                       by
                Encapsulation
Information hiding
Defined interface
                                 Clear responsibility


                Modularity
                Manage complexity
                       by
                Encapsulation
 Cohesion
Information hiding
Defined interface
                                 Clear responsibility


                Modularity
                Manage complexity
                       by
                Encapsulation
 Cohesion
                    Coupling
Information hiding
Defined interface
                                 Clear responsibility


                Modularity
                Manage complexity
                       by
                Encapsulation
 Cohesion
                    Coupling          Abstraction
Information hiding Clear responsibility
 Defined interface




                         Coupling Abstraction
Encapsulation
              Cohesion
Information hiding Clear responsibility
 Defined interface




                         Coupling Abstraction
Encapsulation
              Cohesion        Modularity
Complexity

             Composition
Complexity

                Composition

   Cyclomatic
   Complexity
     (CC)
(same problem)
Information hiding Clear responsibility
 Defined interface




                         Coupling Abstraction
Encapsulation
              Cohesion        Modularity
Complexity

                Composition

   Cyclomatic
   Complexity
     (CC)
Complexity

                Composition
Compositional
 Complexity
   (CC)
Packages



       Classes
Information hiding?Clear responsibility
  Defined interface?




                       Coupling? Abstraction
Encapsulation
            Cohesion       Modularity?
Complexity

                Composition

Compositional
 Complexity
   (CC)
Complexity

                Composition

Compositional
 Complexity       +Hierarchical
   (CC)            => Scalable
Coupling
Dependencies
Dependencies
“Tangles”
=
=


    Not scalable!!
Ideally…
Start with a loose “architecture”
Ideally…
Start with a loose “architecture”
Let suitable architecture emerge, without “baggage”
Ideally…
Start with a loose “architecture”
Let suitable architecture emerge, without “baggage”
At some point stronger, higher-level abstractions are needed
Ideally…
Start with a loose “architecture”
Let suitable architecture emerge, without “baggage”
At some point stronger, higher-level abstractions are needed
(~50Kloc – Martin, Foote)
Ideally…
Start with a loose “architecture”
Let suitable architecture emerge, without “baggage”
At some point stronger, higher-level abstractions are needed
(~50Kloc – Martin, Foote)
Restructure to defined architecture
Ideally…
Start with a loose “architecture”
Let suitable architecture emerge, without “baggage”
At some point stronger, higher-level abstractions are needed
(~50Kloc – Martin, Foote)
Restructure to defined architecture
Iterate with development
Ideally…
Start with a loose “architecture”
Let suitable architecture emerge, without “baggage”
At some point stronger, higher-level abstractions are needed
(~50Kloc – Martin, Foote)
Restructure to defined architecture
Iterate with development
Strengthen with growth
0.7.2
Mar „04
0.8.6
Oct „04
0.8.7
Apr „05
Erosion


 “Sometimes the developers manage to maintain this purity of design
   through the initial development and into the first release. More often
  something goes wrong. The software starts to rot like a piece of bad
                                  meat.”


Bob Martin, “Agile Software Development”
0.8.8
May „05
1.0.0
Jun „06
1.3.0
Nov „07
1.3.5
Sep „08
Cost…
Cost…
  Miserable developers
Cost…
  Miserable developers
  Cost per feature increases
Cost…
  Miserable developers
  Cost per feature increases
  Unexpected impacts of change
Cost…
  Miserable developers
  Cost per feature increases
  Unexpected impacts of change
  Unreliable schedules
Cost…
  Miserable developers
  Cost per feature increases
  Unexpected impacts of change
  Unreliable schedules
  Test cycles increase
Cost…
  Miserable developers
  Cost per feature increases
  Unexpected impacts of change
  Unreliable schedules
  Test cycles increase
  Reuse less
Cost…
  Miserable developers
  Cost per feature increases
  Unexpected impacts of change
  Unreliable schedules
  Test cycles increase
  Reuse less
  Value of your code base declines
Technical Debt
Technical Debt
Technical Debt
Technical Debt
Abstraction
Abstraction
Abstraction
Abstraction
Abstraction
Abstraction
Abstraction
Abstraction
Refactoring   Restructuring
Refactoring                  Restructuring
•   “Changing code without   •   “Reorganizing a code-base
    modifying behavior to        without modifying the code to
    improve nonfunctional        improve modularity”
    attributes.”
Refactoring                  Restructuring
•   “Changing code without   •   “Reorganizing a code-base
    modifying behavior to        without modifying the code to
    improve nonfunctional        improve modularity”
    attributes.”
                             •   Code-base is understandable
•   Code is readable
Refactoring                          Restructuring
•   “Changing code without           •   “Reorganizing a code-base
    modifying behavior to                without modifying the code to
    improve nonfunctional                improve modularity”
    attributes.”
                                     •   Code-base is understandable
•   Code is readable
                                     •   Minimal invasive code editing
•   A lot of invasive code editing
Refactoring                           Restructuring
•   “Changing code without            •   “Reorganizing a code-base
    modifying behavior to improve         without modifying the code to
    nonfunctional attributes.”            improve modularity”
•   Code is readable                  •   Code-base is understandable
•   A lot of invasive code editing    •   Minimal invasive code editing
•   Scope: small worlds of a few      •   Scope: whole code base; what
    classes at a time; what you see       you don‟t see in the IDE
    in the IDE.
Retrofitting…
Retrofitting…
Physical or virtual?
Retrofitting…
Physical or virtual?
Top-down or bottom-up?
Retrofitting…
Physical or virtual?
Top-down or bottom-up?
Bust big class tangles
Retrofitting…
Physical or virtual?
Top-down or bottom-up?
Bust big class tangles
Create a structured model (levelized+CC) (use strategies)
Retrofitting…
Physical or virtual?
Top-down or bottom-up?
Bust big class tangles
Create a structured model (levelized+CC) (use strategies)
Adjust module boundaries (strengthen abstractions)
Retrofitting…
Physical or virtual?
Top-down or bottom-up?
Bust big class tangles
Create a structured model (levelized+CC) (use strategies)
Adjust module boundaries (strengthen abstractions)
Define layers, visibility
Retrofitting…
Physical or virtual?
Top-down or bottom-up?
Bust big class tangles
Create a structured model (levelized+CC) (use strategies)
Adjust module boundaries (strengthen abstractions)
Define layers, visibility
Repair violations in the implementation levels
Structure101
Restructure101

  Structure101
Restructure101

                  Structure101
Visualization
Restructure101

  Structure101
Architecture   •   defined, communicated, enforced

 Modularity    •   interfaces, responsibility

  Structure    •   encapsulation, coupling

       Mud     •
                               Thank you!
                               Structure101
                               @chedgey

Contenu connexe

Similaire à Rediscovering Modularity - Java User Groups, Stuttgart, Munich, Nuremberg, November 2012

Bridging the Divide between Architecture and Code (Germany JUGs version)
Bridging the Divide between Architecture and Code (Germany JUGs version)Bridging the Divide between Architecture and Code (Germany JUGs version)
Bridging the Divide between Architecture and Code (Germany JUGs version)
Chris Chedgey
 
Framework Engineering_Final
Framework Engineering_FinalFramework Engineering_Final
Framework Engineering_Final
YoungSu Son
 
Code Structural Analysis
Code Structural AnalysisCode Structural Analysis
Code Structural Analysis
Dmitry Buzdin
 
Agile Architecture Tech And Patterns
Agile Architecture   Tech And PatternsAgile Architecture   Tech And Patterns
Agile Architecture Tech And Patterns
pragkirk
 
Improving software econimics
Improving software econimicsImproving software econimics
Improving software econimics
Kalica Wadhwa
 
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
Spark Summit
 

Similaire à Rediscovering Modularity - Java User Groups, Stuttgart, Munich, Nuremberg, November 2012 (20)

Bridging the Divide between Architecture and Code (Germany JUGs version)
Bridging the Divide between Architecture and Code (Germany JUGs version)Bridging the Divide between Architecture and Code (Germany JUGs version)
Bridging the Divide between Architecture and Code (Germany JUGs version)
 
Bridging the divide between architecture and code (US version)
Bridging the divide between architecture and code (US version)Bridging the divide between architecture and code (US version)
Bridging the divide between architecture and code (US version)
 
Framework Engineering_Final
Framework Engineering_FinalFramework Engineering_Final
Framework Engineering_Final
 
Design Principles
Design PrinciplesDesign Principles
Design Principles
 
Phil Bracikowski [InfluxData] | InfluxDB Cloud Durability Walkthrough | Influ...
Phil Bracikowski [InfluxData] | InfluxDB Cloud Durability Walkthrough | Influ...Phil Bracikowski [InfluxData] | InfluxDB Cloud Durability Walkthrough | Influ...
Phil Bracikowski [InfluxData] | InfluxDB Cloud Durability Walkthrough | Influ...
 
Code Structural Analysis
Code Structural AnalysisCode Structural Analysis
Code Structural Analysis
 
Code Structural Analysis
Code Structural AnalysisCode Structural Analysis
Code Structural Analysis
 
Knowledge Management with K-Infinity
Knowledge Management with K-InfinityKnowledge Management with K-Infinity
Knowledge Management with K-Infinity
 
Managing modular software for your nu get, c++ and java development
Managing modular software for your nu get, c++ and java developmentManaging modular software for your nu get, c++ and java development
Managing modular software for your nu get, c++ and java development
 
Using MongoDB to Build a Fast and Scalable Content Repository
Using MongoDB to Build a Fast and Scalable Content RepositoryUsing MongoDB to Build a Fast and Scalable Content Repository
Using MongoDB to Build a Fast and Scalable Content Repository
 
Paolo Kreth - Persistence layers for microservices – the converged database a...
Paolo Kreth - Persistence layers for microservices – the converged database a...Paolo Kreth - Persistence layers for microservices – the converged database a...
Paolo Kreth - Persistence layers for microservices – the converged database a...
 
Microservices, Kubernetes, and Application Modernization Done Right
Microservices, Kubernetes, and Application Modernization Done RightMicroservices, Kubernetes, and Application Modernization Done Right
Microservices, Kubernetes, and Application Modernization Done Right
 
Agile integration: Decomposing the monolith
Agile integration: Decomposing the monolithAgile integration: Decomposing the monolith
Agile integration: Decomposing the monolith
 
Agile Architecture Tech And Patterns
Agile Architecture   Tech And PatternsAgile Architecture   Tech And Patterns
Agile Architecture Tech And Patterns
 
Improving software econimics
Improving software econimicsImproving software econimics
Improving software econimics
 
Cut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
Cut your Dependencies with Dependency Injection - .NET User Group OsnabrueckCut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
Cut your Dependencies with Dependency Injection - .NET User Group Osnabrueck
 
How the right architecture can simplify migrating to Kotlin
How the right architecture can simplify migrating to KotlinHow the right architecture can simplify migrating to Kotlin
How the right architecture can simplify migrating to Kotlin
 
Dependency Inversion in large-scale TypeScript applications with InversifyJS
Dependency Inversion in large-scale TypeScript applications with InversifyJSDependency Inversion in large-scale TypeScript applications with InversifyJS
Dependency Inversion in large-scale TypeScript applications with InversifyJS
 
Docker?!?! But I'm a SysAdmin
Docker?!?! But I'm a SysAdminDocker?!?! But I'm a SysAdmin
Docker?!?! But I'm a SysAdmin
 
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
Optimizing Spark Deployments for Containers: Isolation, Safety, and Performan...
 

Rediscovering Modularity - Java User Groups, Stuttgart, Munich, Nuremberg, November 2012