do i still hate soa?

Post on 23-Feb-2016

33 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Do I still hate SOA?. JavaZone Johannes Brodwall, Steria Organized Architect Steria Norway. Crazy trucker coder is right. What do I care about ?. People ( def : Users and programmers). In large projects ( def : 10-100 people ). In complex orgs - PowerPoint PPT Presentation

TRANSCRIPT

Do I still hate SOA?

JavaZoneJohannes Brodwall, Steria Organized Architect

Steria Norway

Crazy trucker coder is right

What do I care about?

People(def: Users and programmers)

In large projects(def: 10-100 people)

In complex orgs(def: Where integration is

paramount)

(Frustration)

(Joy)

How we don’t want our projects to beArchitecture impacts people

Teams Produce Business-valueFeature oriented teams Simple technology

Reference architecture

Reuse Costs and benefits

Strategic and tactical

J Random

Consider John Random Developer

Rules Engine Team

Front End Team

Service Layer Team

PM

J Random

Jira

J Random

”User gets DataBindingException

when submitting payment (see attached SOAP msg)”

Test server

Payment svc

J Random

Reproduce…

Test server

Payment svc

J Random

J Random

Payment Service

Payment XML

Payment DTO

Domain

Rules DTO

Rules XML

Rules

Which of the layers is the bug in…?

Rules Engine Team

Front End Team

Service Layer Team

PM

J Random

You sent a new field: currency

Rules Engine Team

Front End Team

Service Layer Team

PM

J Random

You sent a new field: currency

Didn’t you get the memo?

J Random

Sigh!

Payment Service

Payment XML

Payment DTO

Domain

Rules DTO

Rules XML

Rules

J Random

Test serverNew version

J Random

Test server

New version

Test server

New version

J Random

Let’s test it out

Test server

J Random

Okay

Okay

OkayOkay

OkayOkay

Okay

Okay

Not okay

It look good. Waaait….

Test server

J Random

Okay

Okay

OkayOkay

OkayOkay

Okay

Okay

Not okay

Duh! Null pointer exception!

J Random

Test serverNew version

J Random

Test server

New version

How did it get to this?

J Random

What does the program do?

I’m just a small cog in a big

machine

What’s up with all this data shuffling?

Bad architecture

UI UI UI UI

Service Service Service Service

Data Data Data Data

Reused service Reused library

Bad architecture

Technol-orgy Reuse fixation

Team per component

Suffering

Rules Engine Team

Front End Team

Service Layer Team

PM

Of course the Front End guys can deal with

an empty list

Rules Engine Team

Front End Team

Service Layer Team

PM

I better check that field is

present

I better check that field is

presentI better check that field is

present

Rules Engine Team

Front End Team

Service Layer Team

PMI wonder if anyone will

use this

Rules Engine Team

Front End Team

Service Layer Team

PM

Done with A soon?

Rules Engine Team

Front End Team

Service Layer Team

PM

Done with A soon?

I’m done, I just have to wait for

the rules engine!

Rules Engine Team

Front End Team

Service Layer Team

PM

Done with A soon?

I’m done, I just have to wait for

the rules engine!… and then test it

Rules Engine Team

Front End Team

Service Layer Team

PM

Done with A soon?

I’m done, I just have to wait for

the rules engine!… and then test it

… and then fix that tiny bug

Rules Engine Team

Front End Team

Service Layer Team

PM

Done with A soon?

I’m done, I just have to wait for

the rules engine!

I better hurry with B, everyone’s

waiting

Bahamas!

Rules Engine Team

Overworked!

Proud dad!

Front End Team

Service Layer Team

PM

Baby

!

Bahamas!

Rules Engine Team

Overworked!

Proud dad!

Front End Team

Service Layer Team

PM

Can you guys help out?

Baby

Bahamas!

Rules Engine Team

Overworked!

Proud dad!

Front End Team

Service Layer Team

PM

Can you guys help out?

Baby

Would love to help, but I don’t

know rules engine

Overworked!

Rules Engine Team

Front End Team

Service Layer Team

PM

This iteration, Product Owner just wants to improve the UI

!

There is an alternative!

(There are many)

(And this is mine)

Organization Architecture

UI UI UI UI

Service Service Service Service

Data Data Data Data

Reused service Reused library

UI UI UI UI

Service Service Service Service

Data Data Data Data

Reused service Reused library

A feature teamIs connected to a userHas a reference stackOwns the whole stack

User:Human or machine

GUI

Logic

Data

Service

Machines are people, too!

Simplicity

SimplicityAvoid technolorgy

(My reference architecture)

Fewer deployed artifacts

Executable jar file

App Server (Jetty jar)

Web application (war)

ClientClient Jar (Java

Web Start)

Fewer maven modules

Server WAR

Core classes

Client JAR

Fewer external dependencies

Control instansiation

No DTO

Embedded app server

Boring choices

Messaging

MigrationsHibernate

Deployment

Packaging

FitNesse

Database

SOAP over httpEntitieshttp remoting

MonitoringUnit tests

Commands

Scenarios

UI overview

Application Frame [http://server:8088/service]Menu

Work area

Toolbar

PersonWindowPersonWindowWindow 2Window 2Etc.

UI calls server

TODO: Code action listener calls server

UI server

TODO: Command calls repo

TODO: Repository interface

RepositoryHibernateThe real dealVery slow startup

HashMapIn memory fake

Quick startupUsed for unit tests

TODO: Repository interface

private Specification<Person> getSpecification() { return new FilterSpecification<Person>() { @Override public void populate(EntityFilter filter) { filter.propertyEqualsOrNull( "country", country); filter.propertyMatchesOrNull( "name", namePattern); } };}

@RunWith(RepositoryTestRunner.class)public class PersonWindowTest { private Repository repository; private PersonWindow personWindow; public PersonWindowTest(Repository repo) { this.repository = repo; this.personWindow = new PersonWindow(repo); }

@Testpublic void should_find_people() { Person person = new Person(“John Random"); repository.insert(person); personWindow.getSearchButton().doClick(); assertEquals(personWindow.getTableCell(0,1), person.getName());}

Integration

Transactional

File System File Scanner File Writer Message

Responder Repository

Scan

Move to tmp

Next message

CommitDelete file

Find data

Write response

Transactional

Next responseWrite to tmp

Commit

Move to targetTransactional

Hexagonal architecture

Application

UI

FileSystmAdapter

HttpSoapAdapter

Hibernate

Repository

Entities

Command

Dissent

Poll vs pushProgrammer provides proof

SQLBest requirement fit

Server abstractionDevelopers show the way

SpecificationDevelopers required better

abstractions

HibernateGo to Christin’s lightning talk

(T -24hrs)

Key points

Ubiquitious entitiesGeneric repositoryCommand oriented

A feature teamIs connected to a userHas a reference stackOwns the whole stack

Reuse

Don’t make

Strategic decisionbased on

Tactical reasons

Value of reuse

Value of reuse =Cost of new dev – cost of reuse

Value of reuse =Cost of new dev

-cost of reusability - cost of reusing

- cost of governance

Relative cost of writing for reuse:125%-300%

Relative cost of writing for reuse:125%-300%

Publishing

Input validation

Wider usage

Documentation

Testing

Relative cost of reuse:10%-40%

Relative cost of reuse:10%-40%

Learning

Not finding

Bugs

Finding

Adapting

Surface to volume ratio

Reuse governance

Client A 1.0 Client B 1.0

Enterprise Payment

Client A 1.0 Client B 1.0

Enterprise Payment

Client A 2.0 Client B 1.0

Enterprise Payment 2.0

Client A 2.0 Client B 1.0

Enterprise Payment 2.0

Client A 1.0 Client B 1.0

Service 1.0

Stable (AKA dead) service

Client A 2.0 Client B 1.0

Service 2.0

Service1.0

Library reuse

Client A 2.0 Client B 1.0

Service 2.0

Adapter

Multi version service

Client A 2.0 Client B 1.0

Magic box!! !

Service 2.0

Service bus

Value of reuse =Cost of new dev – cost of reuse

High value

https://www.paypal.com/cgi-bin/webscr?business=paypal%40smidig.no&cmd=_cart&upload=1&currency_code=N

OK&notify_url=http%3A%2F%2Fstagingsmidig.heroku.com

%2Fpayment_notifications&return=http%3A%2F%2Fstagingsmidig.heroku.com%2Fusers

%2F485&invoice=2011t-486&amount_1=10.0&item_name_1=Earlybird-

billett+til+Smidig+2011&item_number_1=1&quantity_1=1

EDIFACT

EDIFACT(The UN punishes those

who speak ill of XML)

High value

Medium value

java.util.Collection

Hibernate, Spring

Medium value

Low value

Apache commons

java.net.HttpURLConnection

Low value

Negativ value

Dozer

The library the other team made because

they didn’t like Dozer

The ”Save Customer” service

Negativ value

Strategic reuse

Strategic reuseHigh value

Often servicesNew functionality

Tactical reuse

Tactical reuseLow value

Often componentReduce cost

Opportunistic

Don’t make

Strategic decisionbased on

Tactical reasons

Conclusion

What does this have to do with SOA?

What does this have to do with SOA?(Very little)

Architectural choicesAffect peopleConway’s law

ReuseTactical vs strategic

Feature oriented team

As a programmer1. Meet the user

2. Own the whole stack3. Speak your mind

As an architect1. Organize teams per feature

2. Simple reference architecture3. Welcome dissent

Do you agree?

You haven’t learned a thing!

Please disagreejohannes.brodwall@steria.no

http://johannesbrodwall.comhttp://sterkblanding.no

http://twitter.com/jhannes

top related