โDomain-driven design (DDD) is the concept
that the structure and language of software
code (classes, methods, functions, variables).โ
What is Domain Driven Design?
Slide 22
Slide 22 text
What problems does DDD solve?
โDevelopers are too wrapped up with
technology and trying to solve problems using
technology rather than careful thought and
designโ
1
Slide 23
Slide 23 text
What problems does DDD solve?
โThe database is given too much priority, and
most discussions about the solutions center
around the database and a data model rather
than business processes and operations.โ
2
Slide 24
Slide 24 text
What problems does DDD solve?
โDevelopers donโt give proper emphasis to
naming objects and operations according to
the business purpose that they
fi
ll.โ
3
Slide 25
Slide 25 text
What problems does DDD solve?
โApplication logic is disjointed and hard to
follow. It is hard to see an overview of the
application featuresโ
4
Slide 26
Slide 26 text
What are the issues with traditional DDD?
โIn order to help maintain the model as a pure
and helpful language construct, the team must
typically implement a great deal of isolation and
encapsulation within the domain model. Which
overcomplicates the system.โ
1
Slide 27
Slide 27 text
What are the issues with traditional DDD?
โRails and Node doesn't
fi
t very well with DDD
mindset. DDD comes from Java and similar
languages.โ
2
Slide 28
Slide 28 text
What are the issues with traditional DDD?
โA lot of DDD practices are focused on
consultancy model and are used for model
complicated business processes.โ
3
Slide 29
Slide 29 text
Product Hunt favored
Domain Driven
Desig
n
Slide 30
Slide 30 text
No content
Slide 31
Slide 31 text
What
is
Domain Driven Design
?
Slide 32
Slide 32 text
Ubiquitous Language
โA language structured around the domain
model and used by all team members to
connect all the activities of the team with the
software.โ
Slide 33
Slide 33 text
Ubiquitous Language
โThere are only two hard things in Computer
Science: cache invalidation and naming things.โ
-- Phil Karlton
Slide 34
Slide 34 text
Ubiquitous Language
app/models/use.rb ๐
Slide 35
Slide 35 text
Ubiquitous Language
app/models/use.rb ๐คฎ
Slide 36
Slide 36 text
Ubiquitous Language
app/models/stack_item.rb ๐
Slide 37
Slide 37 text
Ubiquitous Language
app/model/founder_club/member.rb ๐
Slide 38
Slide 38 text
Domains
โA sphere of knowledge, in
fl
uence, or activity.
The subject area to which the user applies a
program is the domain of the software;โ
Slide 39
Slide 39 text
Domain Types
๐ Core domain
โจ
๐ฐ Supporting sub domain
โจ
๐ง Generic sub domain
Slide 40
Slide 40 text
Domain Types
๐ Core domain
โจ
๐ฐ Supporting sub domain
โจ
๐ง Generic sub domain
โจ
๐ฅฎ Utilities (infrastructure) sub domain
Slide 41
Slide 41 text
Domain Types
๐ Core domain - Post, User, Ship
โจ
๐ฐ Supporting sub domain - Collections, Discussions
โจ
๐ง Generic sub domain - Votes, Comments, Seo
โจ
๐ฅฎ Utilities - External, ExecSQL, HandleRaceCondition
Slide 42
Slide 42 text
What is PH Code Domain
Slide 43
Slide 43 text
๐คท
Slide 44
Slide 44 text
Moderation
Voting Comments
Posts
Collections
Maker Goals
Sharing
Seo
Discussions
Ask
Ship
Mentors Founder Club Golden Kitty
Maker Fest
Topics
Stories
Spam Newsletter
Noti
fi
cations Metrics
Users
Payments
Activity Feed
Jobs
Slide 45
Slide 45 text
Moderation
Voting Comments
Posts
Collections
Maker Goals
Sharing
Seo
Discussions
Ask
Ship
Mentors Founder Club Golden Kitty
Maker Fest
Topics
Stories
Spam Newsletter
Noti
fi
cations Metrics
Users
Payments
Activity Feed
Jobs
Core Feature Generic
Context Map
Slide 46
Slide 46 text
Moderation
Voting Comments
Posts
Collections
Maker Goals
Sharing
Seo
Discussions
Ask
Ship
Mentors Founder Club Golden Kitty
Maker Fest
Topics
Stories
Spam Newsletter
Noti
fi
cations Metrics
Users
Payments
Activity Feed
Jobs
Core Feature Generic
Context Map
Utilities
Slide 47
Slide 47 text
Bounded Context
โA semantic contextual boundary. This means
that within the boundary each component of the
software model has a speci
fi
c meaning and
does speci
fi
c things.โ
Slide 48
Slide 48 text
No content
Slide 49
Slide 49 text
...kinda ๐
Slide 50
Slide 50 text
Admin
Other
Bounded
Context
Utilities
Bounded Context (Domain)
Models Services Jobs
GraphQL
Mutations Resolvers Types
Slide 51
Slide 51 text
https://www.phoenixframework.org/
Slide 52
Slide 52 text
defmodule Hello.Accounts do
@moduledoc """
The Accounts context.
"""
import Ecto.Query, warn: false
alias Hello.Repo
alias Hello.Accounts.User
@doc """
Returns the list of users.
## Examples
iex> list_users()
[%User{}, ...]
"""
def list_users do
Repo.all(User)
end
...
end
Slide 53
Slide 53 text
Showcase 1โจ
Feature Domain
Slide 54
Slide 54 text
No content
Slide 55
Slide 55 text
/app/domain/โจ
/app/domain/founder_club.r
b
/app/domain/founder_club/*.rb