Getting STarted: Code, Model, Database first
This commit is contained in:
parent
1a9443b55a
commit
edb7950be8
@ -26,7 +26,9 @@ Getting Started
|
||||
---------------
|
||||
|
||||
* **Tutorial**:
|
||||
:doc:`Getting Started <tutorials/getting-started>`
|
||||
:doc:`Code First <tutorials/getting-started>` |
|
||||
:doc:`Model First <tutorials/getting-started-models>` |
|
||||
:doc:`Database First <tutorials/getting-started-database>`
|
||||
|
||||
* **Introduction**:
|
||||
:doc:`In 10 quick steps <tutorials/in-ten-quick-steps>` |
|
||||
|
27
en/tutorials/getting-started-database.rst
Normal file
27
en/tutorials/getting-started-database.rst
Normal file
@ -0,0 +1,27 @@
|
||||
Getting Started: Database First
|
||||
===============================
|
||||
|
||||
.. note:: *Development Workflows*
|
||||
|
||||
When you :doc:`Code First <getting-started>`, you
|
||||
start with developing Objects and then map them onto your database. When
|
||||
you :doc:`Model First <getting-started-models>`, you are modelling your application using tools (for
|
||||
example UML) and generate database schema and PHP code from this model.
|
||||
When you have a :doc:`Database First <getting-started-database>`, then you already have a database schema
|
||||
and generate the correspdongin PHP code from it.
|
||||
|
||||
.. note::
|
||||
|
||||
This getting started guide is in development.
|
||||
|
||||
Development of new applications often starts with an existing database schema.
|
||||
When the database schema is the starting point for your application, then
|
||||
development is said to use the *Database First* approach to Doctrine.
|
||||
|
||||
In this workflow you would always do changes to the database schema and then
|
||||
regenerate the PHP code to use with this schema. You need a flexible
|
||||
code-generator for this task and up to Doctrine 2.2, the code generator hasn't
|
||||
been flexible enough to achieve this.
|
||||
|
||||
We spinned of a subproject Doctrine CodeGenerator that will fill this gap and
|
||||
allow you to do *Database First* development.
|
24
en/tutorials/getting-started-models.rst
Normal file
24
en/tutorials/getting-started-models.rst
Normal file
@ -0,0 +1,24 @@
|
||||
Getting Started: Model First
|
||||
============================
|
||||
|
||||
.. note:: *Development Workflows*
|
||||
|
||||
When you :doc:`Code First <getting-started>`, you
|
||||
start with developing Objects and then map them onto your database. When
|
||||
you :doc:`Model First <getting-started-models>`, you are modelling your application using tools (for
|
||||
example UML) and generate database schema and PHP code from this model.
|
||||
When you have a :doc:`Database First <getting-started-database>`, then you already have a database schema
|
||||
and generate the correspdongin PHP code from it.
|
||||
|
||||
.. note::
|
||||
|
||||
This getting started guide is in development.
|
||||
|
||||
There are applications when you start with a high-level description of the
|
||||
model using modelling tools such as UML. Modelling tools could also be Excel,
|
||||
XML or CSV files that describe the model in some structured way. If your
|
||||
application is using a modelling tool, then the development workflow is said to
|
||||
be a *Model First* approach to Doctrine2.
|
||||
|
||||
In this workflow you always change the model description and then regenerate
|
||||
both PHP code and database schema from this model.
|
@ -1,17 +1,29 @@
|
||||
Getting Started
|
||||
===============
|
||||
Getting Started: Code First
|
||||
===========================
|
||||
|
||||
Doctrine 2 is an object-relational mapper (ORM) for PHP 5.3.0+ that provides transparent persistence for PHP objects.
|
||||
It uses the Data Mapper pattern at the heart of this project, aiming for a complete separation of
|
||||
the domain/business logic from the persistence in a relational
|
||||
database management system. The benefit of Doctrine for the
|
||||
programmer is the ability to focus solely on the object-oriented business logic and
|
||||
worry about persistence only as a secondary task. This doesn't mean
|
||||
persistence is not important to Doctrine 2, however it is our
|
||||
belief that there are considerable benefits for object-oriented
|
||||
programming if persistence and entities are kept perfectly
|
||||
.. note:: *Development Workflows*
|
||||
|
||||
When you :doc:`Code First <getting-started>`, you
|
||||
start with developing Objects and then map them onto your database. When
|
||||
you :doc:`Model First <getting-started-models>`, you are modelling your application using tools (for
|
||||
example UML) and generate database schema and PHP code from this model.
|
||||
When you have a :doc:`Database First <getting-started-database>`, then you already have a database schema
|
||||
and generate the correspdongin PHP code from it.
|
||||
|
||||
Doctrine 2 is an object-relational mapper (ORM) for PHP 5.3.0+ that provides
|
||||
transparent persistence for PHP objects. It uses the Data Mapper pattern at
|
||||
the heart of this project, aiming for a complete separation of the
|
||||
domain/business logic from the persistence in a relational database management
|
||||
system. The benefit of Doctrine for the programmer is the ability to focus
|
||||
solely on the object-oriented business logic and worry about persistence only
|
||||
as a secondary task. This doesn't mean persistence is not important to Doctrine
|
||||
2, however it is our belief that there are considerable benefits for
|
||||
object-oriented programming if persistence and entities are kept perfectly
|
||||
separated.
|
||||
|
||||
Starting with the object-oriented model is called the *Code First* approach to
|
||||
Doctrine.
|
||||
|
||||
.. note::
|
||||
|
||||
The code of this tutorial is `available on Github <https://github.com/doctrine/doctrine2-orm-tutorial>`_.
|
||||
|
Loading…
x
Reference in New Issue
Block a user