使用Doctrine为PHP的优势是什么? [英] Advantages of using Doctrine for PHP?

查看:201
本文介绍了使用Doctrine为PHP的优势是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

跨href=\"http://www.doctrine-project.org/\">主义的项目,该项目有一个对象关系映射器和DB抽象层

在整个确实建立在原则的应用程序更容易维护和理解?它是过度设计,并正在建设一个抽象层明智的中小型项目上? (小于50 GUI屏幕),而不是直接使用MySQL


解决方案

  

这是什么主义提供其他PHP抽象层不?



  1. 实现,而ActiveRecord的DataMapper的模式。

  2. 支持<一个href=\"http://www.doctrine-project.org/projects/orm/2.0/docs/reference/association-mapping/en#association-mapping\">annotations, XML和YAML的架构。

  3. 使用<一个href=\"http://www.doctrine-project.org/projects/orm/2.0/docs/reference/dql-doctrine-query-language/en#dql-doctrine-query-language\">DQL.

  4. 使用PHP 5.3 +的好处。

  5. 是速度快,大型社区。
  6. 除了ORM有ODM。


  

时的查询语言真的要开发一个完整的Web应用程序的东西吗?


负责维护业务对象应该意识到学说的存在的应用的仅有的一部分。和部分不必须是学说基于100%。


  

在整个确实建立在原则的应用程序更容易维护和理解?


当然。在code是更容易阅读,理解和维护。


  

它是过度设计,而它是明智的中小型项目?


其实学说是其基本面相当简单。和它的小型,中型甚至一些大型的应用程序非常不错的选择。


本主义不是一切的答案,有时是一个小问题。然而,对于典型的任务,这是非常有用的。恕我直言最好的ORM / ODM为PHP在这一刻。

Just came across the Doctrine Project which has an Object Relational Mapper and a DB Abstraction Layer. What does Doctrine provide that other PHP abstraction layers don't? And what practical use can you put the ORM to, apart from fetching objects via queries written in Doctrine Query Language? Is the query language really something you want to develop an entire web app in? Does it perform well?

On the whole does building an app on Doctrine make it easier to maintain and understand? Is it over-engineered, and is building on an abstraction layer sensible for small-medium size projects? (<50 GUI screens), as opposed to directly working with MySQL.

解决方案

What does Doctrine provide that other PHP abstraction layers don't?

  1. Implements DataMapper pattern rather ActiveRecord.
  2. Supports annotations, XML and YAML for schema.
  3. Uses DQL.
  4. Uses benefits of PHP 5.3+.
  5. Is fast and has large community.
  6. Except ORM there is ODM.

Is the query language really something you want to develop an entire web app in?

Just a part of the application responsible for maintaining business-objects should be aware of the existence of Doctrine. And that part doesn't have to be 100% Doctrine-based.

On the whole does building an app on Doctrine make it easier to maintain and understand?

Definitely. The code is easier to read, understand and maintain.

Is it over-engineered, and is it sensible for small-medium size projects?

Actually Doctrine is quite simple in its fundamentals. And it's a very good choice for small, medium and even some large applications.


Doctrine isn't the answer for everything and sometimes it's a little problematic. However for typical tasks it's extremely useful. IMHO the best ORM/ODM for PHP at this moment.

这篇关于使用Doctrine为PHP的优势是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆