Web campodessa zinchenko v2 (23-07-2014)

Download Web campodessa zinchenko v2 (23-07-2014)

Post on 19-Aug-2014

85 views

Category:

Engineering

1 download

Embed Size (px)

DESCRIPTION

 

TRANSCRIPT

<ul><li> DDD in PHP on example of Symfony </li> <li> cystbear Symfony expert MongoDB adept Erlang fun OSS doer KNPer https://twitter.com/1cdecoder https://github.com/cystbear http://knplabs.com/ </li> <li> Learning Pyramid </li> <li> PHP? ORLY? </li> <li> What this talk about? </li> <li> About useful tool/lib? </li> <li> About success story? </li> <li> No! Its about idea Motivation! </li> <li> MVC </li> <li> Where to store business logic? Model View Controller </li> <li> Where to store business logic? Model View Controller </li> <li> Where to store business logic? Model View Controller </li> <li> Where to store business logic? Model View Controller -- YEAH! </li> <li> Welcome to Fat Stupid Ugly Controllers FSUC/FUC http://blog.astrumfutura.com/2008/12/the-m-in-mvc-why-models-are-misunderstood-and-unappreciated/ http://zendframework.ru/anonses/model-with-mvc http://habrahabr.ru/post/175465/ </li> <li> Anemic (Domain) Model http://www.martinfowler.com/bliki/AnemicDomainModel.html http://habrahabr.ru/post/224879/ In essence the problem with anemic domain models is that they incur all of the costs of a domain model, without yielding any of the benefits. Martin Fowler </li> <li> Persistence Layer Model </li> <li> What is Not MVC (phew!) Request / Response Framework HTTP Framework http://fabien.potencier.org/article/49/what-is-symfony2 </li> <li> What about model, persistence layer? </li> <li> Meet Doctrine http://www.doctrine-project.org/ SQL -- DBAL + ORM MongoDB CouchDB OrientDB PHPCR ODM OXM </li> <li> What is Inversion of control Service Locator Dependency Injection Container http://www.martinfowler.com/articles/injection.html http://fabien.potencier.org/article/11/what-is-dependency-injection </li> <li> Services http://groovy.codehaus.org/ https://grails.org/ Single Class With its Deps (min) set Easy to Replace Easy to Test MVC(S)! </li> <li> Controllers pray https://twitter.com/ornicar Get Request Submit form if any Call one Service method Return Response Rendering HTML far away </li> <li> Managers Managers Managers http://blog.codinghorror.com/i-shall-call-it-somethingmanager/ http://stackoverflow.com/questions/1866794/naming-classes-how-to- avoid-calling-everything-a-whatevermanager </li> <li> Real Pain class BackendUserProgramsPossessionFormHandler { protected $dep1; // deps holder props public function __construct(DepsClass $dep1 /*, ...*/) { $this-&gt;dep1 = $dep1; } public function process(Form $form) { $this-&gt;dep1-&gt;makeHappy($form); // ... } </li> <li> How Kris writes Symfony apps#44 https://twitter.com/kriswallsmith http://www.slideshare.net/kriswallsmith/how-kris-writessymfonyapps </li> <li> https://twitter.com/kriswallsmith http://www.slideshare.net/kriswallsmith/how-kris-writessymfonyapps How Kris writes Symfony apps#44 </li> <li> Domain Logic Patterns http://martinfowler.com/books/eaa.html </li> <li> Domain Logic Patterns http://martinfowler.com/books/eaa.html Transaction Script Domain Model Table Module Service Layer </li> <li> Transaction Script </li> <li> Domain Model </li> <li> Table Module </li> <li> Domain Logic &amp; Application logic </li> <li> Service Layer </li> <li> What is next? RAD DDD Patterns Examples Layers Goodies </li> <li> DDD != RAD Code First Do not Care about persistence (yet) </li> <li> Domain Model Repository Value Object DTO Strategy State Patterns &amp; Code </li> <li> Domain Model </li> <li> Domain Model</li></ul>