doctrine 2
DESCRIPTION
Doctrine 2. Juozas Kaziuk ė nas www.juokaz.com / juozas @juokaz.com / @ juokaz. Who am I?. Juozas Kaziuk ėnas , Lithuanian You can call me Joe 2 years in Edinburgh, UK Studying in University of Edinburgh Software developer, consultant and evangelist - PowerPoint PPT PresentationTRANSCRIPT
![Page 2: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/2.jpg)
Juozas Kaziukėnas, Lithuanian You can call me Joe 2 years in Edinburgh, UK Studying in University of Edinburgh Software developer, consultant and evangelist Open source developer for Zend Framework,
Doctrine… More info in www.juokaz.com and twitter @juokaz
Who am I?
![Page 3: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/3.jpg)
Doctrine users? Propel users? (you will be converted!) Interested in DB’s and PHP? Interested in PHP news?
Who are you?
![Page 4: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/4.jpg)
Doctrine is ORM tool for PHP
Inspired by Hibernate, ActiveRecord etc.
![Page 5: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/5.jpg)
Doctrine 1.X
![Page 6: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/6.jpg)
Slow High memory usage (cyclic references) Magic! (eg. Behaviors) Hard to execute raw SQL Still the best ORM for PHP available today
Doctrine 1.X
![Page 7: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/7.jpg)
ActiveRecord
Root of all problems!
![Page 8: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/8.jpg)
ActiveRecord
![Page 9: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/9.jpg)
Stable Works Makes development fast, clean and
consistent Used in production
Still the best ORM for PHP available today
![Page 10: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/10.jpg)
Doctrine 2
![Page 11: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/11.jpg)
Doctrine 2 is completely
different
![Page 12: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/12.jpg)
Everything you can do in Doctrine 1 you can do in Doctrine
2, just in a different way.
![Page 13: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/13.jpg)
Rewritten from scratch (almost) PHP 5.3 Decoupled components Simplified API
◦ “Complexified” internals?.. Performance
◦ New hydration◦ Less magic◦ Overall cleanup
What’s new?
![Page 14: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/14.jpg)
Doctrine 2 Architecture:Based on JSR-317 a.k.a. JPA v2.0
![Page 15: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/15.jpg)
[Common, DBAL, ORM, ODM]
![Page 16: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/16.jpg)
Caching Events Annotations Class loaders … more
Common
![Page 17: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/17.jpg)
Annotations
![Page 18: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/18.jpg)
Can be used without ORM Abstraction for MySQL, PgSQL, Oracle,
Microsoft SQL, DB2 etc. PHP types mapping to DB types Extendable … more
DBAL
![Page 19: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/19.jpg)
Connection
![Page 20: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/20.jpg)
Actual ORM component Uses Common and DBAL No more ActiveRecord Entities
◦ Metadata mapping Entity manager Query language
◦ Faster, cleaner, clever, extendable◦ No forcing
ORM
![Page 21: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/21.jpg)
Entity
![Page 22: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/22.jpg)
EntityManager
![Page 23: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/23.jpg)
Querying
![Page 24: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/24.jpg)
ODM? Hell yeah NoSQL!!!
MongoDB, CauchDB
![Page 25: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/25.jpg)
Abstracts NoSQL databases Similar Metadata configuration A lot of functionality from ORM also
available in ODM◦ Querying◦ EntityManager -> DocumentManager
ODM
![Page 26: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/26.jpg)
ODM Querying
![Page 27: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/27.jpg)
Much more!
![Page 28: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/28.jpg)
Migrating from Doctrine 1 to Doctrine 2 Can be tricky Migrating:
◦ … models is easy◦ … application code can require some major
refactoring Do it only if it’s worth it
Migration
![Page 29: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/29.jpg)
Doctrine 2 will be released soon Most of the functionality is there Used in production “The library” for PHP 5.3 Symfony, Zend Framework etc.
Finishing
![Page 30: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/30.jpg)
Questions?
![Page 31: Doctrine 2](https://reader035.vdocuments.us/reader035/viewer/2022062811/56815f33550346895dce02f1/html5/thumbnails/31.jpg)
Juozas Kaziukėnas www.juokaz.com [email protected] twitter: @juokaz
Rate talk at http://joind.in/2105
* Illustrations from http://images.google.com
Thanks!!!