there are only 3 operations in a web app

23
There are only 3 operations in a web application (or maybe 2)

Upload: simon-smith

Post on 04-Jul-2015

46 views

Category:

Technology


0 download

DESCRIPTION

tech stuff

TRANSCRIPT

Page 1: There are only 3 operations in a web app

There are only 3

operations in a web

application (or maybe 2)

Page 2: There are only 3 operations in a web app

Worked on lots of web applications

Seems to be lots of attempts at the same

problems

Typically non-SOLID solutions

History

Page 3: There are only 3 operations in a web app

Without SOLID web applications are

Difficult to maintain

Buggy

Difficult to scale

History

Page 4: There are only 3 operations in a web app

As any other application

Identify the entities

Identify the operations these entities execute

Back to basics

Page 5: There are only 3 operations in a web app

Web applications have lots of entities

Customer … Order … Hotel … Basket … Page

… Section … SubSection … etc.

Back to basics

Page 6: There are only 3 operations in a web app

However the stateless nature of the web

plus user expectations lead to …..

Back to basics

Page 7: There are only 3 operations in a web app

… A limited number of operations

1. Find 0 or more entities

2. Add a new entity

3. Change an entity

The big idea.

Page 8: There are only 3 operations in a web app

… A limited number of operations

1. Find 0 or more entities

2. Add a new entity

3. Change an entity

Sometimes combined into a ‘Crupdate’

The big idea.

Page 9: There are only 3 operations in a web app

Sign up? Add item to basket? Log error?

Add new entity

Login? Get Hotel Details? View sale items ?

Find 0 or more entities

Update password?

Change an entity

The big idea.

Page 10: There are only 3 operations in a web app

So … can we make a framework that

abstracts away all the common parts of

these operations, allowing us to produce

SOLID software with the minimum of

changes?

The big idea

Page 11: There are only 3 operations in a web app

So … can we make a framework that

abstracts away all the common parts of

these operations, allowing us to produce

SOLID software with the minimum of

changes? ….. MAYBE?

The big idea

Page 12: There are only 3 operations in a web app

How about creating a suite of “Micro

services” for each entity.

The service contains all the (validation)

business logic for the entity, returning the

results in a consistent way. ….

The big idea.

Page 13: There are only 3 operations in a web app

These micro services can only be reached

through a message, making them fully

decoupled from the consuming application.

The big idea.

Page 14: There are only 3 operations in a web app

A POCO class whose single responsibility is

to transmit information between the

provider and the producer

The Message

Page 15: There are only 3 operations in a web app
Page 16: There are only 3 operations in a web app
Page 17: There are only 3 operations in a web app

A POCO class whose sole responsibility is to

update the state of the message.

Simple to test.

Simple to read.

Only place for business logic.

The Message Processor

Page 18: There are only 3 operations in a web app
Page 19: There are only 3 operations in a web app
Page 20: There are only 3 operations in a web app

Can be consumed by any .net framework.

As there is no business logic consuming is

simple.

Every message is consumed in the same

way, so consuming code follows a similar,

simple pattern.

Consuming with MVC

Page 21: There are only 3 operations in a web app
Page 22: There are only 3 operations in a web app

● Normalising code to its common

components reduces repeated code.

● Normalising code to its common

components reduces the amount of code

needed.

● Normalising code to its common

components encourages SOLID software.

Epilogue

Page 23: There are only 3 operations in a web app

Questions...