Context is King Finding Service Boundaries Derek Comartin
Context is King Finding Service Boundaries Derek Comartin @codeopinion. com
Context
What is a Service? Meaningless Term…
Tenets of SOA Service-Oriented Architecture Boundaries are Explicit Services are Autonomous Services share schema not class Services Compatibility is based on Policy
Tenets of SOA Service-Oriented Architecture Boundaries are Explicit Services are Autonomous Services share schema not class Services Compatibility is based on Policy
Tenets of SOA Boundaries are Explicit Capabilities Data Ownership Message Contracts
Function Behavior without Data
Database Data without Behavior
Tenets of SOA Service-Oriented Architecture Boundaries are Explicit Services are Autonomous Services share schema not class Services Compatibility is based on Policy
Tenets of SOA Services are Autonomous Self Governing Replaceable No External Dependencies
Tenets of SOA Service-Oriented Architecture Boundaries are Explicit Services are Autonomous Services share schema not class Services Compatibility is based on Policy
Tenets of SOA Share Schema not Class Message Contracts Backwards Compatibility Not tech specific
Tenets of SOA Service-Oriented Architecture Boundaries are Explicit Services are Autonomous Services share schema not class Services Compatibility is based on Policy
Tenets of SOA Service Compatibility based on Policy Constraints Security Communication
Services Boundaries Who Cares? Why do we want services boundaries?
Big Ball of Mud High Coupling
Distributed Big Ball of Mud Request/Response over HTTP
Service Self Governing Application Database
Autonomous Service Self Governing Sales Service Application Database Shipping Service Application Database
Autonomous Service Self Governing Sales Service Application Database Shipping Service Application Database
Autonomous Service Self Governing Application Database Broker
Autonomous Service Self Governing Sales Service Application Database Order Placed Event Broker Shipping Service Application Database
Little Balls of Mud Low Coupling Service A Service B Service C Event Message Broker Service D Service E
Service Counter Intuitive
Service Authority A service is the authority of a set of business capabilities.
Finding Service Boundaries How Language Context Perspective Questioning
Finding Service Boundaries How Language Context Perspective Questioning
Bounded Context Language
Bounded Context Product isn’t a Product
Bounded Context Product isn’t a Product
Bounded Context Price vs Cost Sales vs Purchasing
Finding Service Boundaries How Language Context Perspective Questioning
Bounded Context Taken out of Context If a statement or remark is quoted out of context, the circumstances in which it was said are not correctly reported, so that it seems to mean something different from the meaning that was intended.
Service Boundaries Context Matters
Finding Service Boundaries How Language Context Perspective Questioning
Service Boundaries Perspective
Service Boundaries 4+1 Architecture View Model
Finding Service Boundaries Entities Product • SKU • Name • Description • Price • Cost • Quantity
Finding Service Boundaries Entities Catalog • SKU • Name • Description • Quantity Sales • SKU • Price Purchasing • SKU • Cost
Finding Service Boundaries How Language Context Perspective Questioning
Finding Service Boundaries Right Questions Does sales need the product quantity? Catalog • SKU • Name • Description • Quantity Sales • SKU • Price Purchasing • SKU • Cost
Finding Service Boundaries Available to Promise Catalog • SKU • Name • Description Sales • SKU • Price • ATP Purchasing • SKU • Cost Warehouse • SKU • Quantity • Location
Service Boundaries Wrong Questions Is the sale price ever dictated by the product description?
Implementation Vertical Slices not Layers
Application Layers Web Framework Authorization Validation Data Access Model Database
Feature Driven Feature Model Database Feature
Single Feature Controller Authorization Validation Execution Model Database
Single Feature ASP. NET MVC Policy Auth Fluent Validation Entity Framework Model Database
Single Feature ASP. NET Core Role Auth Custom Validation Dapper Model Database
Services Service B Service A Feature Feature Model Database Feature
Pub/Sub Service A Service B Service C Event Message Topics Service D Service E
Pub/Sub Sales Invoicing Shipping Order Invoiced Message Topics Order Placed Purchasing Inventory Adjusted Warehouse Receiving
UI Composition
UI Composition
Finding Service Boundaries How Language Context Perspective Questioning
Finding Service Boundaries What Prefer Messaging of RPC Autonomy Data Authority
Finding Service Boundaries Resources Four Tenets of SOA http: //architectopia. blogspot. com/2008/01/four-tenets-of-soa. html 4+1 Architecture View Model https: //www. cs. ubc. ca/~gregor/teaching/papers/4+1 view-architecture. pdf Composite UIs for Microservices https: //jimmybogard. com/composite-uis-for-microservices-a-primer/
That’s it… Thanks! Derek Comartin @codeopinion. com
- Slides: 60