Think like an ant, distribute the workload - PhpDay, Italy, 2011
Doctrine 2 - PhpDay Italy
-
Upload
juozas-kaziukenas -
Category
Technology
-
view
3.965 -
download
1
description
Transcript of Doctrine 2 - PhpDay Italy
Juozas “Joe” Kaziukėnas
http://juokaz.com / [email protected] / @juokaz
Who am I? Juozas Kaziukėnas, Lithuanian
You can call me Joe
3 years in Edinburgh, UK
CEO of Web Species Ltd
Software developer, consultant and evangelist
Conferences speaker
Open source developer for Zend Framework, Doctrine…
More info in http://juokaz.com and twitter @juokaz
Who are you? Doctrine users?
Propel users? (you will be converted!)
Symfony2 users?
Interested in DB’s and PHP?
Interested in PHP news?
Inspired by Hibernate, ActiveRecord etc.
Doctrine 1.X Slow
High memory usage (cyclic references)
Magic! (eg. Behaviors)
Hard to execute raw SQL
Still the best ORM for PHP available today
Root of all problems!
Active Record
Used to be the best ORM available
Stable
Works
Makes development fast, clean and consistent
Used in production
Symfony 1.X
What’s new? Rewritten from scratch (almost)
PHP 5.3
Decoupled components
Simplified API
“Complexified” internals?..
Performance
New hydration
Less magic
Overall cleanup
Based on JSR-317 a.k.a. JPA v2.0
Common Caching
Events
Annotations
Class loaders
… more
Annotations
DBAL Can be used without ORM
Abstraction for MySQL, PgSQL, Oracle, Microsoft SQL, DB2 etc.
PHP types mapping to DB types
Extendable
… more
Connection
ORM Actual ORM component
Uses Common and DBAL
No more ActiveRecord
Entities
Metadata mapping
Entity manager
Query language
Faster, cleaner, clever, extendable
No forcing
Entity
EntityManager
Querying
MongoDB, CauchDB
ODM Abstracts NoSQL databases
Similar Metadata configuration
A lot of functionality from ORM also available in ODM
Querying
EntityManager -> DocumentManager
Driven by OpenSky team, mainly
ODM Querying
Migration 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
Finishing Doctrine 2 is out
“The library” for PHP 5.3
Symfony2, Zend Framework 2 etc.
Works well, development is continuing
Thanks!!! Juozas Kaziukėnas
http://juokaz.com
twitter: @juokaz
Rate this talk at http://joind.in/2990
* Illustrations from http://images.google.com