Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introduction Repository, DDD And Unit Test
Search
Hiraq Citra M
May 27, 2015
Programming
0
1k
Introduction Repository, DDD And Unit Test
case study on laravel 5, implement repository patter, a little about ddd and unit tests
Hiraq Citra M
May 27, 2015
Tweet
Share
More Decks by Hiraq Citra M
See All by Hiraq Citra M
Functional Programming & Team Development
hiraq
0
190
Laravel 5 - Event & Queue
hiraq
0
3.6k
Golang The Hardway
hiraq
0
710
Development Tools In Scala
hiraq
1
76
Git WorkFlow & Best Practice
hiraq
2
130
API - WEB SERVICE - BASIC
hiraq
2
110
TDD - Think First, Code Later, PHP Way
hiraq
5
170
Apache Solr & PHP - Introduction
hiraq
2
180
Other Decks in Programming
See All in Programming
Go Conference 2025: Goで体感するMultipath TCP ― Go 1.24 時代の MPTCP Listener を理解する
takehaya
9
1.7k
kiroとCodexで最高のSpec駆動開発を!!数時間で web3ネイティブなミニゲームを作ってみたよ!
mashharuki
0
680
私達はmodernize packageに夢を見るか feat. go/analysis, go/ast / Go Conference 2025
kaorumuta
2
600
All About Angular's New Signal Forms
manfredsteyer
PRO
0
180
PHPに関数型の魂を宿す〜PHP 8.5 で実現する堅牢なコードとは〜 #phpcon_hiroshima / phpcon-hiroshima-2025
shogogg
1
260
CSC305 Lecture 04
javiergs
PRO
0
270
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
220
AI駆動で0→1をやって見えた光と伸びしろ
passion0102
1
410
Server Side Kotlin Meetup vol.16: 内部動作を理解して ハイパフォーマンスなサーバサイド Kotlin アプリケーションを書こう
ternbusty
3
210
CSC509 Lecture 06
javiergs
PRO
0
260
なぜあの開発者はDevRelに伴走し続けるのか / Why Does That Developer Keep Running Alongside DevRel?
nrslib
3
410
Goで実践するドメイン駆動開発 AIと歩み始めた新規プロダクト開発の現在地
imkaoru
4
850
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
526
40k
Unsuck your backbone
ammeep
671
58k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.6k
How STYLIGHT went responsive
nonsquared
100
5.8k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Automating Front-end Workflow
addyosmani
1371
200k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.7k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Java REST API Framework Comparison - PWX 2021
mraible
34
8.9k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
Transcript
Introduction Repository, DDD & Unit Tests
Agenda - Repository - DDD - Unit Test Case Study
: Working on Laravel 5.0
Stories - I want to test the data logic but
i dont care the data engine (database) - I want to test the data engine (database) but i dont care the data logic automated tests...
In Reality
Problem? “ the power of united data logic and database,
called ORM “
Real problem? As programmer we have to make sure every
single unit should be working properly.. the keyword is -> every single unit of our code
Repository
Benefit? - We can test logic without engine - We
can test engine without logic - We can test the repository it self easy to mocking… separation of concerns...
DDD Solve complex needs by modelling the domain
DDD Things - Entity. Unique object - ValueObject. Immutable object
Example Users data that contain their credentials like email, username
and password. In DDD: User is an entity, password can be a ValueObject.
Unit Test 1 class 1 responsibility We should can test
each of 1 class without thinking the dependency complexity (replace all dependency with mock)
Enough! SHOW ME THE CODES!