Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

37
From Big Ball of Mud to Modularity Chris Chedgey Structure101 Jax London October 29, 2013

description

Presented at JAX London 2013 When you write and run Java code, the JVM makes several allocations on your behalf, but do you have an understanding of how much that is? This session provides insight into the memory usage of Java code, covering the memory overhead of putting int into an integer object and the cost of object delegation and the memory efficiency of the different collection types. It also gives you an understanding of the off-Java (native) heap memory usage of some types of Java objects, such as threads and sockets.

Transcript of Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

Page 1: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

From Big Ball of Mud to Modularity

Chris ChedgeyStructure101

Jax LondonOctober 29, 2013

Page 2: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

What you have…

• Thousands of source files

• Countless interdependencies

• Impossible to understand & control

• Works

1. Implementation

Page 3: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

What you have…

• Folders, targets, packages, jars, …

• Helps find files

• Helps understand & control?

2. Physical organization

Page 4: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

What you have…2. Physical organization

• Folders, targets, packages, jars, …

• Helps find files

• Helps understand & control?

Page 5: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

• Folders, targets, packages, jars, …

• Helps find files

• Helps understand & control?

• Hopelessly tangled – NO

2. Physical organizationWhat you have…

Page 6: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

1. Unstructured sea of classes

Big Ball of Mud

What you have…

2. Tangled physical organization

Page 7: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

What you need…

• Low coupling

• Defines layering visibility

• Communicated

• Maps to code

• Evolves with codebase

3. Modular structure

Page 8: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

What you need…

• Low coupling

• Defines layering visibility

• Communicated

• Maps to code

• Evolves with codebase

3. Modular structure

Conform

Align

Page 9: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

What you need…Discover and Define

?

Page 10: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

3. Modularity

2. Architecture

1. Structure

0. Mud

• Refactor, Align

• Interfaces, definition

• Encapsulation, levelization, cohesion

• Unstructured implementation

Page 11: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

Encapsulation

Page 12: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)
Page 13: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

“Mind-sizedchunk”

(Ward Cunningham)

Page 14: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)
Page 15: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)
Page 16: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)
Page 17: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)
Page 18: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)
Page 19: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

Levelization

Page 20: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)
Page 21: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

DependenciesLevelized

(John Lakos,Kirk Knoernschild)

Page 22: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)
Page 23: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

Levelized

Page 24: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

Cumulative Component

Dependency (CCD)

Page 25: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

Levelized

“Tangles”

Page 26: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

Coupling Composition?

Page 27: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

Cohesion

Page 28: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

Cohesion

Page 29: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

Cohesion

Page 30: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

LevelizationEncapsulation

“Structured”

DefinitionInterfaces+

We want…

Cohesion

Page 31: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

3. Modularity

2. Architecture

1. Structure

0. Mud

• Refactor, Align

• Interfaces, definition

• Encapsulation, levelization, cohesion

• Unstructured implementation

Page 32: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

Interfaces, Definition

Page 33: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)
Page 34: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

Refactoring, Alignment

Page 35: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)
Page 36: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

3. Modularity

2. Architecture

1. Structure

0. Mud

• Refactor, Align

• Interfaces, definition

• Encapsulation, levelization, cohesion

• Unstructured implementation

Thank you!@[email protected]

Page 37: Practical Performance: Understand the Performance of Your Application - Chris Bailey (IBM)

Cost of the status quo…Miserable developers

Cost per feature increases

Unexpected impacts of change

Unreliable schedules

Test cycles increase

Reuse less

Value of your code base declines