SlideShare a Scribd company logo
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 Traceability
Brad 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 Adoption
Kumar 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 Keynote
Christopher 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 Founder
Founders 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 2015
Steve Mercier
 
Strategic refactoring. Refactoring strategies
Strategic refactoring. Refactoring strategiesStrategic refactoring. Refactoring strategies
Strategic refactoring. Refactoring strategies
Valentin-Tudor Mocanu
 
Agile Overview As V1.2
Agile Overview As V1.2Agile Overview As V1.2
Agile Overview As V1.2
Anjan Roy
 
Agile for Infrastructure Projects
Agile for Infrastructure ProjectsAgile for Infrastructure Projects
Agile for Infrastructure Projects
Shuchi Singla AKT,SPC4,PMI-ACP,ITIL(F),CP-AAT
 
Agile Software Development and DevOps 21092019
Agile Software Development and DevOps 21092019Agile Software Development and DevOps 21092019
Agile Software Development and DevOps 21092019
Ahmed Misbah
 
Agile Database Development - SDC2012
Agile Database Development - SDC2012Agile Database Development - SDC2012
Agile Database Development - SDC2012
Jose Luis Soria
 
Software architecture introduction
Software architecture introductionSoftware architecture introduction
Software architecture introduction
Freddy Munandar
 
Applying Agile Values to Enterprise Architecture
Applying Agile Values to Enterprise ArchitectureApplying Agile Values to Enterprise Architecture
Applying Agile Values to Enterprise Architecture
Benjamin 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-30
Roger 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 Organizations
juliannacole
 
L22 Architecture and Agile
L22 Architecture and AgileL22 Architecture and Agile
L22 Architecture and Agile
Ólafur Andri Ragnarsson
 

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 Design
Bradley 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'être
AALForum
 
Design patterns
Design patternsDesign patterns
Design patterns
Ahmed Elharouny
 
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
Caroline Sober-James
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
Satheesh Sukumaran
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
Satheesh Sukumaran
 
Software Design
Software DesignSoftware Design
Software Design
Ahmed Misbah
 
CORE: Cognitive Organization for Requirements Elicitation
CORE: Cognitive Organization for Requirements ElicitationCORE: Cognitive Organization for Requirements Elicitation
CORE: Cognitive Organization for Requirements Elicitation
Scott M. Confer
 
Software Development: Beyond Training wheels
Software Development: Beyond Training wheelsSoftware Development: Beyond Training wheels
Software Development: Beyond Training wheels
Naveenkumar Muguda
 
S doherty counting_dragons_dita-reuse
S doherty counting_dragons_dita-reuseS doherty counting_dragons_dita-reuse
S doherty counting_dragons_dita-reuse
Stan Doherty
 
SE-Lecture 2A-Requirements.pptx
SE-Lecture 2A-Requirements.pptxSE-Lecture 2A-Requirements.pptx
SE-Lecture 2A-Requirements.pptx
TangZhiSiang
 
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
 
WebDev Crash Course
WebDev Crash CourseWebDev Crash Course
WebDev Crash Course
Cesar Martinez
 
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 application
Hiệp Tiến
 
Mastering SharePoint Migration Planning
Mastering SharePoint Migration PlanningMastering SharePoint Migration Planning
Mastering SharePoint Migration Planning
Christian 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
 
Programming in the large
Programming in the largeProgramming in the large
Programming in the large
Naveenkumar Muguda
 

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

Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
abdulrafaychaudhry
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Nidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, TipsNidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, Tips
vrstrong314
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 

Recently uploaded (20)

Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Nidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, TipsNidhi Software Price. Fact , Costs, Tips
Nidhi Software Price. Fact , Costs, Tips
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 

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.