software architecture patterns - sdd conferencesddconf.com › brands › sdd › library ›...

Post on 27-Jun-2020

38 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Software Design and Development Conference 2015

Mark RichardsHands-on Software ArchitectAuthor of Enterprise Messaging Video Series (O’Reilly)Author of Java Message Service 2nd Edition (O’Reilly)Co-author of Software Architecture Fundamentals Video Series (O'Reilly)

Software Architecture Patterns

Software Architecture Fundamentals Video Series Enterprise Messaging Video Series

introductionlayered architecture patternevent-driven architecture patternmicrokernel architecture patternspace-based architecture pattern

agenda

Software Architecture Pattern Analysis

module

module

module

module

module

module

module

module

module

module

module

modulemodule

module

module

module

module

module

module

module

module module

module

module

modulemodule

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

modulemodule

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

module

componentmodule

module

module

module

module

module

componentan encapsulated unit of software consisting of one or more modules that has a specific role and responsibility in the system

componentcomponent

component

component

component

component

component

component

component

?

how do components interact?does the architecture scale?how responsive is the architecture?is there a logical flow to the components?what are the deployment characteristics?how does the architecture respond to change?is the architecture extensible and if so how?how maintainable is the architecture?

how are components classified?

architecture patterns help define the basic characteristics and behavior of the

application

layered architecture

presentation layer

business layer

persistence layer

database layer

component component component

component component component

component component component

presentation layer

business layer

persistence layer

database layer

component component

component component

component component

component

component

component

layered architecture

request

layered architecture

presentation layer

business layer

persistence layer

database layer

component component component

component component component

component component component

separation of concerns

layered architecture

presentation layer component component component

business layer component component component

persistence layer component component component

database layer

layers of isolation

database layer

presentation layer component component component

persistence layer component component component

business layer component component component

persistence layer component component component

database layer

layered architecture

presentation layer

business layer

component component component

component component component

hybrids and variants

services layer component component component

persistence layer component component component

database layer

layered architecture

presentation layer

business layer

component component component

component component component

hybrids and variants

services layer component component component

persistence layer component component component

database layer

layered architecture

presentation layer component component component

business layer component component component

hybrids and variants

persistence layer component component component

presentation layer component component component

business layer component component component

com

pone

nt

com

pone

nt

layer

database layer

layered architecturehybrids and variants

persistence layer component component component

presentation layer component component component

business layer component component component

com

pone

nt

com

pone

nt

layer

com

pone

nt

com

pone

nt

layer

persistence layer component component component

presentation layer component component component

business layer component component component

layered architecture

considerations

tends to lend itself towards monolithic applications

watch out for the architecture sinkhole anti-pattern

good general purpose architecture and a good starting point for most systems

layered architecture

analysis overall agility deployment testability performance scalability development complexity loose coupling

event-driven architecture

mediator topology broker topology

event queue

event-driven architecture

mediatorevent

event channel

event channel

event channel

mediator topology

event

processorevent

module module

module module

processorevent

module module

module module

processorevent

module module

module module

processorevent

module module

module module

processorevent

module module

module module

event queue mediator

event

event channel

event channel

event channel

mediator topology

event

processorevent

module module

module module

processorevent

module module

module module

processorevent

module module

module module

processorevent

module module

module module

processorevent

module module

module module

event-driven architecture

process engine

adjustmentprocess

notificationprocess

quoteprocess

claimsprocess

customerprocess

you move...

you moved!

notify insurednotify

insured

change address

recalc quote

update claims

adjust claimschange

addressrecalc quote

update claims

adjust claims

event-driven architecture

broker topology

event processorevent

module module

module module

processorevent

module module

module module

event channel

event channel

event-driven architecture

event channel

event channel

event channel

broker topology

event processorevent

module module

module module

processorevent

module module

module module

processorevent

module module

module module

processorevent

module module

module module

processorevent

module module

module module

event-driven architecture

you move...customer process

notification process adjustment process

quote process claims process

you moved!

change address

recalc quote

update claims

change address

update claims

event-driven architecture

considerations contract creation, maintenance,

and versioning can be difficult

must address remote process availability or unresponsiveness

reconnection logic on server restart or failure must be addressed

event-driven architecture

analysis overall agility deployment testability performance scalability development complexity loose coupling

event-driven architecture

microkernel architecture

plug-in component

plug-in component

plug-in component

plug-in component

plug-in component

plug-in component

core system

(a.k.a. plug-in architecture pattern)

microkernel architecture

plug-in module

core system

architectural components

minimal functionality to run systemgeneral business rules and logicno custom processing

standalone independent modulespecific additional rules or logic

microkernel architecture

check other stuff...

check audit writes

check sql calls

check contract

standards

check header standards

check interceptors

microkernel architecture

source validation tool

read source files

validation report

claims processing

MA module

NY module

CA module

GA module

NH module

TX module

NY module

microkernel architecture

plug-in component 1

plug-in component 2

plug-in component 3

plug-in component 4

core system

registryregistry

1: <location>, <contract>2: <location>, <contract>3: <location>, <contract>4: <location>, <contract>

microkernel architecture

registrymicrokernel architecture

static { pluginRegistry.put(NAMING, "ValidatorNamingPlugin"); pluginRegistry.put(SYSOUT, "ValidatorSysoutPlugin"); pluginRegistry.put(AUDIT, "ValidatorAuditPlugin"); pluginRegistry.put(TODO, "ValidatorTodoPlugin"); pluginRegistry.put(COMMENTS, "ValidatorCommentsPlugin"); pluginRegistry.put(SVC_CALLS, null); }

registrymicrokernel architecture

private String executeChecks(String moduleName) throws Exception { for (Map.Entry<String, String> entry : pluginRegistry.entrySet()) { if (entry.getValue() != null) { Class<?> c = Class.forName(PLUGIN_PKG + entry.getValue()); Constructor<?> con = c.getConstructor(); ValidatorPlugin plugin = (ValidatorPlugin)con.newInstance(); data = plugin.execute(data); } } }

plug-in component 1

plug-in component 2

plug-in component 3

plug-in component 4

core system

plug-in contracts

std

std

std

std

microkernel architecture

microkernel architecture

plug-in contracts

public class ValidatorData { public String moduleName; //input public List<String> moduleContents; //input public String validationResults; //output}

public interface ValidatorPlugin { public ValidatorData execute(ValidatorData data);}

considerations

can be embedded or used as part of another pattern

great pattern for product-based applications

great support for evolutionary design and incremental development

microkernel architecture

analysis overall agility deployment testability performance scalability development complexity loose coupling

microkernel architecture

let's talk about scalability for a moment...

web server app server

web server

web server

web server

web server

web server

web server

app server

app server

app server

app server

space-based architecture

space-based architecture

db

processing unitprocessing unit processing unit

virtualized middleware

...

messaging grid data grid processing

griddeployment

manager

space-based architecturearchitectural components

db

processing unitprocessing unit processing unit

virtualized middlewaremessaging

grid data grid processing grid

deployment manager

processing unit

processing unit

module module module

data replication engine

in memory data

space-based architecture

middlewaremessaging

grid

data grid

processing grid

deployment manager

space-based architecture

middlewaremessaging

grid

data grid

processing grid

deployment manager

manages input request and session

space-based architecture

middlewaremessaging

grid

data grid

processing grid

deployment manager

manages data replication between processing units

space-based architecture

------------------------ ------------ ------------

middlewaremessaging

grid

data grid

processing grid

deployment manager

manages distributed request processing

space-based architecture

middlewaremessaging

grid

data grid

processing grid

deployment manager

manages dynamic processing unit deployment

space-based architecture

space-based architecture

product implementations

javaspacesgigaspacesibm object gridgemfirencacheoracle coherence

it's all about variable scalability...

good for applications that havevariable load or inconsistent peak times

not a good fit for traditional large-scale relational database systems

relatively complex and expensive pattern to implement

space-based architecture

analysis overall agility deployment testability performance scalability development complexity

space-based architecture

Independent  ConsultantHands-­‐on  So*ware  ArchitectPublished  Author  /  Conference  Speaker

Mark  Richards

h<p://www.wmrichards.comh<p://www.linkedin.com/pub/mark-­‐richards/0/121/5b9

Software Architecture Patterns

top related