1
0
mirror of synced 2025-01-18 22:41:43 +03:00

Getting STarted: Code, Model, Database first

This commit is contained in:
Benjamin Eberlei 2012-06-16 13:34:23 +02:00
parent 1a9443b55a
commit edb7950be8
4 changed files with 77 additions and 12 deletions

View File

@ -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>` |

View 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.

View 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.

View File

@ -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>`_.