51
Rediscovering Modularity JFall 2012 Hart Van Holland, Nijkerk [email protected]

Rediscovering Modularity - JFall 2012 version

Embed Size (px)

DESCRIPTION

This is my presentation at JFall 2012, Nijkerk, Netherlands. The presentation is geared for live presentation, but I have serialized some of the animation, so it hopefully makes some sense as a slideshow!

Citation preview

Page 1: Rediscovering Modularity - JFall 2012 version

Rediscovering Modularity JFall 2012 Hart Van Holland, Nijkerk [email protected]

Page 2: Rediscovering Modularity - JFall 2012 version

Encapsulation Abstraction

Defined interface

Information hiding

Cohesion

Coupling

Clear responsibility

Modularity

Page 3: Rediscovering Modularity - JFall 2012 version
Page 4: Rediscovering Modularity - JFall 2012 version

Encapsulation Abstraction

Defined interface

Information hiding

Cohesion

Coupling

Clear responsibility

Modularity

Page 5: Rediscovering Modularity - JFall 2012 version

Composition

Complexity

Cyclomatic

Complexity

(CC)

Page 6: Rediscovering Modularity - JFall 2012 version
Page 7: Rediscovering Modularity - JFall 2012 version
Page 8: Rediscovering Modularity - JFall 2012 version

Encapsulate

Page 9: Rediscovering Modularity - JFall 2012 version

Encapsulation Abstraction

Defined interface

Information hiding

Cohesion

Coupling

Clear responsibility

Modularity

Page 10: Rediscovering Modularity - JFall 2012 version
Page 11: Rediscovering Modularity - JFall 2012 version

Composition

Complexity

Compositional

Complexity

(CC)

Page 12: Rediscovering Modularity - JFall 2012 version
Page 13: Rediscovering Modularity - JFall 2012 version
Page 14: Rediscovering Modularity - JFall 2012 version

Encapsulate

Page 15: Rediscovering Modularity - JFall 2012 version

Encapsulation Abstraction

Defined interface?

Information hiding?

Cohesion

Coupling?

Clear responsibility

Modularity?

Page 16: Rediscovering Modularity - JFall 2012 version

Composition

Complexity

Compositional

Complexity

(CC)

Hierarchical

=> Scalable

Page 17: Rediscovering Modularity - JFall 2012 version
Page 18: Rediscovering Modularity - JFall 2012 version

Dependencies

Page 19: Rediscovering Modularity - JFall 2012 version
Page 20: Rediscovering Modularity - JFall 2012 version

Dependencies

Page 21: Rediscovering Modularity - JFall 2012 version
Page 22: Rediscovering Modularity - JFall 2012 version
Page 23: Rediscovering Modularity - JFall 2012 version
Page 24: Rediscovering Modularity - JFall 2012 version
Page 25: Rediscovering Modularity - JFall 2012 version
Page 26: Rediscovering Modularity - JFall 2012 version
Page 27: Rediscovering Modularity - JFall 2012 version
Page 28: Rediscovering Modularity - JFall 2012 version
Page 29: Rediscovering Modularity - JFall 2012 version
Page 30: Rediscovering Modularity - JFall 2012 version

Cost… as code-base grows…

• Cost per feature increases

• Unexpected impacts of change

• Unreliable schedules

• Test cycles increase

• Reuse less

• Value of your code base declines

Page 31: Rediscovering Modularity - JFall 2012 version

Technical Debt

Page 32: Rediscovering Modularity - JFall 2012 version

Technical Debt

Page 33: Rediscovering Modularity - JFall 2012 version

Technical Debt

Page 34: Rediscovering Modularity - JFall 2012 version

Technical Debt

Page 35: Rediscovering Modularity - JFall 2012 version
Page 36: Rediscovering Modularity - JFall 2012 version
Page 37: Rediscovering Modularity - JFall 2012 version
Page 38: Rediscovering Modularity - JFall 2012 version
Page 39: Rediscovering Modularity - JFall 2012 version
Page 40: Rediscovering Modularity - JFall 2012 version
Page 41: Rediscovering Modularity - JFall 2012 version

Refactoring Restructuring

Page 42: Rediscovering Modularity - JFall 2012 version

Refactoring

• “Changing code without

modifying behavior to

improve nonfunctional

attributes.”

Restructuring

• “Reorganizing a code-base

without modifying the code to

improve modularity”

Page 43: Rediscovering Modularity - JFall 2012 version

Refactoring

• “Changing code without

modifying behavior to

improve nonfunctional

attributes.”

• Code is readable

Restructuring

• “Reorganizing a code-base

without modifying the code to

improve modularity”

• Code-base is understandable

Page 44: Rediscovering Modularity - JFall 2012 version

Refactoring

• “Changing code without

modifying behavior to

improve nonfunctional

attributes.”

• Code is readable

• A lot of invasive code editing

Restructuring

• “Reorganizing a code-base

without modifying the code to

improve modularity”

• Code-base is understandable

• Minimal invasive code editing

Page 45: Rediscovering Modularity - JFall 2012 version

Refactoring

• “Changing code without

modifying behavior to improve

nonfunctional attributes.”

• Code is readable

• A lot of invasive code editing

• Scope: small worlds of a few

classes at a time; what you see

in the IDE.

Restructuring

• “Reorganizing a code-base

without modifying the code to

improve modularity”

• Code-base is understandable

• Minimal invasive code editing

• Scope: whole code base; what

you don’t see in the IDE

Page 46: Rediscovering Modularity - JFall 2012 version
Page 47: Rediscovering Modularity - JFall 2012 version
Page 48: Rediscovering Modularity - JFall 2012 version

Restructure101

Structure101

Page 49: Rediscovering Modularity - JFall 2012 version

Restructure101

Structure101

Page 50: Rediscovering Modularity - JFall 2012 version

Restructure101

Structure101

Page 51: Rediscovering Modularity - JFall 2012 version

Summary

Keep CC and tangles out

Stop debt growing (Keep a Lid on It - KALOI)

Restructuring is an option!

Define modular structure

Communicate and enforce

Evolve architecture with iterations