SlideShare a Scribd company logo
1 of 60
Download to read offline
Heuristic
“anything that provides a
plausible aid or direction in the
solution of a problem but is in
the final analysis unjustified,
incapable of justification, and
potentially fallible.”
—Billy Vaughn Koen
Heuristics
 Heuristics aid in design
 Guide use of other heuristics
 Even determine our attitude and behavior
Examples
Pithy Phrases?
A Few Useful Engineering Heuristics by Billy Koen
 Heuristic: Solve problems by successive approximations
 Heuristic: Always give an answer
 Heuristic: Always give yourself a chance to retreat
 Heuristic: Use feedback to stabilize the design
 Heuristic: Break complex problems into smaller, more
manageable pieces
 Heuristic: Always make the minimum decision
 Heuristic: Design for a specific time frame (product lifetime)
 Heuristic: Make small changes to your state-of-the-art (sota)
Context
In which situations
can I use this pattern?
Problem
What does it try to solve?
What questions does it answer?
Solution
What can I
do that usually works?
patterns are
nicely
“packaged”
heuristics
Pattern Languages
“In short, no pattern is an isolated entity. Each pattern
can exist in the world only to the extent that is supported
by other patterns: the larger patterns in which it is
embedded, the patterns of the same size that surround it,
and the smaller patterns which are embedded in it.”
—Christopher Alexander
© Can Stock Photo / sauletas
Pattern Languages are never
complete…
© Can Stock Photo / TopVectors
Some Age Well!
© Can Stock Photo / Noofoo
Heuristics May Conflict…
and still be useful
© Can Stock Photo / DaneeShe
 Heuristic: Use a Transaction Script when you have
simple logic for a small database application
 Heuristic: Use a Domain Model when you have
complex logic that you want to model in objects
and can accommodate database mapping
 Heuristic: Use a Table Module when you have
complex (existing) data and you need to write logic
that applies to multiple rows in underlying
database tables
Heuristics:
3 Ways to Structure a Domain Layer
Patterns of Enterprise Application Architecture
Table Module
Heuristic
p
Solvable problems
my problem
Domain Model
Heuristic
Transaction
Script
Table Module
Heuristic
p
Solvable problems
my problem
Rich
Domain Model
Heuristic
Transaction
Script
Heuristics Need to be Challenged
© Can Stock Photo / 4774344sean
Unscientific Chart:
Maintenance Effort*
Database
Script
Complexity of Domain Logic
Effort to
Enhance
Transaction
Script
Domain
Model
Table
Module
*Inspired by the unquantified chart in Fowler’s Patterns of Enterprise Architecture
Unscientific Chart:
Code Reuse Potential*
Database
Script
Transaction Script
Complexity of Domain Logic
Potential
Code
Reuse
Domain
Model
Table
Module
*Inspired by the unquantified chart in Fowler’s Patterns of Enterprise Architecture
“Best Fit” Profiles
Style Design Skills Driving Forces Project
Duration
System
Complexity
System
Longevity
Transaction
Script
Programming Dev speed Short Low Short
Domain
Model- Rich
OO Design Business
concepts in
code
Medium Medium to
High
Medium to
Long
Domain
Model-
Simple
Moderate OO
+DB
Simple
representation
of business
concepts
Medium Medium Medium
Database
script
Specialized Performance,
security
Medium Low to
Medium
Long
Table
Module
DB +
Moderate
prog/OO
design
Technology fit Medium Low to
Medium
Medium to
Long
Rules
Engine
Specialized Complexity/
changeability
Long High Long
…
“As a rule, the more demanding the
application, the more leverage you get from
using a powerful language. But plenty of
projects are not demanding at all. Most
programming probably consists of writing little
glue programs, and for little glue programs you
can use any language that you’re already
familiar with and that has good libraries
for whatever you need to do”
— Paul Graham, Revenge of the Nerds
The “best” is debatable
 Paul Graham’s Heuristic: It doesn’t matter what
programming language you use if you have a simple
program. Use programming languages, tools, and
frameworks and libraries you are familiar with.
 Rebecca: But Paul…
 Heuristic: Use a rich domain model when you have
rich behavior in your application.
 Heuristic: Use transaction scripts for really simple
stuff that isn’t going to change much.
 Heuristic: Learn something new. Don’t always do
things the same way. That’s soul sucking!
“choose the heuristic to use from what
you take to be the best option at the
time you are required to choose.”
—paraphrase of Billy Koen
 We each have our own
cherished heuristics
 As new ones become
useful we add to our
collection
 No longer useful ones fall
out of fashion
 Sometimes, even useful
ones fade away
Our SOTA
(State of the Art)
https://xkcd.com/1823/
Nothing
ever goes
exactly by
the book
Nothing
ever goes
exactly by
the book
 Choices for user input validation:
 How much to validate in the browser?
 Hand code validation logic or use declarative style?
 How much validation is performed by framework-
specific classes: simple, syntactic edits, or more?
 Choices for constraint checking:
 Which objects are assigned constraint checking
responsibilities?
 When are constraints enforced?
 Where to enforce cross-attribute and cross-object
constraints?
An Examination of some Pesky Details:
Validation and Constraint Checking
 Perform simple edits (syntactic) in browser
code
 Don’t universally trust browser-validated edits.
Reapply them if receiving requests from an
untrusted source
 Consistently assign validation responsibilities
to framework-specific validation classes
 Consistently use domain layer validation and
constraint enforcement patterns
Heuristics
My Design Recommendations
✗
 Rationale: Factoring out constraint checking behavior into a
separate class enables constraints be enforced by a domain
service, that can determine when to check constraints.
 Merit: Possible to dynamically configure constraints.
 Drawback: Harder to understand all the rules at once.
Option 1: Make Constraints Explicit
Create Separate Classes
“xxxPolicy” or
“xxxRule” is a
common name
for constraint
objects
Constraint: “An out of stock item can’t be added to an expedited order”
 Rationale: Putting a constraint in the code that changes
the state is most direct.
 Merit: Factoring constraint into an intentionally named helper
method aids discussing with domain experts.
 Drawback: Clutters the domain object with a lot of checking,
creates dependencies on other domain objects. No ability to
modulate when constraints are enforced.
Option 2: Give objects responsibilities for
maintaining their state
Check Constraints in Domain Object
Constraint: “An out of stock item can’t be added to an expedited order”
Responsibility-Driven
Design (RDD)
1990
2002
RDD Concept: Role Stereotypes
Typical behaviors in an object-oriented design
knowing, doing, deciding
 Information holder—knows and provides information.
 Structurer—maintains relationships between objects.
 Service provider—performs work on demand.
 Coordinator—reacts to events by delegating to others.
 Controller—makes decisions & directs actions.
 Interfacer—transforms information and requests
between distinct parts of a software system.
RDD Heuristic:
Blend stereotypes to make objects more responsible.
 Add behaviors to make objects “smarter”
 information holders that compute or derive information based
on other information they maintain
 service providers that maintain information to be more
efficient
 structurers that answer deeper questions or derive facts about
what they are structuring
 interfacers that also transform
Be constantly aware of Overlapping Heuristics
Heuristic: Design objects to do one thing well. (Single Responsibility Principle
from Bob Martin)
Heuristic: Make the overall system simpler by having objects do something with
what they know. (Responsibility-Driven Design Heuristic)
2001
People, Places, Things,
Aggregate Things, Events
Heuristic: Separate out stuff that varies
depending on the current relationship
Heuristic:
Locations can be
hierarchical or even
more complex
Heuristic: Events can be point-in-time,
interval, depend on other events
…and event information is often messy
and complex
Heuristic: By characterizing a domain entity’s attributes you
can understand/find/identify needed system behaviors
 Descriptive Attributes reflect a
domain object properties (not
identity).
 Time-dependent attributes Most
attributes can change values, but for
some, maintaining a history of past
values is important.
 Lifecycle state attributes Some
entities go through a one-way
lifecycle, from initial to final state.
 Operational state Some entities
switch between different states. The
state it is currently in determines how
it behaves.
Create
Active
Store
Reconstitute Database Representation
Database or File Representation
ArchiveDelete
Delete
Modify
Heuristic*:
Distinguish between “superficial” and “domain”
validations and handle them differently
 “superficial”: what must be true, regardless of the state of
the domain
 Heuristic: Validate these before issuing a command, ideally on
the client side as well as the server side
 “superficial” but requires lookup of other information
 Heuristic: Validate in the service before invoking the
command
 “domain”: validity of a command is dependent on the state
of the model
 Heuristic: Validate in domain objects
*http://danielwhittaker.me/2016/04/20/how-to-validate-commands-in-a-cqrs-application/
Sorting out heuristics…
© Can Stock Photo / andrewgenn
Let’s Just Get On With It
© Can Stock Photo / Zinkevych
Sorting things out…
Beware of Dogma
Dogmatic
Synonyms: bullheaded, dictative,
doctrinaire, fanatical, intolerant
Antonyms: amenable, flexible,
manageable
Pragmatic
Synonyms: common, commonsense,
practical, realistic, sensible
Antonyms: idealistic, unrealistic
Heuristics Need Champions
Books, blogs, case studies, critiques
Reference apps
Journaling, design logs..
“The Tactical Modeling patterns were never intended to be the one-and-only way to do
DDD, but many consider them as such. They produce extraneous noise and detract
attention away from the most important, and unique-to-DDD material.”
—Vladik Khononov
*http://vladikk.com/2016/04/05/tackling-complexity-ddd/
What if we
removed the
tactical patterns?*
Advocacy:
Blogging/Critique
Advocacy: Journaling
Describe Your Design Principles
Guidelines:
You prefer a rich domain model
Aggregate roots should not directly
communicate with each other
Communication protocols and why
Conventions:
Common service
interfaces/capabilities
Extension points configured by…
When you can break the rules...
53
Constructive
Reasoned
Clear
Testable
Significant
Advocacy: Journaling
Document Decisions
 Rationale—why you made it
 Other options considered
 An appreciation of your
thought process
 Goal: Convey why your
architecture, or a piece of it,
is a good solution
54
Decisions worth justifying
Spent lots of time on
Critical to achieving a requirement
Confusing at first
Widespread impact
Difficult to undo
One option*
1-2 pages of text describing a set of forces
forces & a single decision in response
Title
Context - Forces at play
Decision - Stated with active voice: "We will ..."
Status - “proposed” or “accepted” later may be
“deprecated” or “superseded”
Consequences positive, negative, and neutral that
affect the team and project in the future
*Useful for recorded decisions that have a “lifecycle”. Thanks to Michael Nygard:
http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions
Useful link to github project on decision records: https://github.com/joelparkerhenderson
Used with permissions under the under the Creative Commons Attribution-Share Alike 3.0 Unportedicense.
By MichaelMaggs Edit by Richard Bartz (Own work) [CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0)], via Wikimedia Commons
Reshape your sota
based on what you
learn.
Heuristic: Make small changes to
your state-of-the-art (sota)
Cultivating
Your
Heuristics
Requires
Care and
Attention
Credits & Acknowledgements
 Erik Simmons who encouraged me to read Discussion of The
Method.
 Richard Gabriel, a thinker and doer, critic of my work, and
inspiration too.
 Eric Evans always makes me think deeply about design matters.
 The Ouroboros image is from the Ouroboric Philosophy page,
an inspiration
https:ouroboricphilosophy.wordpress.com/tag/ouroboros/
 Rebecca Wirfs-Brock photograph of the Blue Apron meal.
 Allen Wirfs-Brock photograph of Rebecca Wirfs-Brock at
Haystack Rock.
Thank you!
rebecca@wirfs-brock.com
twitter: @rebeccawb

More Related Content

What's hot

Agile methodology in cloud computing
Agile methodology in cloud computingAgile methodology in cloud computing
Agile methodology in cloud computingAhmed M. Abed
 
Agile Architecture and Design
Agile Architecture and DesignAgile Architecture and Design
Agile Architecture and DesignPratip Mallik
 
Trustworthy Transparency and Lean Traceability
Trustworthy Transparency and Lean TraceabilityTrustworthy Transparency and Lean Traceability
Trustworthy Transparency and Lean TraceabilityBrad Appleton
 
Why ask why? Try agile BI!
Why ask why? Try agile BI!Why ask why? Try agile BI!
Why ask why? Try agile BI!Excella
 
Guiding Principles & Methodology for Cloud Computing Adoption
Guiding Principles & Methodology for Cloud Computing AdoptionGuiding Principles & Methodology for Cloud Computing Adoption
Guiding Principles & Methodology for Cloud Computing AdoptionKumar Arikrishnan
 
Evolving toward Microservices - O’Reilly SACON Keynote
Evolving toward Microservices  - O’Reilly SACON KeynoteEvolving toward Microservices  - O’Reilly SACON Keynote
Evolving toward Microservices - O’Reilly SACON KeynoteChristopher Grant
 
A Proven Software Development Process for the Non Technical Founder
A Proven Software Development Process for the Non Technical FounderA Proven Software Development Process for the Non Technical Founder
A Proven Software Development Process for the Non Technical FounderFounders Workshop
 
Agility via Software Engineering Practices - Agile Tour Montreal 2015
Agility via Software Engineering Practices - Agile Tour Montreal 2015Agility via Software Engineering Practices - Agile Tour Montreal 2015
Agility via Software Engineering Practices - Agile Tour Montreal 2015Steve Mercier
 
Strategic refactoring. Refactoring strategies
Strategic refactoring. Refactoring strategiesStrategic refactoring. Refactoring strategies
Strategic refactoring. Refactoring strategiesValentin-Tudor Mocanu
 
Agile Overview As V1.2
Agile Overview As V1.2Agile Overview As V1.2
Agile Overview As V1.2Anjan Roy
 
Agile Software Development and DevOps 21092019
Agile Software Development and DevOps 21092019Agile Software Development and DevOps 21092019
Agile Software Development and DevOps 21092019Ahmed Misbah
 
Agile Database Development - SDC2012
Agile Database Development - SDC2012Agile Database Development - SDC2012
Agile Database Development - SDC2012Jose Luis Soria
 
Software architecture introduction
Software architecture introductionSoftware architecture introduction
Software architecture introductionFreddy Munandar
 
Applying Agile Values to Enterprise Architecture
Applying Agile Values to Enterprise ArchitectureApplying Agile Values to Enterprise Architecture
Applying Agile Values to Enterprise ArchitectureBenjamin Scherrey
 
India GRUC Agility Presentation 2015-6-30
India GRUC Agility Presentation 2015-6-30India GRUC Agility Presentation 2015-6-30
India GRUC Agility Presentation 2015-6-30Roger Snook
 
Introducing Agile Development in Traditional Software Development Organizations
Introducing Agile Development in Traditional Software Development OrganizationsIntroducing Agile Development in Traditional Software Development Organizations
Introducing Agile Development in Traditional Software Development Organizationsjuliannacole
 

What's hot (20)

Agile methodology in cloud computing
Agile methodology in cloud computingAgile methodology in cloud computing
Agile methodology in cloud computing
 
Agile Architecture and Design
Agile Architecture and DesignAgile Architecture and Design
Agile Architecture and Design
 
Trustworthy Transparency and Lean Traceability
Trustworthy Transparency and Lean TraceabilityTrustworthy Transparency and Lean Traceability
Trustworthy Transparency and Lean Traceability
 
Why ask why? Try agile BI!
Why ask why? Try agile BI!Why ask why? Try agile BI!
Why ask why? Try agile BI!
 
Guiding Principles & Methodology for Cloud Computing Adoption
Guiding Principles & Methodology for Cloud Computing AdoptionGuiding Principles & Methodology for Cloud Computing Adoption
Guiding Principles & Methodology for Cloud Computing Adoption
 
Evolving toward Microservices - O’Reilly SACON Keynote
Evolving toward Microservices  - O’Reilly SACON KeynoteEvolving toward Microservices  - O’Reilly SACON Keynote
Evolving toward Microservices - O’Reilly SACON Keynote
 
A Proven Software Development Process for the Non Technical Founder
A Proven Software Development Process for the Non Technical FounderA Proven Software Development Process for the Non Technical Founder
A Proven Software Development Process for the Non Technical Founder
 
Agility via Software Engineering Practices - Agile Tour Montreal 2015
Agility via Software Engineering Practices - Agile Tour Montreal 2015Agility via Software Engineering Practices - Agile Tour Montreal 2015
Agility via Software Engineering Practices - Agile Tour Montreal 2015
 
Strategic refactoring. Refactoring strategies
Strategic refactoring. Refactoring strategiesStrategic refactoring. Refactoring strategies
Strategic refactoring. Refactoring strategies
 
Agile Overview As V1.2
Agile Overview As V1.2Agile Overview As V1.2
Agile Overview As V1.2
 
The Agile Movement
The Agile MovementThe Agile Movement
The Agile Movement
 
Agile for Infrastructure Projects
Agile for Infrastructure ProjectsAgile for Infrastructure Projects
Agile for Infrastructure Projects
 
Architectural runway
Architectural runwayArchitectural runway
Architectural runway
 
Agile Software Development and DevOps 21092019
Agile Software Development and DevOps 21092019Agile Software Development and DevOps 21092019
Agile Software Development and DevOps 21092019
 
Agile Database Development - SDC2012
Agile Database Development - SDC2012Agile Database Development - SDC2012
Agile Database Development - SDC2012
 
Software architecture introduction
Software architecture introductionSoftware architecture introduction
Software architecture introduction
 
Applying Agile Values to Enterprise Architecture
Applying Agile Values to Enterprise ArchitectureApplying Agile Values to Enterprise Architecture
Applying Agile Values to Enterprise Architecture
 
India GRUC Agility Presentation 2015-6-30
India GRUC Agility Presentation 2015-6-30India GRUC Agility Presentation 2015-6-30
India GRUC Agility Presentation 2015-6-30
 
Introducing Agile Development in Traditional Software Development Organizations
Introducing Agile Development in Traditional Software Development OrganizationsIntroducing Agile Development in Traditional Software Development Organizations
Introducing Agile Development in Traditional Software Development Organizations
 
L22 Architecture and Agile
L22 Architecture and AgileL22 Architecture and Agile
L22 Architecture and Agile
 

Similar to Cultivating Your Design Heuristics

06 styles and_greenfield_design
06 styles and_greenfield_design06 styles and_greenfield_design
06 styles and_greenfield_designMajong DevJfu
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven DesignBradley Holt
 
Marco Mancuso - Data Context Interaction
Marco Mancuso - Data Context InteractionMarco Mancuso - Data Context Interaction
Marco Mancuso - Data Context InteractioncosenzaLab
 
Interoperability defined by its reason d'être
Interoperability defined by its reason d'êtreInteroperability defined by its reason d'être
Interoperability defined by its reason d'êtreAALForum
 
Embracing OOUX for Better Projects and Happier Teams
Embracing OOUX for Better Projects and Happier TeamsEmbracing OOUX for Better Projects and Happier Teams
Embracing OOUX for Better Projects and Happier TeamsCaroline Sober-James
 
CORE: Cognitive Organization for Requirements Elicitation
CORE: Cognitive Organization for Requirements ElicitationCORE: Cognitive Organization for Requirements Elicitation
CORE: Cognitive Organization for Requirements ElicitationScott M. Confer
 
Software Development: Beyond Training wheels
Software Development: Beyond Training wheelsSoftware Development: Beyond Training wheels
Software Development: Beyond Training wheelsNaveenkumar Muguda
 
S doherty counting_dragons_dita-reuse
S doherty counting_dragons_dita-reuseS doherty counting_dragons_dita-reuse
S doherty counting_dragons_dita-reuseStan Doherty
 
SE-Lecture 2A-Requirements.pptx
SE-Lecture 2A-Requirements.pptxSE-Lecture 2A-Requirements.pptx
SE-Lecture 2A-Requirements.pptxTangZhiSiang
 
Software Design Trilogy Part I - Responsibility Driven Design for Rubyists
Software Design Trilogy Part I - Responsibility Driven Design for RubyistsSoftware Design Trilogy Part I - Responsibility Driven Design for Rubyists
Software Design Trilogy Part I - Responsibility Driven Design for RubyistsAndy Maleh
 
Patterns of Assigning Responsibilities
Patterns of Assigning ResponsibilitiesPatterns of Assigning Responsibilities
Patterns of Assigning Responsibilitiesguest2a92cd9
 
Design pattern and their application
Design pattern and their applicationDesign pattern and their application
Design pattern and their applicationHiệp Tiến
 
Mastering SharePoint Migration Planning
Mastering SharePoint Migration PlanningMastering SharePoint Migration Planning
Mastering SharePoint Migration PlanningChristian Buckley
 
Tools and Techniques for Creating, Maintaining, and Distributing Shareable Me...
Tools and Techniques for Creating, Maintaining, and Distributing Shareable Me...Tools and Techniques for Creating, Maintaining, and Distributing Shareable Me...
Tools and Techniques for Creating, Maintaining, and Distributing Shareable Me...Jenn Riley
 

Similar to Cultivating Your Design Heuristics (20)

06 styles and_greenfield_design
06 styles and_greenfield_design06 styles and_greenfield_design
06 styles and_greenfield_design
 
Domain-Driven Design
Domain-Driven DesignDomain-Driven Design
Domain-Driven Design
 
Marco Mancuso - Data Context Interaction
Marco Mancuso - Data Context InteractionMarco Mancuso - Data Context Interaction
Marco Mancuso - Data Context Interaction
 
Interoperability defined by its reason d'être
Interoperability defined by its reason d'êtreInteroperability defined by its reason d'être
Interoperability defined by its reason d'être
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Embracing OOUX for Better Projects and Happier Teams
Embracing OOUX for Better Projects and Happier TeamsEmbracing OOUX for Better Projects and Happier Teams
Embracing OOUX for Better Projects and Happier Teams
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Software Design
Software DesignSoftware Design
Software Design
 
CORE: Cognitive Organization for Requirements Elicitation
CORE: Cognitive Organization for Requirements ElicitationCORE: Cognitive Organization for Requirements Elicitation
CORE: Cognitive Organization for Requirements Elicitation
 
Software Development: Beyond Training wheels
Software Development: Beyond Training wheelsSoftware Development: Beyond Training wheels
Software Development: Beyond Training wheels
 
S doherty counting_dragons_dita-reuse
S doherty counting_dragons_dita-reuseS doherty counting_dragons_dita-reuse
S doherty counting_dragons_dita-reuse
 
SE-Lecture 2A-Requirements.pptx
SE-Lecture 2A-Requirements.pptxSE-Lecture 2A-Requirements.pptx
SE-Lecture 2A-Requirements.pptx
 
Software Design Trilogy Part I - Responsibility Driven Design for Rubyists
Software Design Trilogy Part I - Responsibility Driven Design for RubyistsSoftware Design Trilogy Part I - Responsibility Driven Design for Rubyists
Software Design Trilogy Part I - Responsibility Driven Design for Rubyists
 
WebDev Crash Course
WebDev Crash CourseWebDev Crash Course
WebDev Crash Course
 
Patterns of Assigning Responsibilities
Patterns of Assigning ResponsibilitiesPatterns of Assigning Responsibilities
Patterns of Assigning Responsibilities
 
Design pattern and their application
Design pattern and their applicationDesign pattern and their application
Design pattern and their application
 
Mastering SharePoint Migration Planning
Mastering SharePoint Migration PlanningMastering SharePoint Migration Planning
Mastering SharePoint Migration Planning
 
Tools and Techniques for Creating, Maintaining, and Distributing Shareable Me...
Tools and Techniques for Creating, Maintaining, and Distributing Shareable Me...Tools and Techniques for Creating, Maintaining, and Distributing Shareable Me...
Tools and Techniques for Creating, Maintaining, and Distributing Shareable Me...
 
Programming in the large
Programming in the largeProgramming in the large
Programming in the large
 

Recently uploaded

What are the core components of Azure Data Engineer courses.docx
What are the core components of Azure Data Engineer courses.docxWhat are the core components of Azure Data Engineer courses.docx
What are the core components of Azure Data Engineer courses.docxkzayra69
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfmaor17
 
AmsterdamJUG April 2024 - Going serverless with Quarkus GraalVM native images...
AmsterdamJUG April 2024 - Going serverless with Quarkus GraalVM native images...AmsterdamJUG April 2024 - Going serverless with Quarkus GraalVM native images...
AmsterdamJUG April 2024 - Going serverless with Quarkus GraalVM native images...Bert Jan Schrijver
 
OpenMetadata Community Meeting - 4th April, 2024
OpenMetadata Community Meeting - 4th April, 2024OpenMetadata Community Meeting - 4th April, 2024
OpenMetadata Community Meeting - 4th April, 2024OpenMetadata
 
Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxMastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxAS Design & AST.
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdfAndrey Devyatkin
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...kalichargn70th171
 
Key Steps in Agile Software Delivery Roadmap
Key Steps in Agile Software Delivery RoadmapKey Steps in Agile Software Delivery Roadmap
Key Steps in Agile Software Delivery RoadmapIshara Amarasekera
 
Advantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptxAdvantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptxRTS corp
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
oracle 23c new features for developer and dba
oracle 23c new features for developer and dbaoracle 23c new features for developer and dba
oracle 23c new features for developer and dbaRemote DBA Services
 
Santander Stream Processing with Apache Flink
Santander Stream Processing with Apache FlinkSantander Stream Processing with Apache Flink
Santander Stream Processing with Apache Flinkconfluent
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jNeo4j
 
Explore the Three Main Types of Logistics - Inbound Logistics, Outbound Logis...
Explore the Three Main Types of Logistics - Inbound Logistics, Outbound Logis...Explore the Three Main Types of Logistics - Inbound Logistics, Outbound Logis...
Explore the Three Main Types of Logistics - Inbound Logistics, Outbound Logis...Piyovi
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 

Recently uploaded (20)

What are the core components of Azure Data Engineer courses.docx
What are the core components of Azure Data Engineer courses.docxWhat are the core components of Azure Data Engineer courses.docx
What are the core components of Azure Data Engineer courses.docx
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
 
AmsterdamJUG April 2024 - Going serverless with Quarkus GraalVM native images...
AmsterdamJUG April 2024 - Going serverless with Quarkus GraalVM native images...AmsterdamJUG April 2024 - Going serverless with Quarkus GraalVM native images...
AmsterdamJUG April 2024 - Going serverless with Quarkus GraalVM native images...
 
OpenMetadata Community Meeting - 4th April, 2024
OpenMetadata Community Meeting - 4th April, 2024OpenMetadata Community Meeting - 4th April, 2024
OpenMetadata Community Meeting - 4th April, 2024
 
Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxMastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptx
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
 
Key Steps in Agile Software Delivery Roadmap
Key Steps in Agile Software Delivery RoadmapKey Steps in Agile Software Delivery Roadmap
Key Steps in Agile Software Delivery Roadmap
 
Advantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptxAdvantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptx
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
oracle 23c new features for developer and dba
oracle 23c new features for developer and dbaoracle 23c new features for developer and dba
oracle 23c new features for developer and dba
 
Santander Stream Processing with Apache Flink
Santander Stream Processing with Apache FlinkSantander Stream Processing with Apache Flink
Santander Stream Processing with Apache Flink
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
Explore the Three Main Types of Logistics - Inbound Logistics, Outbound Logis...
Explore the Three Main Types of Logistics - Inbound Logistics, Outbound Logis...Explore the Three Main Types of Logistics - Inbound Logistics, Outbound Logis...
Explore the Three Main Types of Logistics - Inbound Logistics, Outbound Logis...
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 

Cultivating Your Design Heuristics

  • 1.
  • 2. Heuristic “anything that provides a plausible aid or direction in the solution of a problem but is in the final analysis unjustified, incapable of justification, and potentially fallible.” —Billy Vaughn Koen
  • 3. Heuristics  Heuristics aid in design  Guide use of other heuristics  Even determine our attitude and behavior
  • 5.
  • 6. Pithy Phrases? A Few Useful Engineering Heuristics by Billy Koen  Heuristic: Solve problems by successive approximations  Heuristic: Always give an answer  Heuristic: Always give yourself a chance to retreat  Heuristic: Use feedback to stabilize the design  Heuristic: Break complex problems into smaller, more manageable pieces  Heuristic: Always make the minimum decision  Heuristic: Design for a specific time frame (product lifetime)  Heuristic: Make small changes to your state-of-the-art (sota)
  • 7. Context In which situations can I use this pattern? Problem What does it try to solve? What questions does it answer? Solution What can I do that usually works? patterns are nicely “packaged” heuristics
  • 8.
  • 9. Pattern Languages “In short, no pattern is an isolated entity. Each pattern can exist in the world only to the extent that is supported by other patterns: the larger patterns in which it is embedded, the patterns of the same size that surround it, and the smaller patterns which are embedded in it.” —Christopher Alexander © Can Stock Photo / sauletas
  • 10. Pattern Languages are never complete… © Can Stock Photo / TopVectors
  • 11. Some Age Well! © Can Stock Photo / Noofoo
  • 12. Heuristics May Conflict… and still be useful © Can Stock Photo / DaneeShe
  • 13.  Heuristic: Use a Transaction Script when you have simple logic for a small database application  Heuristic: Use a Domain Model when you have complex logic that you want to model in objects and can accommodate database mapping  Heuristic: Use a Table Module when you have complex (existing) data and you need to write logic that applies to multiple rows in underlying database tables Heuristics: 3 Ways to Structure a Domain Layer Patterns of Enterprise Application Architecture
  • 14. Table Module Heuristic p Solvable problems my problem Domain Model Heuristic Transaction Script
  • 15. Table Module Heuristic p Solvable problems my problem Rich Domain Model Heuristic Transaction Script
  • 16. Heuristics Need to be Challenged © Can Stock Photo / 4774344sean
  • 17.
  • 18. Unscientific Chart: Maintenance Effort* Database Script Complexity of Domain Logic Effort to Enhance Transaction Script Domain Model Table Module *Inspired by the unquantified chart in Fowler’s Patterns of Enterprise Architecture
  • 19. Unscientific Chart: Code Reuse Potential* Database Script Transaction Script Complexity of Domain Logic Potential Code Reuse Domain Model Table Module *Inspired by the unquantified chart in Fowler’s Patterns of Enterprise Architecture
  • 20. “Best Fit” Profiles Style Design Skills Driving Forces Project Duration System Complexity System Longevity Transaction Script Programming Dev speed Short Low Short Domain Model- Rich OO Design Business concepts in code Medium Medium to High Medium to Long Domain Model- Simple Moderate OO +DB Simple representation of business concepts Medium Medium Medium Database script Specialized Performance, security Medium Low to Medium Long Table Module DB + Moderate prog/OO design Technology fit Medium Low to Medium Medium to Long Rules Engine Specialized Complexity/ changeability Long High Long …
  • 21.
  • 22. “As a rule, the more demanding the application, the more leverage you get from using a powerful language. But plenty of projects are not demanding at all. Most programming probably consists of writing little glue programs, and for little glue programs you can use any language that you’re already familiar with and that has good libraries for whatever you need to do” — Paul Graham, Revenge of the Nerds
  • 23. The “best” is debatable  Paul Graham’s Heuristic: It doesn’t matter what programming language you use if you have a simple program. Use programming languages, tools, and frameworks and libraries you are familiar with.  Rebecca: But Paul…  Heuristic: Use a rich domain model when you have rich behavior in your application.  Heuristic: Use transaction scripts for really simple stuff that isn’t going to change much.  Heuristic: Learn something new. Don’t always do things the same way. That’s soul sucking!
  • 24.
  • 25. “choose the heuristic to use from what you take to be the best option at the time you are required to choose.” —paraphrase of Billy Koen
  • 26.  We each have our own cherished heuristics  As new ones become useful we add to our collection  No longer useful ones fall out of fashion  Sometimes, even useful ones fade away Our SOTA (State of the Art) https://xkcd.com/1823/
  • 27.
  • 30.  Choices for user input validation:  How much to validate in the browser?  Hand code validation logic or use declarative style?  How much validation is performed by framework- specific classes: simple, syntactic edits, or more?  Choices for constraint checking:  Which objects are assigned constraint checking responsibilities?  When are constraints enforced?  Where to enforce cross-attribute and cross-object constraints? An Examination of some Pesky Details: Validation and Constraint Checking
  • 31.  Perform simple edits (syntactic) in browser code  Don’t universally trust browser-validated edits. Reapply them if receiving requests from an untrusted source  Consistently assign validation responsibilities to framework-specific validation classes  Consistently use domain layer validation and constraint enforcement patterns Heuristics My Design Recommendations ✗
  • 32.  Rationale: Factoring out constraint checking behavior into a separate class enables constraints be enforced by a domain service, that can determine when to check constraints.  Merit: Possible to dynamically configure constraints.  Drawback: Harder to understand all the rules at once. Option 1: Make Constraints Explicit Create Separate Classes “xxxPolicy” or “xxxRule” is a common name for constraint objects Constraint: “An out of stock item can’t be added to an expedited order”
  • 33.  Rationale: Putting a constraint in the code that changes the state is most direct.  Merit: Factoring constraint into an intentionally named helper method aids discussing with domain experts.  Drawback: Clutters the domain object with a lot of checking, creates dependencies on other domain objects. No ability to modulate when constraints are enforced. Option 2: Give objects responsibilities for maintaining their state Check Constraints in Domain Object Constraint: “An out of stock item can’t be added to an expedited order”
  • 34.
  • 36. RDD Concept: Role Stereotypes Typical behaviors in an object-oriented design knowing, doing, deciding  Information holder—knows and provides information.  Structurer—maintains relationships between objects.  Service provider—performs work on demand.  Coordinator—reacts to events by delegating to others.  Controller—makes decisions & directs actions.  Interfacer—transforms information and requests between distinct parts of a software system.
  • 37. RDD Heuristic: Blend stereotypes to make objects more responsible.  Add behaviors to make objects “smarter”  information holders that compute or derive information based on other information they maintain  service providers that maintain information to be more efficient  structurers that answer deeper questions or derive facts about what they are structuring  interfacers that also transform Be constantly aware of Overlapping Heuristics Heuristic: Design objects to do one thing well. (Single Responsibility Principle from Bob Martin) Heuristic: Make the overall system simpler by having objects do something with what they know. (Responsibility-Driven Design Heuristic)
  • 38. 2001 People, Places, Things, Aggregate Things, Events Heuristic: Separate out stuff that varies depending on the current relationship Heuristic: Locations can be hierarchical or even more complex Heuristic: Events can be point-in-time, interval, depend on other events …and event information is often messy and complex
  • 39. Heuristic: By characterizing a domain entity’s attributes you can understand/find/identify needed system behaviors  Descriptive Attributes reflect a domain object properties (not identity).  Time-dependent attributes Most attributes can change values, but for some, maintaining a history of past values is important.  Lifecycle state attributes Some entities go through a one-way lifecycle, from initial to final state.  Operational state Some entities switch between different states. The state it is currently in determines how it behaves. Create Active Store Reconstitute Database Representation Database or File Representation ArchiveDelete Delete Modify
  • 40.
  • 41.
  • 42. Heuristic*: Distinguish between “superficial” and “domain” validations and handle them differently  “superficial”: what must be true, regardless of the state of the domain  Heuristic: Validate these before issuing a command, ideally on the client side as well as the server side  “superficial” but requires lookup of other information  Heuristic: Validate in the service before invoking the command  “domain”: validity of a command is dependent on the state of the model  Heuristic: Validate in domain objects *http://danielwhittaker.me/2016/04/20/how-to-validate-commands-in-a-cqrs-application/
  • 43.
  • 45. © Can Stock Photo / andrewgenn
  • 46. Let’s Just Get On With It © Can Stock Photo / Zinkevych
  • 48. Beware of Dogma Dogmatic Synonyms: bullheaded, dictative, doctrinaire, fanatical, intolerant Antonyms: amenable, flexible, manageable Pragmatic Synonyms: common, commonsense, practical, realistic, sensible Antonyms: idealistic, unrealistic
  • 50. Books, blogs, case studies, critiques Reference apps Journaling, design logs..
  • 51. “The Tactical Modeling patterns were never intended to be the one-and-only way to do DDD, but many consider them as such. They produce extraneous noise and detract attention away from the most important, and unique-to-DDD material.” —Vladik Khononov *http://vladikk.com/2016/04/05/tackling-complexity-ddd/ What if we removed the tactical patterns?* Advocacy: Blogging/Critique
  • 52.
  • 53. Advocacy: Journaling Describe Your Design Principles Guidelines: You prefer a rich domain model Aggregate roots should not directly communicate with each other Communication protocols and why Conventions: Common service interfaces/capabilities Extension points configured by… When you can break the rules... 53 Constructive Reasoned Clear Testable Significant
  • 54. Advocacy: Journaling Document Decisions  Rationale—why you made it  Other options considered  An appreciation of your thought process  Goal: Convey why your architecture, or a piece of it, is a good solution 54 Decisions worth justifying Spent lots of time on Critical to achieving a requirement Confusing at first Widespread impact Difficult to undo
  • 55. One option* 1-2 pages of text describing a set of forces forces & a single decision in response Title Context - Forces at play Decision - Stated with active voice: "We will ..." Status - “proposed” or “accepted” later may be “deprecated” or “superseded” Consequences positive, negative, and neutral that affect the team and project in the future *Useful for recorded decisions that have a “lifecycle”. Thanks to Michael Nygard: http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions Useful link to github project on decision records: https://github.com/joelparkerhenderson
  • 56. Used with permissions under the under the Creative Commons Attribution-Share Alike 3.0 Unportedicense. By MichaelMaggs Edit by Richard Bartz (Own work) [CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0)], via Wikimedia Commons Reshape your sota based on what you learn. Heuristic: Make small changes to your state-of-the-art (sota)
  • 57.
  • 59. Credits & Acknowledgements  Erik Simmons who encouraged me to read Discussion of The Method.  Richard Gabriel, a thinker and doer, critic of my work, and inspiration too.  Eric Evans always makes me think deeply about design matters.  The Ouroboros image is from the Ouroboric Philosophy page, an inspiration https:ouroboricphilosophy.wordpress.com/tag/ouroboros/  Rebecca Wirfs-Brock photograph of the Blue Apron meal.  Allen Wirfs-Brock photograph of Rebecca Wirfs-Brock at Haystack Rock.