• Complain

Michael Romer - PHP Data Persistence with Doctrine 2 ORM

Here you can read online Michael Romer - PHP Data Persistence with Doctrine 2 ORM full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2013, publisher: Leanpub, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover
  • Book:
    PHP Data Persistence with Doctrine 2 ORM
  • Author:
  • Publisher:
    Leanpub
  • Genre:
  • Year:
    2013
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

PHP Data Persistence with Doctrine 2 ORM: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "PHP Data Persistence with Doctrine 2 ORM" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Doctrine 2 takes the pain out of dealing with relational databases in an object oriented programming world - and this book shows you how it works and how you can save time and money by simply coding less while accomplishing more with Doctrine 2. Michael Romer is the author of Web Development with Zend Framework 2, the best-selling Zend Framework 2 book on Leanpub and Amazon. He has years and years of experience in the Internet Industry and used to work for global players like eBay. He knows what you need to know about Doctrine 2 - and its in this book!

Michael Romer: author's other books


Who wrote PHP Data Persistence with Doctrine 2 ORM? Find out the surname, the name of the author of the book and a list of all author's works by series.

PHP Data Persistence with Doctrine 2 ORM — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "PHP Data Persistence with Doctrine 2 ORM" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
PHP Data Persistence with Doctrine 2 ORM Concepts Techniques and Practical - photo 1
PHP Data Persistence with Doctrine 2 ORM
Concepts, Techniques and Practical Solutions
Michael Romer

This book is for sale at http://leanpub.com/doctrine2-en

This version was published on 2013-08-23

This is a Leanpub book Leanpub empowers authors and publishers with - photo 2

* * * * *

This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and many iterations to get reader feedback, pivot until you have the right book and build traction once you do.

* * * * *

2013 by Michael Romer, Grevingstrasse 35, 48151 Mnster, Germany, mail@michael-romer.de - All rights reserved.
About this book

I would have written a shorter book, but I did not have the time. freely adapted from Blaise Pascal (French mathematician, logician, physicist and theologian.)

1.1 Software version

This book is based on Doctrine 2.3, however, most of its content will still be valid for later versions.

1.2 Database system

All examples in this book are based on MySQL. However, Doctrine 2 supports other DBMS such as PostgreSQL or SQLite. Most examples will work with other DBMS right away, some may need to be adopted.

1.3 Code downloads

Most of the code shown in this book can be found in a public repository GitHub. While the code of chapter 3 (A self-made ORM) can be found on the master branch, there is another branch available called doctrine, which holds the modifications made in chapter 4 (Hello, Doctrine 2!). There is a third branch called application holding the modifications made in the later chapters. As the demo application grows throughout the book, the application branch also includes a basic MVC-framework called Slim to better structure the applications code as well as Twitters Bootstrap for some basic UI styling.

1.4 Conventions used in this book

Code listings are highlighted and have line numbering. Listings that start with a $ symbol represent the command line, lines stating with a > symbol represent command output. New terms are written in italic on first usage.

1.5 An important notice for Amazon customers

If you bought this book at Amazon, it is currently somewhat more difficult to ensure that you automatically receive all of its updates as they are published. To avoid problems, please send a short email with Updates Doctrine 2 book in the subject line to mail@michael-romer.de. In this manner, you can be certain that you will really always have the latest version of the book. As thanks for your efforts you will also additionally receive the PDF and EPUB versions of the book.

Introduction
2.1 Object oriented programming (OOP) & the Domain Model

PHP developers nowadays mostly think and code in an object oriented way. Application functionality is built using classes, objects, methods, inheritance and other techniques of object orientation. In the beginning, OOP has mostly been used for the general technical aspects of application, such as MVC frameworks or logging and mailing libraries. All these components more or less can be used as is in all applications, no matter what domain the application is in: e-commerce, portal or community site. For complex systems and also if aspects such as maintainability and extensibility are important, OOP in the domain specific code also is an advantage. Mainly, every application consists of two different types of code: general technical code and domain specific code. General technical code often is re-usable when built as a library or framework, domain specific code often is too custom to be re-used.

Object oriented domain specific code is characterized by the existence of a so-called domain model. A domain model mainly means:

  • Classes and objects represent the main concepts of a domain, the so-called entities (these elements can also be value objects to be precise, but compared to entities, value objects dont have a persistent identity). In an online shop, the main elements would be Customer, Order, Product, Cart and so forth.
  • Domain specific classes and objects may have associations between them. Again, in an online shop, an Order usually has at least one Customer that it references as well as one or more references to the Product(s) ordered.
  • Domain specific functions are implemented as a part of an entity. In an online shop, a Cart often has a calculateTotalPrice() method to calculate the final price based on the items in cart considering their quantity.
  • Functions that span multiple entities usually are implemented in so-called services, simply because they cannot clearly be assigned to one single entity. Again, in an online shop, the Checkout service may take care of lowering the inventory, invoicing, updating the order history, etc. The service deals with several different entities at once.
  • Whenever possible, domain specific objects are used instead of generic data containers such as PHP arrays (exceptions prove the rule here).
  • Business logic (such as business rules) is implemented within the domain objects of an application, not in e.g. controllers, whenever possible (controllers are used in MVC based frameworks to handle user input).

The main advantage of the domain model lies in having the domain specific code centrally in defined classes and objects supporting maintenance and changes. The possibility of incidentally breaking a function, when changing or extending code, drops. By isolating domain specific code from general technical code, portability is supported. Thats helpful, e.g. when migrating from one application framework to another.

Besides the advantages mentioned above, the domain model also supports teamwork. Often, when building and launching a new software product, besides programmers also business and marketing folks are involved. A domain model can bridge the mental gap between business and IT by unifying the terminology used. This alone makes a Domain model invaluable.

2.2 Demo application

Concrete examples make things easier to understand. Throughout this book, a demo application called Talking will help to put theory into practice. Talking is a (simple) web application allowing users to publish content online. The applications domain model looks like this:

Demo application Talking - Domain Model A User can write Posts A Post always - photo 3

Demo application Talking - Domain Model

A User can write Posts. A Post always only has one author and both entities reference each other. A User can act in one or more Roles. A User references its Roles, but from a given Role, one cannot access the Users in this Role. A User references UserInfo holding the date of registration and the date of de-registration if available. UserInfo references back to a User. A User references ContactData where email and phone number is saved. ContactData does not reference back to its User. A User may reference another User as its life partner. The

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «PHP Data Persistence with Doctrine 2 ORM»

Look at similar books to PHP Data Persistence with Doctrine 2 ORM. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «PHP Data Persistence with Doctrine 2 ORM»

Discussion, reviews of the book PHP Data Persistence with Doctrine 2 ORM and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.