how to manage software complexity with osgi

Post on 13-May-2015

1.513 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

EclipseCon presentation from David Savage (Paremus) and Peter Kriens (OSGi)

TRANSCRIPT

How to Manage Software Complexity

with OSGiPeter Kriens & David Savage

donderdag 24 maart 2011

What is Complexity?

donderdag 24 maart 2011

Complex?

donderdag 24 maart 2011

The puzzle looks very simple, contrary to many other wire puzzles, that look scary and complex right from the start. Nevertheless, its looks are

deceiving, as it can prove to be frustratingly difficult to

solve.

donderdag 24 maart 2011

Complex?

donderdag 24 maart 2011

Worlds Largest Jigsaw Puzzle24.000 pieces

(4.28m x 1.57m)

Complex?

donderdag 24 maart 2011

The Eye Of The Beholder

• Complexity of a task is the energy you use to complete that task

c = √E/m

donderdag 24 maart 2011

The Eye Of The Beholder

• Complexity of a task is the energy you use to complete that task

c = √E/m

donderdag 24 maart 2011

Energy?

• Understanding the problem

• Learning the solution

• Accidental complexity

• Size matters!

donderdag 24 maart 2011

Energy?

• Understanding the problem

• Learning the solution

• Accidental complexity

• Size matters!

Subjective Complexity

donderdag 24 maart 2011

Energy?

• Understanding the problem

• Learning the solution

• Accidental complexity

• Size matters!

Subjective Complexity

Absolute Complexitysize related

donderdag 24 maart 2011

What’s Modularity Got to do With Size???

donderdag 24 maart 2011

Modularity• Functions

• local variables

• Object Oriented

• fields, methods, inheritance,polymorphism

• instances

• Bundles

• implementations, services

• componentsdonderdag 24 maart 2011

Modularity• Functions

• local variables

• Object Oriented

• fields, methods, inheritance,polymorphism

• instances

• Bundles

• implementations, services

• componentsdonderdag 24 maart 2011

Modularity• Modularity is about

creating a difference between an inside and an outside

• Chunking - having an anchor for an aggregation

• Visibility - is reduced, reducing the scope to attend for changes

A B

C D

ABCD

donderdag 24 maart 2011

Modularity• Modularity is about

creating a difference between an inside and an outside

• Chunking - having an anchor for an aggregation

• Visibility - is reduced, reducing the scope to attend for changes

A B

C DABCD

donderdag 24 maart 2011

A B

C D

• modules have a private space and share a public space

• modules limit their visibility and exposure

• Reduces geometric to linear complexity

Modularity

donderdag 24 maart 2011

A B

C D

• modules have a private space and share a public space

• modules limit their visibility and exposure

• Reduces geometric to linear complexity

Modularity

Pub

donderdag 24 maart 2011

A B

C D

• modules have a private space and share a public space

• modules limit their visibility and exposure

• Reduces geometric to linear complexity

Modularity

Pub

donderdag 24 maart 2011

EntropyE

func

tiona

lity

Emodularizationdonderdag 24 maart 2011

EntropyE

func

tiona

lity

Emodularizationdonderdag 24 maart 2011

EntropyE

func

tiona

lity

Emodularizationdonderdag 24 maart 2011

EntropyE

func

tiona

lity

Emodularizationdonderdag 24 maart 2011

EntropyE

func

tiona

lity

Emodularizationdonderdag 24 maart 2011

EntropyE

func

tiona

lity

Emodularizationdonderdag 24 maart 2011

#1 OSGi Complaint:Class Loaders!

donderdag 24 maart 2011

Classloaders & Modularity

donderdag 24 maart 2011

Class Loading Revisited

• Class.forName

• Class path Scanning

• Service Loader

• Thread Context Class Loaders

• Factory, and FactoryBuilders

donderdag 24 maart 2011

A B

C D

• Class loaders are used to provide extensibility and decoupling

• They were not designed for this purpose,

• And class loaders break module boundaries

Class Loading Revisited

Pub

donderdag 24 maart 2011

A B

Class Loading Revisited

Public

donderdag 24 maart 2011

A B

Class Loading Revisited

Public

C

donderdag 24 maart 2011

A B

Class Loading Revisited

Public

IC

donderdag 24 maart 2011

A B

Class Loading Revisited

Public

IC X

donderdag 24 maart 2011

A B

Class Loading Revisited

Public

I

C P

donderdag 24 maart 2011

µServicesWould be nice to mentionhow µServices reduce surface area of design

efficiency of packet based approaches?

but cost of packet based system is congestion - leads into dependency hell?

donderdag 24 maart 2011

#2 OSGi Complaint: Dependency Hell

donderdag 24 maart 2011

Metadata Hell?

donderdag 24 maart 2011

Transitive Hell?

donderdag 24 maart 2011

A B

C D

• Modules require other modules

• Dependencies are transitive

• A → C → D

Coupling

Pub

donderdag 24 maart 2011

A B

C D

• Modules require other modules

• Dependencies are transitive

• A → C → D

Coupling

Pub

donderdag 24 maart 2011

C

A

D

• Fan out is a problem

• A does not transitively depend on D!

• The dependency is caused by (unnecessarily) packing 1 and 2 in the same module

Cohesion

B

donderdag 24 maart 2011

C

A

D

• Fan out is a problem

• A does not transitively depend on D!

• The dependency is caused by (unnecessarily) packing 1 and 2 in the same module

Cohesion

B

2

A

1

donderdag 24 maart 2011

C CC D

• Refactoring can increase the cohesion and reduce coupling

• But now A depends on C1 and B depends on C2

• Package dependencies are more robust to changes

Cohesion

B

2

A

1

donderdag 24 maart 2011

C C D

• Refactoring can increase the cohesion and reduce coupling

• But now A depends on C1 and B depends on C2

• Package dependencies are more robust to changes

Cohesion

B

2

A

1

donderdag 24 maart 2011

Metadata Heaven?

donderdag 24 maart 2011

Requires Tools

donderdag 24 maart 2011

Tools

Refer to

Application

Policy Resolver

Request deployment of a

component, e.g. a Bundle,

WAR, WAB or EAR

App

Policy

Repository

Resolve

Dependencies

according to

Policy

Provision

component and

dependencies

1

3

4

Nimble

2

donderdag 24 maart 2011

Tools

Refer to

Application

Policy Resolver

Request deployment of a

component, e.g. a Bundle,

WAR, WAB or EAR

App

Policy

Repository

Resolve

Dependencies

according to

Policy

Provision

component and

dependencies

1

3

4

Nimble

2

donderdag 24 maart 2011

OSGiBuild Tools

OSGiRuntime Tools

OSGiCloud Tools

...

donderdag 24 maart 2011

OSGiBuild Tools

OSGiRuntime Tools

OSGiCloud Tools

...

donderdag 24 maart 2011

How to Manage Complexity?

• Prepare to spend energy!

• Architecture = µservice model

• Use tools to manage Metadata and Dependencies

• Small increments

• One test is worth a thousand opinions.

donderdag 24 maart 2011

top related