Your SlideShare is downloading. ×
0
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Specking Interactors with PHPSpec and YOLO (DDD) at PHPConference Argentina 2013

943

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
943
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
2
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Specking Interactors with PHPSpec and YOLO Toward the scorners he is scornful,     but to the humble he gives favor. ~ Proverbs 3:34 Friday, October 4, 13
  • 2. Take control of your project and live a simpler life Toward the scorners he is scornful,     but to the humble he gives favor. ~ Proverbs 3:34 Friday, October 4, 13
  • 3. Framework != Domain Friday, October 4, 13
  • 4. Test First Friday, October 4, 13
  • 5. Domain Domain Friday, October 4, 13
  • 6. Implementations are Details Friday, October 4, 13
  • 7. http://www.austinchronicle.com/binary/d294/SS.Hook._leftsideonly_.jpg Friday, October 4, 13
  • 8. http://www.collider.com/wp-content/uploads/Inception-movie-poster-2.jpg Friday, October 4, 13
  • 9. http://static.guim.co.uk/sys-images/Film/Pix/pictures/2008/06/06/matrix460.jpg Friday, October 4, 13
  • 10. Signs of Inception Friday, October 4, 13
  • 11. Our Framework The Best Friday, October 4, 13
  • 12. Our Practices The Best Friday, October 4, 13
  • 13. Our Community never makes mistakes Friday, October 4, 13
  • 14. Framework is convenient Friday, October 4, 13
  • 15. But we are not solving The Problem Friday, October 4, 13
  • 16. Friday, October 4, 13
  • 17. Friday, October 4, 13
  • 18. Friday, October 4, 13
  • 19. Friday, October 4, 13
  • 20. Domain Friday, October 4, 13
  • 21. Domain Expert Friday, October 4, 13
  • 22. BDD Friday, October 4, 13
  • 23. BDD Tools Behat, PhpSpec Friday, October 4, 13
  • 24. but DDD is for Large Systems ... Friday, October 4, 13
  • 25. Friday, October 4, 13
  • 26. show me how... Friday, October 4, 13
  • 27. Friday, October 4, 13
  • 28. Problem: some don’t want to pay for certification exams, so let’s build a community site for those exams. Friday, October 4, 13
  • 29. Before we jump into the sauce: Find a qualified examiner, could be a real educator if not then try to become one Friday, October 4, 13
  • 30. Spec First ↝ BDD + DDD Feature: student can take an exam   Scenario: student takes an exam Given student starts an exam And student is presented with a question When student answers to question ... Then student ends exam and gets graded Friday, October 4, 13
  • 31. Modeling BDD Scenario feature DSL Learning Process Friday, October 4, 13
  • 32. Modeling repository BDD Scenario feature DSL Support BDD entity value object service interactor (use case) port Learning Process Friday, October 4, 13
  • 33. Modeling Exam Repository Attempt Repository Exam Attempt service Grader Converter interactor (use case) ShowAll Exams Grade Attempt repository BDD Scenario feature DSL Support BDD entity BDD Spec value object port Learning Process Friday, October 4, 13 Question
  • 34. Modeling Exam Repository Attempt Repository Exam Attempt service Grader Converter interactor (use case) ShowAll Exams Grade Attempt repository BDD Scenario feature DSL Support BDD entity BDD Spec value object port Learning Process Friday, October 4, 13 Question DDD Breaking and Fixing Specs
  • 35. Modeling Exam Repository Attempt Repository Exam Attempt service Grader Converter interactor (use case) ShowAll Exams Grade Attempt repository BDD Scenario feature DSL Support BDD DDD Refactoring Behavior entity BDD Spec value object port Learning Process Friday, October 4, 13 Question DDD Breaking and Fixing Specs
  • 36. Learning Process Friday, October 4, 13
  • 37. Folder Structure To convey: - inversion of dependencies - make dependencies explicit - domain and infrastructure separation - bounded context separation Friday, October 4, 13
  • 38. ~ !"" #   #   !"" #   #   #   #   #   #   #   #   #   #   #   tree -L 6 features !"" student_takes_exam.feature $"" teacher_builds_exam.feature spec $"" Simulator !"" Domain #   !"" Model #   #   $"" Exam #   #   !"" AttemptSpec.php #   #   !"" ExamSpec.php #   #   !"" OptionSpec.php #   #   $"" QuestionSpec.php #   !"" Port #   #   !"" AnswerSpec.php #   #   !"" ExamSpec.php Friday, October 4, 13 Notice these are specs!
  • 39. ~ !"" #   #   !"" #   #   #   #   #   #   #   #   #   #   #   tree -L 6 features !"" student_takes_exam.feature $"" teacher_builds_exam.feature spec $"" Simulator !"" Domain #   !"" Model #   #   $"" Exam #   #   !"" AttemptSpec.php #   #   !"" ExamSpec.php #   #   !"" OptionSpec.php #   #   $"" QuestionSpec.php #   !"" Port #   #   !"" AnswerSpec.php #   #   !"" ExamSpec.php Friday, October 4, 13
  • 40. ~ !"" #   #   !"" #   #   #   #   #   #   #   #   #   #   #   tree -L 6 features !"" student_takes_exam.feature $"" teacher_builds_exam.feature spec $"" Simulator !"" Domain #   !"" Model #   #   $"" Exam #   #   !"" AttemptSpec.php #   #   !"" ExamSpec.php #   #   !"" OptionSpec.php #   #   $"" QuestionSpec.php #   !"" Port #   #   !"" AnswerSpec.php #   #   !"" ExamSpec.php Friday, October 4, 13
  • 41. ~ tree -L ... #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   Friday, October 4, 13 6 !"" #   #   #   !"" #   #   #   !"" #   $"" Port !"" AnswerSpec.php !"" ExamSpec.php $"" ExamsSpec.php Services !"" ExamsConverterSpec.php !"" GraderSpec.php $"" PrototypeManagerSpec.php Support $"" StudentHelperSpec.php UseCase !"" GradesAttemptSpec.php
  • 42. ~ tree -L ... #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   Friday, October 4, 13 6 !"" #   #   #   !"" #   #   #   !"" #   $"" Port !"" AnswerSpec.php !"" ExamSpec.php $"" ExamsSpec.php Services !"" ExamsConverterSpec.php !"" GraderSpec.php $"" PrototypeManagerSpec.php Support $"" StudentHelperSpec.php UseCase !"" GradesAttemptSpec.php
  • 43. ~ tree -L ... #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   Friday, October 4, 13 6 !"" #   #   #   !"" #   #   #   !"" #   $"" Port !"" AnswerSpec.php !"" ExamSpec.php $"" ExamsSpec.php Services !"" ExamsConverterSpec.php !"" GraderSpec.php $"" PrototypeManagerSpec.php Support $"" StudentHelperSpec.php UseCase !"" GradesAttemptSpec.php
  • 44. ~ tree -L 6 ... #   #   #   #   #   #   #   #   #   Friday, October 4, 13 $"" Infrastructure !"" Cilex #   !"" Command #   #   $"" ShowAllExamsCommand.php #   !"" Console #   #   $"" Runner.php #   !"" Provider #   #   $"" SimulatorServiceProvider.php #   $"" config.yml
  • 45. ~ tree -L 6 ... #   | #   #   #   #   #   #   #   #   #   #   #   #   #   Friday, October 4, 13 $"" Infrastructure ... !"" Persistence #   !"" Doctrine #   #   $"" OrmExamRepository.php #   !"" InMemoryAttemptRepository.php #   !"" InMemoryExamRepository.php #   $"" PDO #   $"" PdoExamRepository.php !"" Symfony #   $"" Bundle #   $"" SimulatorBundle $"" Yolo $"" Controller $"" ExamController.php
  • 46. ~ tree -L 6 ... #   | #   #   #   #   #   #   #   #   #   #   #   #   #   Friday, October 4, 13 $"" Infrastructure ... !"" Persistence #   !"" Doctrine #   #   $"" OrmExamRepository.php #   !"" InMemoryAttemptRepository.php #   !"" InMemoryExamRepository.php #   $"" PDO #   $"" PdoExamRepository.php !"" Symfony #   $"" Bundle #   $"" SimulatorBundle $"" Yolo $"" Controller $"" ExamController.php
  • 47. ~ tree -L 6 ... #   | #   #   #   #   #   #   #   #   #   #   #   #   #   Friday, October 4, 13 $"" Infrastructure ... !"" Persistence #   !"" Doctrine #   #   $"" OrmExamRepository.php #   !"" InMemoryAttemptRepository.php #   !"" InMemoryExamRepository.php #   $"" PDO #   $"" PdoExamRepository.php !"" Symfony #   $"" Bundle #   $"" SimulatorBundle $"" Yolo $"" Controller $"" ExamController.php
  • 48. What if I ask you which classes implement the features? Friday, October 4, 13
  • 49. Folder Structure ~ tree -L ... #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   #   6 !"" #   #   #   !"" #   #   #   !"" #   $"" Port !"" AnswerSpec.php !"" ExamSpec.php $"" ExamsSpec.php Services !"" ExamsConverterSpec.php !"" GraderSpec.php $"" PrototypeManagerSpec.php Support $"" StudentHelperSpec.php UseCase !"" GradesAttemptSpec.php This bring us back to interactors/use cases Friday, October 4, 13
  • 50. Friday, October 4, 13
  • 51. Friday, October 4, 13
  • 52. Domain ↝ Domain - intention - expressive - explicit Friday, October 4, 13
  • 53. Domain ↝ Domain Friday, October 4, 13
  • 54. Domain ↝ Domain Friday, October 4, 13
  • 55. Show what you did :) Friday, October 4, 13
  • 56. "repositories": [ { "type": "vcs", "url": "git@github.com:cordoval/ExamSimulator" } ], "require": { "igorw/yolo": "dev-master", "cordoval/exam-simulator": "dev-master" }, Friday, October 4, 13
  • 57. ~ php bin/console exams:show - yolo - part I - yolo - part II All exams displayed Friday, October 4, 13
  • 58. http:// craftitonline.com END Friday, October 4, 13

×