问题描述
您对 doctrine 有何经验?我从来都不是那种 ORM 的人,我主要使用一些基本的数据库抽象层(如 adodb)进行管理.
What's your experience with doctrine?I've never been much of an ORM kind of guy, I mostlymanaged with just some basic db abstraction layer like adodb.
但我了解它的所有概念和好处.因此,当一个需要 ORM 的项目出现时,我想我会尝试其中一个 ORM 框架.
But I understood all the concepts and benifits of it. So when a project came along that needed an ORM I thought that I'd give one of the ORM framework a try.
我必须在原则和推进之间做出决定,所以我选择了原则,因为我不想处理 phing 要求.
I've to decide between doctrine and propel so I choose doctrine because I didn't want to handle the phing requirement.
我不知道我做错了什么.我带着正确的心态进来了.而且我绝不是初级" php 小子.但我一直在与系统作斗争.有很多文档,但感觉有点杂乱无章.像 YAML 这样简单的东西到 db 表创建是行不通的,只是在没有错误或任何东西的情况下失败.许多其他的东西有点时髦,需要在工作前进行额外的调整.
I don't know what I did wrong. I came in with the right mindset. And I am by no means a 'junior' php kiddie. But I've been fighting the system each step of the way. There's a lot of documentation but it all feels a little disorganize. And simple stuff like YAML to db table creation just wouldn;t work and just bork out without even an error or anything. A lot of other stuff works a little funky require just that extra bit of tweaking before working.
也许我在这里做了一些愚蠢的新手假设,一旦我发现它是什么,我就会有一个 aha 时刻.但现在我完全讨厌这个系统.
Maybe I made some soft of stupid newbie assumption here that once I found out what it is I'll have the aha moment. But now I'm totally hating the system.
是否有任何人可以提供的一些提示,或者可能将我指向有关该主题的良好资源或有关此问题的一些权威网站/人?或者也许只是推荐另一个正常工作"的 ORM 框架?
Is there maybe some tips anyone can give or maybe point me to a good resource on the subject or some authoritative site/person about this? Or maybe just recommend another ORM framework that 'just works"?
推荐答案
我的心情很复杂.我是 SQL 的大师,只是因为它很容易验证.您可以快速测试 SELECT 语句,直到获得正确的结果.重构是一件轻而易举的事.
I have mixed feelings. I am a master at SQL only because it is so easy to verify. You can test SELECT statements quickly until you get the results right. And to refactor is a snap.
在 Doctorine 或任何 ORM 中,有太多抽象层,几乎看起来像是 OCD(强迫症/强迫症).在我尝试 Doctrine 的最新项目中,我遇到了几堵墙.我花了几天的时间才找到解决方案,我知道我可以在几分钟内用 SQL 编写.这太令人沮丧了.
In Doctorine, or any ORM, there are so many layers of abstraction it almost seems OCD (obsessive/compulsive). In my latest project, in which I tried out Doctrine, I hit several walls. It took me days to figure out a solution for something that I knew I could have written in SQL in a matter of minutes. That is soooo frustrating.
我脾气暴躁.SQL 社区非常庞大.对 Doctrine 的社区/支持是微不足道的.当然,您可以查看源代码并尝试弄清楚……而这些问题需要几天时间才能弄清楚.
I'm being grumpy. The community for SQL is HUGE. The community/support for Doctrine is minuscule. Sure you could look at the source and try to figure it out ... and those are the issues that take days to figure out.
底线:不要尝试 Doctrine 或任何 ORM,没有计划好自己的探索时间.
Bottom line: don't try out Doctrine, or any ORM, without planning in a lot of time for grokking on your own.
这篇关于你对 Doctrine ORM 有什么体验?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!