SlideShare a Scribd company logo
1 of 50
Everything I know about software I
 learned from spaghetti bolognese




        Managing complexity
             Holly Cummins, IBM
              @holly_cummins
            Martijn Verburg, jClarity
                  @karianna
What do we know about software?
Holly               Martijn
11 years with IBM   CTO - jClarity
WebSphere           Diabolical Developer
JVM performance     Community Cat Herder
What do we know about spaghetti?
Common understanding
 No more noodling with code.
Understanding interfaces
My users don't need to know about all my methods
●



I'd like to swap this implementation for that
●


  implementation
Understanding reuse
“Could I re-use some your code in my project,
  please?”

●
    Inheritance vs Composition
       ●
           Inheritance ~= Liskov Substitution Principle
       ●
           Composition ~= Does Type B only want only
            some/part of the behavior exposed by Type A?
Services

              Normal
            spaghetti
           bolognese




            Vegetarian
             spaghetti
            bolognese
Getting hold of implementations
Perpetual problem
●



Factories
●


    ●
        Factory factories
    ●
        Factory factory factories
    ●
        Factory factory factory factories
Home-rolled frameworks
●



META-INF/Services
●



OSGI services
●
Dependency injection
Externalised Factory Problem
●



Enable implementations to be switched in and out
●


●
    Avoids hard-couplings in runtime
●
    Enables effective testing and test-driven-development
        ●
            Implementations can be stubbed or mocked out
●
    Really helps modularity
●
    Guice, Picocontainer are light-weight starting points
What can I do?
●
    Be strict about dependency management
●
    Understand external and internal interfaces
       ●
           What do you want to be able to swap?
●
    Think about what type of re-use you're going for
●
    Draw out dependencies
       ●
           Tooling can help
JAR Hell
Problems with JARs
●
 JARs are transparent




March12, 2010     QCon London 2010   Ian Robinson   12
Problems with JARs
●
    Java Platform Modularity
                Classes encapsulate data                                  Jar
           ●


           ●
                Packages contain classes
                                                                    Package
           ●
                Jars contain packages
                                                                        Class

●
    Class visibility:                                                   Package
           ●
                private                                                       Class
                                                                                 Class
           ●
                package private
                                                                                Package
           ●
                protected
                                                                                    Class
           ●
                public                                                                 Class




●
    No “jar scoped” access modifiers.
March12, 2010                     QCon London 2010   Ian Robinson                              13
Problems with JARs
●
    No means for a jar to declare its
    dependencies.                                               Jar
                                                          Package

●
    No versioning.                                            Class


                                                              Package


    Jars have no modularization
                                                                    Class
●                                                                      Class


     characteristics                                                  Package

                                                                          Class
                                                                             Class


●
    At runtime there is just a collection of
    classes on a global classpath
March12, 2010           QCon London 2010   Ian Robinson                              14
More problems with jars
●
    In a normal jar, an implementation is just as easy to
     use as the interface.

    ●
        In a normal jar, an implementation easier to use than
         the interface
                ●
                    No worries about factory patterns
                ●
                    Encourages consumers to bust encapsulation
                     wide open



March12, 2010                QCon London 2010   Ian Robinson     15
Why classloading is broken




March12, 2010         QCon London 2010   Ian Robinson   16
What can I do?




Don't think JARs, think modules
Modularity Principles
This section is a tooling-free zone.




        Mostly.
Understanding dependencies
What other code does my code touch?
●




What happens if I change my code?
●
Understanding dependencies
●
    What other code does my code touch?

●
    When does it connect?
       ●
           Compile time?
       ●
           Runtime?
       ●
           Transitively?
       ●
           Only at test?
Modularity
Bad Modularity




●
    Dividing up the code != good modularity
●
    Retrofitting modularity is hard
●
    See Michael Feathers' “Dealing with Legacy Code”
Think about modularity from the start
Enforcing modularity with classloaders
Sharing between modules
 OSGi

                                 OSGi



OSGi
                            OSGi
          OSGi
Sharing between modules
A question of scale




●
    Need for modularity grows with size of project
Choose the right granularity
Choose the right granularity
Choose the right granularity
Choose the right granularity
●
    A common approach
       ●
           foo-api
       ●
           foo-core
       ●
           foo-ui


●
    Outsiders only rely on foo-api (interfaces!)

●
    It boils down to your domain modeling.
       ●
           Naming is everything
Modularity isn't free
What can I do?
●
    There is a bunch of tooling to help
        ●
            Maven, Ant/Ivy
        ●
            OSGi, Jboss Modules


●
    Nothing beats a whiteboard or a drawing pad
        ●
            TDD should be Test Driven Design
        ●
            Pair Programming? Think Pair Designing instead
Versioning
 Now that you have modules, how do you manage the
             relationship between them?




March12, 2010   QCon London 2010   Ian Robinson   34
Versioning




March12, 2010   QCon London 2010   Ian Robinson   35
Versioning
●
    Major increment: I break consumers
          ●
                Removal of existing methods or interfaces


●
    Minor increment: I break implementers
          ●
                Addition of methods to interfaces


●
    Micro increment: I promise I don't break anything
          ●
                “Clear” defect fixes
          ●
March12, 2010
                Internal improvements
                           QCon London 2010   Ian Robinson   36
Versioning
●
    But … causes developer depression
          ●
                Compatibility != amount of work
          ●
                Tempting to use marketing versions rather than
                  semantic versions


●
    A good example here is Java itself!




March12, 2010              QCon London 2010   Ian Robinson       37
What can I do?
●
    major.minor.trivial
          ●
                SNAPSHOT is acceptable internally


●
    If you have customers/clients
          ●
                You need to think about backwards compatibility
          ●
                Plugin systems are useful here
                    ●
                        Once more think dependency injection



March12, 2010                 QCon London 2010   Ian Robinson     38
Testing
Tasting
What does our pasta taste like?




Testing simple things is easy
●



Testing complex things is hard
●




●
    Make your things simple
Unit testing
Integration testing
What can I do?
●
    Test early, Test often

●
    Test at lots of granularities
        ●
            Unit
        ●
            Integration
        ●
            System


●
    Let machines do your testing for you!
Tools, Tips and Techniques
CI
OSGi
●
    Explicit dependency management
       ●
           Classloading


●
    Explicit version management

●
    Services
       ●
           No more hacky factories
OSGi
●
    Enables
        ●
            Reliability
                ●
                    No more ClassDefNotFoundException
        ●
            Small footprint
        ●
            Dynamism


●
    Easy to get started with – it's just simple manifests
        ●
            It's compatible too!
OSGi Manifests
 Manifest is a bit like a recipe




Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: MyService bundle
Bundle-SymbolicName: com.sample.myservice
Bundle-Version: 1.0.0
Bundle-Activator: com.sample.myservice.Activator
Import-Package: org.apache.commons.logging;version="1.0.4"
Export-Package: com.sample.myservice.api;version="1.0.0"
All done!
Thank you
.... and now it's time for lunch.
    .... which may be pasta.

More Related Content

Viewers also liked

VMET_Document - VERIFICATION OF MILITARY EDUCATION AND TRAINING (2015_09_22 2...
VMET_Document - VERIFICATION OF MILITARY EDUCATION AND TRAINING (2015_09_22 2...VMET_Document - VERIFICATION OF MILITARY EDUCATION AND TRAINING (2015_09_22 2...
VMET_Document - VERIFICATION OF MILITARY EDUCATION AND TRAINING (2015_09_22 2...Darryl Oliver Franklin
 
Fotos asón 1º eso 2016
Fotos asón 1º eso   2016Fotos asón 1º eso   2016
Fotos asón 1º eso 2016asoraya10
 
Jenner y pasteur
Jenner y pasteurJenner y pasteur
Jenner y pasteurmariibiris
 
Introduction to the course
Introduction to the courseIntroduction to the course
Introduction to the courseETS-UBC
 
Phát triển hoạt động kinh doanh thẻ tại ngân hàng thương mại cổ phần đầu tư v...
Phát triển hoạt động kinh doanh thẻ tại ngân hàng thương mại cổ phần đầu tư v...Phát triển hoạt động kinh doanh thẻ tại ngân hàng thương mại cổ phần đầu tư v...
Phát triển hoạt động kinh doanh thẻ tại ngân hàng thương mại cổ phần đầu tư v...https://www.facebook.com/garmentspace
 
царскосельский лицей а.с.пушкина
царскосельский лицей а.с.пушкинацарскосельский лицей а.с.пушкина
царскосельский лицей а.с.пушкинаNatalya Dyrda
 
Безопасный интернет
Безопасный интернетБезопасный интернет
Безопасный интернетNatalya Dyrda
 
классный час русь ремесленная
классный час русь ремесленнаяклассный час русь ремесленная
классный час русь ремесленнаяnordf4st
 

Viewers also liked (14)

VMET_Document - VERIFICATION OF MILITARY EDUCATION AND TRAINING (2015_09_22 2...
VMET_Document - VERIFICATION OF MILITARY EDUCATION AND TRAINING (2015_09_22 2...VMET_Document - VERIFICATION OF MILITARY EDUCATION AND TRAINING (2015_09_22 2...
VMET_Document - VERIFICATION OF MILITARY EDUCATION AND TRAINING (2015_09_22 2...
 
Fotos asón 1º eso 2016
Fotos asón 1º eso   2016Fotos asón 1º eso   2016
Fotos asón 1º eso 2016
 
Jenner y pasteur
Jenner y pasteurJenner y pasteur
Jenner y pasteur
 
Estructuras
EstructurasEstructuras
Estructuras
 
Introduction to the course
Introduction to the courseIntroduction to the course
Introduction to the course
 
Phát triển hoạt động kinh doanh thẻ tại ngân hàng thương mại cổ phần đầu tư v...
Phát triển hoạt động kinh doanh thẻ tại ngân hàng thương mại cổ phần đầu tư v...Phát triển hoạt động kinh doanh thẻ tại ngân hàng thương mại cổ phần đầu tư v...
Phát triển hoạt động kinh doanh thẻ tại ngân hàng thương mại cổ phần đầu tư v...
 
Плакаты учащихся
Плакаты учащихсяПлакаты учащихся
Плакаты учащихся
 
Презентация Новиковой Е.А.
Презентация Новиковой Е.А.Презентация Новиковой Е.А.
Презентация Новиковой Е.А.
 
Иностранные языки в нашей школе
Иностранные языки в нашей школеИностранные языки в нашей школе
Иностранные языки в нашей школе
 
Microsoft excel
Microsoft excelMicrosoft excel
Microsoft excel
 
царскосельский лицей а.с.пушкина
царскосельский лицей а.с.пушкинацарскосельский лицей а.с.пушкина
царскосельский лицей а.с.пушкина
 
Безопасный интернет
Безопасный интернетБезопасный интернет
Безопасный интернет
 
Hitachi Solutions Ecommerce Store Front Designer Guide
Hitachi Solutions Ecommerce Store Front Designer GuideHitachi Solutions Ecommerce Store Front Designer Guide
Hitachi Solutions Ecommerce Store Front Designer Guide
 
классный час русь ремесленная
классный час русь ремесленнаяклассный час русь ремесленная
классный час русь ремесленная
 

Similar to Everything I know about software in spaghetti bolognese: managing complexity

Building a Company atop of Open Source
Building a Company atop of Open SourceBuilding a Company atop of Open Source
Building a Company atop of Open SourceAnoop Thomas Mathew
 
Android Frameworks: Highlighting the Need for a Solid Development Framework 
Android Frameworks: Highlighting the Need for a Solid Development Framework Android Frameworks: Highlighting the Need for a Solid Development Framework 
Android Frameworks: Highlighting the Need for a Solid Development Framework Mutual Mobile
 
Working With Legacy Code
Working With Legacy CodeWorking With Legacy Code
Working With Legacy CodeAndrea Polci
 
Design for Testability
Design for Testability Design for Testability
Design for Testability Pawel Kalbrun
 
Docker and Go: why did we decide to write Docker in Go?
Docker and Go: why did we decide to write Docker in Go?Docker and Go: why did we decide to write Docker in Go?
Docker and Go: why did we decide to write Docker in Go?Jérôme Petazzoni
 
Concurrency - Why it's hard ?
Concurrency - Why it's hard ?Concurrency - Why it's hard ?
Concurrency - Why it's hard ?Ramith Jayasinghe
 
Patterns: The new Javascript framweork
Patterns: The new Javascript framweorkPatterns: The new Javascript framweork
Patterns: The new Javascript framweorkFranco Pellegrini
 
Drools planner - 2012-10-23 IntelliFest 2012
Drools planner - 2012-10-23 IntelliFest 2012Drools planner - 2012-10-23 IntelliFest 2012
Drools planner - 2012-10-23 IntelliFest 2012Geoffrey De Smet
 
Design Patterns Illustrated
Design Patterns IllustratedDesign Patterns Illustrated
Design Patterns IllustratedHerman Peeren
 
Nightmare on Docker street
Nightmare on Docker streetNightmare on Docker street
Nightmare on Docker streetKris Buytaert
 
BDD workshop for JavaScript developers
BDD workshop for JavaScript developersBDD workshop for JavaScript developers
BDD workshop for JavaScript developersCarlos Ble
 
TS 5341 Rethinking the ESB
TS 5341 Rethinking the ESBTS 5341 Rethinking the ESB
TS 5341 Rethinking the ESBaegloff
 
Django Bootstrapping with Ease
Django Bootstrapping with EaseDjango Bootstrapping with Ease
Django Bootstrapping with EaseConcentric Sky
 
VIB - Very Important Bundles
VIB - Very Important BundlesVIB - Very Important Bundles
VIB - Very Important BundlesRoman Roelofsen
 
Needs of Other November2011
Needs of Other November2011Needs of Other November2011
Needs of Other November2011Razi Masri
 

Similar to Everything I know about software in spaghetti bolognese: managing complexity (20)

Building a Company atop of Open Source
Building a Company atop of Open SourceBuilding a Company atop of Open Source
Building a Company atop of Open Source
 
Android Frameworks: Highlighting the Need for a Solid Development Framework 
Android Frameworks: Highlighting the Need for a Solid Development Framework Android Frameworks: Highlighting the Need for a Solid Development Framework 
Android Frameworks: Highlighting the Need for a Solid Development Framework 
 
Groovy android
Groovy androidGroovy android
Groovy android
 
Working With Legacy Code
Working With Legacy CodeWorking With Legacy Code
Working With Legacy Code
 
Design for Testability
Design for Testability Design for Testability
Design for Testability
 
Docker and Go: why did we decide to write Docker in Go?
Docker and Go: why did we decide to write Docker in Go?Docker and Go: why did we decide to write Docker in Go?
Docker and Go: why did we decide to write Docker in Go?
 
Why Concurrency is hard ?
Why Concurrency is hard ?Why Concurrency is hard ?
Why Concurrency is hard ?
 
Making Strongly-typed NETCONF Usable
Making Strongly-typed NETCONF UsableMaking Strongly-typed NETCONF Usable
Making Strongly-typed NETCONF Usable
 
Concurrency - Why it's hard ?
Concurrency - Why it's hard ?Concurrency - Why it's hard ?
Concurrency - Why it's hard ?
 
Patterns: The new Javascript framweork
Patterns: The new Javascript framweorkPatterns: The new Javascript framweork
Patterns: The new Javascript framweork
 
Drools planner - 2012-10-23 IntelliFest 2012
Drools planner - 2012-10-23 IntelliFest 2012Drools planner - 2012-10-23 IntelliFest 2012
Drools planner - 2012-10-23 IntelliFest 2012
 
Design Patterns Illustrated
Design Patterns IllustratedDesign Patterns Illustrated
Design Patterns Illustrated
 
Nightmare on Docker street
Nightmare on Docker streetNightmare on Docker street
Nightmare on Docker street
 
BDD workshop for JavaScript developers
BDD workshop for JavaScript developersBDD workshop for JavaScript developers
BDD workshop for JavaScript developers
 
effective java
effective javaeffective java
effective java
 
TS 5341 Rethinking the ESB
TS 5341 Rethinking the ESBTS 5341 Rethinking the ESB
TS 5341 Rethinking the ESB
 
Git. Transition.
Git. Transition.Git. Transition.
Git. Transition.
 
Django Bootstrapping with Ease
Django Bootstrapping with EaseDjango Bootstrapping with Ease
Django Bootstrapping with Ease
 
VIB - Very Important Bundles
VIB - Very Important BundlesVIB - Very Important Bundles
VIB - Very Important Bundles
 
Needs of Other November2011
Needs of Other November2011Needs of Other November2011
Needs of Other November2011
 

More from JAX London

Devops with the S for Sharing - Patrick Debois
Devops with the S for Sharing - Patrick DeboisDevops with the S for Sharing - Patrick Debois
Devops with the S for Sharing - Patrick DeboisJAX London
 
Busy Developer's Guide to Windows 8 HTML/JavaScript Apps
Busy Developer's Guide to Windows 8 HTML/JavaScript AppsBusy Developer's Guide to Windows 8 HTML/JavaScript Apps
Busy Developer's Guide to Windows 8 HTML/JavaScript AppsJAX London
 
It's code but not as we know: Infrastructure as Code - Patrick Debois
It's code but not as we know: Infrastructure as Code - Patrick DeboisIt's code but not as we know: Infrastructure as Code - Patrick Debois
It's code but not as we know: Infrastructure as Code - Patrick DeboisJAX London
 
Locks? We Don't Need No Stinkin' Locks - Michael Barker
Locks? We Don't Need No Stinkin' Locks - Michael BarkerLocks? We Don't Need No Stinkin' Locks - Michael Barker
Locks? We Don't Need No Stinkin' Locks - Michael BarkerJAX London
 
Worse is better, for better or for worse - Kevlin Henney
Worse is better, for better or for worse - Kevlin HenneyWorse is better, for better or for worse - Kevlin Henney
Worse is better, for better or for worse - Kevlin HenneyJAX London
 
Java performance: What's the big deal? - Trisha Gee
Java performance: What's the big deal? - Trisha GeeJava performance: What's the big deal? - Trisha Gee
Java performance: What's the big deal? - Trisha GeeJAX London
 
Clojure made-simple - John Stevenson
Clojure made-simple - John StevensonClojure made-simple - John Stevenson
Clojure made-simple - John StevensonJAX London
 
HTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias Wessendorf
HTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias WessendorfHTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias Wessendorf
HTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias WessendorfJAX London
 
Play framework 2 : Peter Hilton
Play framework 2 : Peter HiltonPlay framework 2 : Peter Hilton
Play framework 2 : Peter HiltonJAX London
 
Complexity theory and software development : Tim Berglund
Complexity theory and software development : Tim BerglundComplexity theory and software development : Tim Berglund
Complexity theory and software development : Tim BerglundJAX London
 
Why FLOSS is a Java developer's best friend: Dave Gruber
Why FLOSS is a Java developer's best friend: Dave GruberWhy FLOSS is a Java developer's best friend: Dave Gruber
Why FLOSS is a Java developer's best friend: Dave GruberJAX London
 
Akka in Action: Heiko Seeburger
Akka in Action: Heiko SeeburgerAkka in Action: Heiko Seeburger
Akka in Action: Heiko SeeburgerJAX London
 
NoSQL Smackdown 2012 : Tim Berglund
NoSQL Smackdown 2012 : Tim BerglundNoSQL Smackdown 2012 : Tim Berglund
NoSQL Smackdown 2012 : Tim BerglundJAX London
 
Closures, the next "Big Thing" in Java: Russel Winder
Closures, the next "Big Thing" in Java: Russel WinderClosures, the next "Big Thing" in Java: Russel Winder
Closures, the next "Big Thing" in Java: Russel WinderJAX London
 
Java and the machine - Martijn Verburg and Kirk Pepperdine
Java and the machine - Martijn Verburg and Kirk PepperdineJava and the machine - Martijn Verburg and Kirk Pepperdine
Java and the machine - Martijn Verburg and Kirk PepperdineJAX London
 
Mongo DB on the JVM - Brendan McAdams
Mongo DB on the JVM - Brendan McAdamsMongo DB on the JVM - Brendan McAdams
Mongo DB on the JVM - Brendan McAdamsJAX London
 
New opportunities for connected data - Ian Robinson
New opportunities for connected data - Ian RobinsonNew opportunities for connected data - Ian Robinson
New opportunities for connected data - Ian RobinsonJAX London
 
HTML5 Websockets and Java - Arun Gupta
HTML5 Websockets and Java - Arun GuptaHTML5 Websockets and Java - Arun Gupta
HTML5 Websockets and Java - Arun GuptaJAX London
 
The Big Data Con: Why Big Data is a Problem, not a Solution - Ian Plosker
The Big Data Con: Why Big Data is a Problem, not a Solution - Ian PloskerThe Big Data Con: Why Big Data is a Problem, not a Solution - Ian Plosker
The Big Data Con: Why Big Data is a Problem, not a Solution - Ian PloskerJAX London
 
Bluffers guide to elitist jargon - Martijn Verburg, Richard Warburton, James ...
Bluffers guide to elitist jargon - Martijn Verburg, Richard Warburton, James ...Bluffers guide to elitist jargon - Martijn Verburg, Richard Warburton, James ...
Bluffers guide to elitist jargon - Martijn Verburg, Richard Warburton, James ...JAX London
 

More from JAX London (20)

Devops with the S for Sharing - Patrick Debois
Devops with the S for Sharing - Patrick DeboisDevops with the S for Sharing - Patrick Debois
Devops with the S for Sharing - Patrick Debois
 
Busy Developer's Guide to Windows 8 HTML/JavaScript Apps
Busy Developer's Guide to Windows 8 HTML/JavaScript AppsBusy Developer's Guide to Windows 8 HTML/JavaScript Apps
Busy Developer's Guide to Windows 8 HTML/JavaScript Apps
 
It's code but not as we know: Infrastructure as Code - Patrick Debois
It's code but not as we know: Infrastructure as Code - Patrick DeboisIt's code but not as we know: Infrastructure as Code - Patrick Debois
It's code but not as we know: Infrastructure as Code - Patrick Debois
 
Locks? We Don't Need No Stinkin' Locks - Michael Barker
Locks? We Don't Need No Stinkin' Locks - Michael BarkerLocks? We Don't Need No Stinkin' Locks - Michael Barker
Locks? We Don't Need No Stinkin' Locks - Michael Barker
 
Worse is better, for better or for worse - Kevlin Henney
Worse is better, for better or for worse - Kevlin HenneyWorse is better, for better or for worse - Kevlin Henney
Worse is better, for better or for worse - Kevlin Henney
 
Java performance: What's the big deal? - Trisha Gee
Java performance: What's the big deal? - Trisha GeeJava performance: What's the big deal? - Trisha Gee
Java performance: What's the big deal? - Trisha Gee
 
Clojure made-simple - John Stevenson
Clojure made-simple - John StevensonClojure made-simple - John Stevenson
Clojure made-simple - John Stevenson
 
HTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias Wessendorf
HTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias WessendorfHTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias Wessendorf
HTML alchemy: the secrets of mixing JavaScript and Java EE - Matthias Wessendorf
 
Play framework 2 : Peter Hilton
Play framework 2 : Peter HiltonPlay framework 2 : Peter Hilton
Play framework 2 : Peter Hilton
 
Complexity theory and software development : Tim Berglund
Complexity theory and software development : Tim BerglundComplexity theory and software development : Tim Berglund
Complexity theory and software development : Tim Berglund
 
Why FLOSS is a Java developer's best friend: Dave Gruber
Why FLOSS is a Java developer's best friend: Dave GruberWhy FLOSS is a Java developer's best friend: Dave Gruber
Why FLOSS is a Java developer's best friend: Dave Gruber
 
Akka in Action: Heiko Seeburger
Akka in Action: Heiko SeeburgerAkka in Action: Heiko Seeburger
Akka in Action: Heiko Seeburger
 
NoSQL Smackdown 2012 : Tim Berglund
NoSQL Smackdown 2012 : Tim BerglundNoSQL Smackdown 2012 : Tim Berglund
NoSQL Smackdown 2012 : Tim Berglund
 
Closures, the next "Big Thing" in Java: Russel Winder
Closures, the next "Big Thing" in Java: Russel WinderClosures, the next "Big Thing" in Java: Russel Winder
Closures, the next "Big Thing" in Java: Russel Winder
 
Java and the machine - Martijn Verburg and Kirk Pepperdine
Java and the machine - Martijn Verburg and Kirk PepperdineJava and the machine - Martijn Verburg and Kirk Pepperdine
Java and the machine - Martijn Verburg and Kirk Pepperdine
 
Mongo DB on the JVM - Brendan McAdams
Mongo DB on the JVM - Brendan McAdamsMongo DB on the JVM - Brendan McAdams
Mongo DB on the JVM - Brendan McAdams
 
New opportunities for connected data - Ian Robinson
New opportunities for connected data - Ian RobinsonNew opportunities for connected data - Ian Robinson
New opportunities for connected data - Ian Robinson
 
HTML5 Websockets and Java - Arun Gupta
HTML5 Websockets and Java - Arun GuptaHTML5 Websockets and Java - Arun Gupta
HTML5 Websockets and Java - Arun Gupta
 
The Big Data Con: Why Big Data is a Problem, not a Solution - Ian Plosker
The Big Data Con: Why Big Data is a Problem, not a Solution - Ian PloskerThe Big Data Con: Why Big Data is a Problem, not a Solution - Ian Plosker
The Big Data Con: Why Big Data is a Problem, not a Solution - Ian Plosker
 
Bluffers guide to elitist jargon - Martijn Verburg, Richard Warburton, James ...
Bluffers guide to elitist jargon - Martijn Verburg, Richard Warburton, James ...Bluffers guide to elitist jargon - Martijn Verburg, Richard Warburton, James ...
Bluffers guide to elitist jargon - Martijn Verburg, Richard Warburton, James ...
 

Recently uploaded

Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGDSC PJATK
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?Paolo Missier
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireExakis Nelite
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPTiSEO AI
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 

Recently uploaded (20)

Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 

Everything I know about software in spaghetti bolognese: managing complexity

  • 1. Everything I know about software I learned from spaghetti bolognese Managing complexity Holly Cummins, IBM @holly_cummins Martijn Verburg, jClarity @karianna
  • 2. What do we know about software? Holly Martijn 11 years with IBM CTO - jClarity WebSphere Diabolical Developer JVM performance Community Cat Herder
  • 3. What do we know about spaghetti?
  • 4. Common understanding No more noodling with code.
  • 5. Understanding interfaces My users don't need to know about all my methods ● I'd like to swap this implementation for that ● implementation
  • 6. Understanding reuse “Could I re-use some your code in my project, please?” ● Inheritance vs Composition ● Inheritance ~= Liskov Substitution Principle ● Composition ~= Does Type B only want only some/part of the behavior exposed by Type A?
  • 7. Services Normal spaghetti bolognese Vegetarian spaghetti bolognese
  • 8. Getting hold of implementations Perpetual problem ● Factories ● ● Factory factories ● Factory factory factories ● Factory factory factory factories Home-rolled frameworks ● META-INF/Services ● OSGI services ●
  • 9. Dependency injection Externalised Factory Problem ● Enable implementations to be switched in and out ● ● Avoids hard-couplings in runtime ● Enables effective testing and test-driven-development ● Implementations can be stubbed or mocked out ● Really helps modularity ● Guice, Picocontainer are light-weight starting points
  • 10. What can I do? ● Be strict about dependency management ● Understand external and internal interfaces ● What do you want to be able to swap? ● Think about what type of re-use you're going for ● Draw out dependencies ● Tooling can help
  • 12. Problems with JARs ● JARs are transparent March12, 2010 QCon London 2010 Ian Robinson 12
  • 13. Problems with JARs ● Java Platform Modularity Classes encapsulate data Jar ● ● Packages contain classes Package ● Jars contain packages Class ● Class visibility: Package ● private Class Class ● package private Package ● protected Class ● public Class ● No “jar scoped” access modifiers. March12, 2010 QCon London 2010 Ian Robinson 13
  • 14. Problems with JARs ● No means for a jar to declare its dependencies. Jar Package ● No versioning. Class Package Jars have no modularization Class ● Class characteristics Package Class Class ● At runtime there is just a collection of classes on a global classpath March12, 2010 QCon London 2010 Ian Robinson 14
  • 15. More problems with jars ● In a normal jar, an implementation is just as easy to use as the interface. ● In a normal jar, an implementation easier to use than the interface ● No worries about factory patterns ● Encourages consumers to bust encapsulation wide open March12, 2010 QCon London 2010 Ian Robinson 15
  • 16. Why classloading is broken March12, 2010 QCon London 2010 Ian Robinson 16
  • 17. What can I do? Don't think JARs, think modules
  • 18. Modularity Principles This section is a tooling-free zone. Mostly.
  • 19. Understanding dependencies What other code does my code touch? ● What happens if I change my code? ●
  • 20. Understanding dependencies ● What other code does my code touch? ● When does it connect? ● Compile time? ● Runtime? ● Transitively? ● Only at test?
  • 22. Bad Modularity ● Dividing up the code != good modularity ● Retrofitting modularity is hard ● See Michael Feathers' “Dealing with Legacy Code”
  • 23. Think about modularity from the start
  • 25. Sharing between modules OSGi OSGi OSGi OSGi OSGi
  • 27. A question of scale ● Need for modularity grows with size of project
  • 28. Choose the right granularity
  • 29. Choose the right granularity
  • 30. Choose the right granularity
  • 31. Choose the right granularity ● A common approach ● foo-api ● foo-core ● foo-ui ● Outsiders only rely on foo-api (interfaces!) ● It boils down to your domain modeling. ● Naming is everything
  • 33. What can I do? ● There is a bunch of tooling to help ● Maven, Ant/Ivy ● OSGi, Jboss Modules ● Nothing beats a whiteboard or a drawing pad ● TDD should be Test Driven Design ● Pair Programming? Think Pair Designing instead
  • 34. Versioning Now that you have modules, how do you manage the relationship between them? March12, 2010 QCon London 2010 Ian Robinson 34
  • 35. Versioning March12, 2010 QCon London 2010 Ian Robinson 35
  • 36. Versioning ● Major increment: I break consumers ● Removal of existing methods or interfaces ● Minor increment: I break implementers ● Addition of methods to interfaces ● Micro increment: I promise I don't break anything ● “Clear” defect fixes ● March12, 2010 Internal improvements QCon London 2010 Ian Robinson 36
  • 37. Versioning ● But … causes developer depression ● Compatibility != amount of work ● Tempting to use marketing versions rather than semantic versions ● A good example here is Java itself! March12, 2010 QCon London 2010 Ian Robinson 37
  • 38. What can I do? ● major.minor.trivial ● SNAPSHOT is acceptable internally ● If you have customers/clients ● You need to think about backwards compatibility ● Plugin systems are useful here ● Once more think dependency injection March12, 2010 QCon London 2010 Ian Robinson 38
  • 40. Tasting What does our pasta taste like? Testing simple things is easy ● Testing complex things is hard ● ● Make your things simple
  • 43. What can I do? ● Test early, Test often ● Test at lots of granularities ● Unit ● Integration ● System ● Let machines do your testing for you!
  • 44. Tools, Tips and Techniques
  • 45. CI
  • 46. OSGi ● Explicit dependency management ● Classloading ● Explicit version management ● Services ● No more hacky factories
  • 47. OSGi ● Enables ● Reliability ● No more ClassDefNotFoundException ● Small footprint ● Dynamism ● Easy to get started with – it's just simple manifests ● It's compatible too!
  • 48. OSGi Manifests Manifest is a bit like a recipe Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: MyService bundle Bundle-SymbolicName: com.sample.myservice Bundle-Version: 1.0.0 Bundle-Activator: com.sample.myservice.Activator Import-Package: org.apache.commons.logging;version="1.0.4" Export-Package: com.sample.myservice.api;version="1.0.0"
  • 50. Thank you .... and now it's time for lunch. .... which may be pasta.