Date post: | 16-Apr-2017 |
Category: |
Software |
Upload: | bojan-veljanovski |
View: | 413 times |
Download: | 2 times |
User Intent - Reads and Writes
- WRITE is a request modeled as COMMAND triggered via HTTP POST
- READ is a request modeled as QUERY triggered via HTTP GET
- Commands modify data
- Queries retrieve data
3
User Intent - CQRS
CQRS is a simple pattern, writing and reading data is placed in 2 separate classes which have single responsibility.
4
What we are going to talk about
- Overview
- Horizontal vs. Vertical user stories
- Horizontal vs. Vertical slices
- Commands & Queries
- Feature folders
- DEMO code
- Summary
6
Horizontal vs. Vertical user stories
- Horizontal- Story 1: Create the new DB Table for Users
- Story 2: Create the DAL to access the DB Users
- Story 3: Create the Users business layer code that references the DAL
- Story 4: Write the Users UI screen
- Vertical- Story 1: User can register and provide username and
password.
- Story 2: User can manage multiple addresses.
- Story 3: User can add additional contact fields (phone, email, etc).
- Story 4: User can subscribe to a subscription plan.
- Story 5: Admin can manage subscription plans and pricing.
8
Horizontal vs. Vertical user stories
- Horizontal- Implement the database layer for A, B and C- Implement the business logic layer for A, B
and C- Implement the user interface for A, B and C
- Vertical- Implement A from end to end- Implement B from end to end- Implement C from end to end
9
Horizontal slicing is not natural in agile
- Changes usually happen vertically - You limit your application to the same horizontal
constraints for all features (regardless of the size and complexity)
- ...and more
10
Vertical Slices over Horizontal Slices
- Horizontal slices is organization by technical layers.
- Vertical slices is organization by features (business requirements).
12
Vertical Slicing: The Stakeholder
Stakeholders talk and eat the cake in vertical slices. They want one delicious piece at a time, not only the vanila part.
Why don't we structure our code vertically as well?
13
SUMMARY: Characteristics of good Vertical Slices- Code is structured primarily by feature,
secondary by layer- Have single responsibility (business-oriented)- Encapsulated and decoupled from other slices
- Complexity and defects are isolated in each slice, instead of each layer
- Increases developer’s understanding of each feature as a whole
- Enables incremental releases of features- Enables faster feedback loop- Enables support for potential simpler scaling out
- By Read/Write mechanics (CQRS), or- By Feature as a whole (SOA)
27