Modular Architectures: What they are why do they matter now.

124
MODULAR ARCHITECTURES By Param Rengaiah (@its_param) March 18, 2014 What they are and why do they matter now.

description

Software systems evolve over time. Most of them through, are quick and small ones - hacks. These changes, over a period of time makes the code spaghetti, difficult to understand, gathers tremendous Technical Debt and along they way looses the design principles by which they are designed in the first place. Fixing these problems will be risky, tedious and expensive and definitely not without the support of a proven framework.This is the first problem. There is another force that will require significant changes to existing software systems. This force is created by the changing landscape of expectations due to technologies such as cloud, big-data and REST as well as emotional experience across all touch points, not just on PCs. This is the second problem. Modular architecture addresses both these problems. It is not a novel thought or an isolated architectural style, but a structured way to refactor, rather restructure the code to make the systems easier to understand, extend and adopt to the new paradigms. The focus of Modular Architecture is the structural and physical design.

Transcript of Modular Architectures: What they are why do they matter now.

Page 1: Modular Architectures: What they are why do they matter now.

MODULAR ARCHITECTURES

By Param Rengaiah (@its_param)

March 18, 2014

What they are and why do they matter now.

Page 2: Modular Architectures: What they are why do they matter now.

PROLOGUEHistory matters, at least to me.

Page 3: Modular Architectures: What they are why do they matter now.
Page 4: Modular Architectures: What they are why do they matter now.
Page 5: Modular Architectures: What they are why do they matter now.

This is a three part story.

Page 6: Modular Architectures: What they are why do they matter now.

PART IDefinition, Sort of.

Page 7: Modular Architectures: What they are why do they matter now.

What is

Software Architecture?

Page 8: Modular Architectures: What they are why do they matter now.

The word software architecture intuitively denotes the high level structures of a software system.

- Wikipedia

Page 9: Modular Architectures: What they are why do they matter now.

1STRUCTUREOF THE SYSTEM

Page 10: Modular Architectures: What they are why do they matter now.

2PROCESSOF CREATING SUCH STRUCTURES

Page 11: Modular Architectures: What they are why do they matter now.

3RECORDOF THIS STRUCTURE

Page 12: Modular Architectures: What they are why do they matter now.

STYLESArchitecture are indicated in terms of their

Page 13: Modular Architectures: What they are why do they matter now.

MANY STYLES

An useful system always uses

Page 14: Modular Architectures: What they are why do they matter now.

LAYEREDSTYLE 1

Page 15: Modular Architectures: What they are why do they matter now.
Page 16: Modular Architectures: What they are why do they matter now.

PHYSICAL LAYOUT

Focuses on

Page 17: Modular Architectures: What they are why do they matter now.

SERVICE ORIENTED

STYLE 2

Page 18: Modular Architectures: What they are why do they matter now.
Page 19: Modular Architectures: What they are why do they matter now.

INTEGRATION & CUMMINICATION

Focuses on

Page 20: Modular Architectures: What they are why do they matter now.

What is

Modular Architecture?

Page 21: Modular Architectures: What they are why do they matter now.

GOING ONE STEP FURTHER

Modular Architecture is

Page 22: Modular Architectures: What they are why do they matter now.

SMALLER MODULES

Dividing a layer or a service into

Page 23: Modular Architectures: What they are why do they matter now.

deployable, manageable, natively reusable, composable, stateless unit of software that provides a concise interface to consumers. - Kirk Knoernschild

MODULE IS A

Page 24: Modular Architectures: What they are why do they matter now.

CHARACTERISTICSOf a module are

Page 25: Modular Architectures: What they are why do they matter now.

1PHYSICALSHOULD BE

Page 26: Modular Architectures: What they are why do they matter now.

2SCOPECLEAR BUSINESS

Page 27: Modular Architectures: What they are why do they matter now.

3 LAYERSCONFINES WITHIN EXISTING

Page 28: Modular Architectures: What they are why do they matter now.

4CONTEXTWORKS WITHIN ITS

Page 29: Modular Architectures: What they are why do they matter now.

5RATE OF CHANGE

SCOPED BY

Page 30: Modular Architectures: What they are why do they matter now.

6 INTERFACEEXPRESSED THROUGH PUBLIC

Page 31: Modular Architectures: What they are why do they matter now.

7STATELESSMODULE INTERFACES ARE

Page 32: Modular Architectures: What they are why do they matter now.

JARA module in Java can be expressed as

Page 33: Modular Architectures: What they are why do they matter now.
Page 34: Modular Architectures: What they are why do they matter now.

COMPOSITION & COMPREHENSION

Focuses on

Page 35: Modular Architectures: What they are why do they matter now.

BENEFITSOf Modular Architectures

Page 36: Modular Architectures: What they are why do they matter now.

1UNDERSTANDHELP US

Page 37: Modular Architectures: What they are why do they matter now.

2EXTENDINGMAKES IT EASY FOR

Page 38: Modular Architectures: What they are why do they matter now.

3DEPENDENCYHELP US MANAGE

Page 39: Modular Architectures: What they are why do they matter now.

Enabling us to

Page 40: Modular Architectures: What they are why do they matter now.

ARCHITECT ALL THE WAY DOWN

Page 41: Modular Architectures: What they are why do they matter now.
Page 42: Modular Architectures: What they are why do they matter now.

Provide us with

Page 43: Modular Architectures: What they are why do they matter now.

DESIGN TIME MODULARITY

Page 44: Modular Architectures: What they are why do they matter now.

RUNTIME MODULARITY

Page 45: Modular Architectures: What they are why do they matter now.

But my system is already modular.

Page 46: Modular Architectures: What they are why do they matter now.

FRAMEWORKDOES NOT MAKE CODE MODULAR

Page 47: Modular Architectures: What they are why do they matter now.

A NEW LANGDOES NOT MAKE CODE MODULAR

Page 48: Modular Architectures: What they are why do they matter now.

SOADOES NOT MAKE CODE MODULAR

Page 49: Modular Architectures: What they are why do they matter now.

PRETTY DIAGRAMDOES NOT MAKE CODE EASY TO UNDERSTAND

Page 50: Modular Architectures: What they are why do they matter now.

PHYSICAL DESIGNIS THE ONLY THING THAT HELP YOU UNDERSTAND, EXTEND AND MANAGE.

Page 51: Modular Architectures: What they are why do they matter now.

PART IIPrerequisites, Sort of.

Page 52: Modular Architectures: What they are why do they matter now.

But why would we want to restructure in the first place?

Page 53: Modular Architectures: What they are why do they matter now.

VISIONARCHITECTS

Page 54: Modular Architectures: What they are why do they matter now.
Page 55: Modular Architectures: What they are why do they matter now.

RESULT IS?

Page 56: Modular Architectures: What they are why do they matter now.
Page 57: Modular Architectures: What they are why do they matter now.

REALITY ISAfter a year or so,

Page 58: Modular Architectures: What they are why do they matter now.
Page 59: Modular Architectures: What they are why do they matter now.
Page 60: Modular Architectures: What they are why do they matter now.
Page 61: Modular Architectures: What they are why do they matter now.
Page 62: Modular Architectures: What they are why do they matter now.

SPAGHETTI

Complicated, difficult to understand,and impossible to maintain is

Page 63: Modular Architectures: What they are why do they matter now.

BRIAN FOOTE JOSEPH YODER

[ Big ball of mud / spaghetti ] systems show unmistakable signs of unregulated growth and repeated, expedient repair.

Page 64: Modular Architectures: What they are why do they matter now.

DESIGN ROT

Tightly coupled code with excessive dependencies is known as

Page 65: Modular Architectures: What they are why do they matter now.

ROBERT C. MARTIN (UNCLE BOB)

There are four primary symptoms that tell us that our designs are rotting : rigidity, fragility, immobility, and viscosity.

Page 66: Modular Architectures: What they are why do they matter now.

TECHNICAL DEBT

When you choose to defer internal things that will impede future development, you incur

Page 67: Modular Architectures: What they are why do they matter now.

MARTIN FOWLER

Development organizations let their debt get out of control and spend most of their future development effort paying crippling interest payments.

Page 68: Modular Architectures: What they are why do they matter now.

Restructuring addresses

Page 69: Modular Architectures: What they are why do they matter now.

1 LOGICALDESIGN FLAWS

Page 70: Modular Architectures: What they are why do they matter now.

MARTIN FOWLER

I see refactoring as a very specific technique to do the more general activity of restructuring.

Restructuring is any rearrangement of parts of a whole.

Page 71: Modular Architectures: What they are why do they matter now.

The physical architecture is the skeleton of the system – if it is malformed, there is no cosmetic remedy for alleviating its unpleasant symptoms.

JOHN LAKOS

Page 72: Modular Architectures: What they are why do they matter now.

2PHYSICAL& STRUCTURAL DESIGN FLAWS

Page 73: Modular Architectures: What they are why do they matter now.

Restructuring to Modularity.

Page 74: Modular Architectures: What they are why do they matter now.

I was fortunate to have these …

Page 75: Modular Architectures: What they are why do they matter now.

1MODULARITY PATTERNS

A BOOK ON

Page 76: Modular Architectures: What they are why do they matter now.
Page 77: Modular Architectures: What they are why do they matter now.

2 UI MODULESEPERATE

Page 78: Modular Architectures: What they are why do they matter now.

GWT

Page 79: Modular Architectures: What they are why do they matter now.

3 DOMAIN MODEL

SEPERATE

Page 80: Modular Architectures: What they are why do they matter now.

Ubiquitous Language

Page 81: Modular Architectures: What they are why do they matter now.

4 EXTERNAL INTEGRATION

ISOLATED

Page 82: Modular Architectures: What they are why do they matter now.

Clear business context. Explicit boundary. Physical adapters.

Page 83: Modular Architectures: What they are why do they matter now.

5 RULES & WORKFLOW

GROOVY BASED

Page 84: Modular Architectures: What they are why do they matter now.

Essential ComplexityVsAccidental Complexity

Choice between

Page 85: Modular Architectures: What they are why do they matter now.

6DESIGN & ARCH REVIEWS

PERIODIC

Page 86: Modular Architectures: What they are why do they matter now.

Making choices under given context and constraints.

Architecture is about

Page 87: Modular Architectures: What they are why do they matter now.

7 TRUST & FAITH

STAKEHOLDERS SHOULD HAVE

Page 88: Modular Architectures: What they are why do they matter now.

Trusting is one thing, but keeping you on the toe is another.

Page 89: Modular Architectures: What they are why do they matter now.

8 IMPL TEAMROCK STAR

Page 90: Modular Architectures: What they are why do they matter now.

Willing to unlearn what you have known for years.

Page 91: Modular Architectures: What they are why do they matter now.

PART IIIThe works, if you say so.

Page 92: Modular Architectures: What they are why do they matter now.

16 to 82Number of JAR modules

Page 93: Modular Architectures: What they are why do they matter now.

How did we do it?

Page 94: Modular Architectures: What they are why do they matter now.

Arrive at a “Ubiquitous Language” for the domain model.

Page 95: Modular Architectures: What they are why do they matter now.

Simply the lifecycle of managed resources.

Page 96: Modular Architectures: What they are why do they matter now.

Catalog the lifecycle events, triggers, contexts and swim-lanes.

Page 97: Modular Architectures: What they are why do they matter now.

Refactor the domain model to confer to the new ubiquitous language.

Page 98: Modular Architectures: What they are why do they matter now.

Extract core domain model and reference models as separate modules.

Page 99: Modular Architectures: What they are why do they matter now.

Create a separate module to manage each stage of lifecycle for each resource.

Page 100: Modular Architectures: What they are why do they matter now.

Divide the modules further consider rate of change, rate of reuse and for removing cyclical dependencies.

Page 101: Modular Architectures: What they are why do they matter now.

Create a contract module for each external system as it relates to your business

Page 102: Modular Architectures: What they are why do they matter now.

For each of above logical modules, create two physical modules - a spec and an implementation.

Page 103: Modular Architectures: What they are why do they matter now.

Manage physical dependencies through spec modules.

Page 104: Modular Architectures: What they are why do they matter now.

Create deployable modules as a composition of smaller modules (WAR).

Page 105: Modular Architectures: What they are why do they matter now.

Deployed module endpoints are exposed as stateless REST APIs.

Page 106: Modular Architectures: What they are why do they matter now.

Composition provides runtime inter-module integrations.

Page 107: Modular Architectures: What they are why do they matter now.

Composition essentially addresses time and space.

Page 108: Modular Architectures: What they are why do they matter now.

Scalability is baked into composition.

Page 109: Modular Architectures: What they are why do they matter now.
Page 110: Modular Architectures: What they are why do they matter now.

You will arrive at an event-driven, message-driven, comprehensible, extensible, scalable

and maintainable system.

Page 111: Modular Architectures: What they are why do they matter now.

EPILOGUEWhy does it matter now? Finally.

Page 112: Modular Architectures: What they are why do they matter now.

Have you been asked to do any of this?

Page 113: Modular Architectures: What they are why do they matter now.

LETS ADD A MOBILE SKIN

Page 114: Modular Architectures: What they are why do they matter now.

WE SHOULD SUPPORT TOUCH

DEVICES

Page 115: Modular Architectures: What they are why do they matter now.

PUT IT ON THE CLOUD

Page 116: Modular Architectures: What they are why do they matter now.

100% SOA

Page 117: Modular Architectures: What they are why do they matter now.

ITS A SAAS APP BABY!

Page 118: Modular Architectures: What they are why do they matter now.

WE SUPPORT BIG DATA

Page 119: Modular Architectures: What they are why do they matter now.

WE DID “RESPONSIVE WEB

DESIGN”

Page 120: Modular Architectures: What they are why do they matter now.

Modular Architecture prepares you for the future.

Page 121: Modular Architectures: What they are why do they matter now.

Talking about new trends..

Page 122: Modular Architectures: What they are why do they matter now.

REACTIVE ARCHITECTURE

Page 123: Modular Architectures: What they are why do they matter now.

Modular Architecture is an essential facet of RESPONSIVE ARCHITECTURE.

Page 124: Modular Architectures: What they are why do they matter now.

Thank You.Follow me at @its_param