Zend 框架 EAV 实现
我想知道在 Zend Framework 中是否有任何好的预构建方法来实现 EAV 设计模式?
我正在尝试决定是否应该创建自己的实现或使用已经构建的实现。
I was wondering if there were any good pre-built ways to implement an EAV design pattern in Zend Framework?
I am trying to decide if I should create my own implementation or use one that has already been built.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
将 Doctrine 与 MongoDB 文档映射器结合使用 http://www.doctrine-project.org/
Zend Framework 2.0 具有Doctrine with Composer 自动安装,因此这意味着 Zend People 除了内置 Zend_Db 之外还提供此选项作为选项。
在面向文档的 NoSQL 数据库系统(如 MongoDB 或 CouchDB)上使用 EAV 比在传统关系数据库(如 MySql)上实现 Hack(Magento 所做的)要好得多。 NoSQL 数据库更擅长实现稀疏矩阵类型数据。
Use Doctrine with MongoDB Document Mapper http://www.doctrine-project.org/
Zend Framework 2.0 has automated install for Doctrine with Composer, so it means Zend People also offer this as an Option apart from the built-in Zend_Db.
Using EAV on a document-oriented NoSQL database system like MongoDB or CouchDB is way much better than implementing a Hack over Traditional Relational Databases like MySql ( something that Magento did ). NoSQL Databases are better at implementing Sparse Matrix type Data.
请查看 Google 代码上的 Zend Framework EAV。
Check out Zend Framework EAV on Google Code.
Digitalus CMS 使用 EAV 模式,并且基于 MySQL。确实,Mongo 或 Couch 可能更合适,但 MySQL 通常是更简单的选择,因为您无需安装任何东西。我尝试过使用 SimpleDB,但本地 MySQL 版本快了 4 倍。 SQLite 也运行得很好。
这种做法有很多反对者,他们的主张基本上是有根据的。每当我需要能够查询数据时,我都会使用标准关系方法,但当您处理结构非常松散的数据(例如网页上的内容)时,EAV 会发挥作用。
Digitalus 使用一种方法,其中有处理所有 EAV 逻辑的基本 CMS 项目模型。该模型还处理直写式缓存,因此系统最终可以像平面文件系统一样快速地提供内容。
所有纯粹主义者在技术上可能都是正确的,但快速和简单在我的工具箱中占有一席之地。
Digitalus CMS uses the EAV pattern, and is based on MySQL. It is true that Mongo or Couch might be more appropriate, but MySQL is often an easier choice because you don't have to install anything. I have tried using SimpleDB, but the local MySQL version is 4x faster. SQLite also works very well.
There are a lot of opponents to this approach, and their claims are largely founded. Any time I need to be able to query data I use a standard relational approach, but EAV shines when you are working with very loosely structured data like the content on a web page.
Digitalus uses an approach where there is the base CMS item model that handles all of the EAV logic. This model also handles a write-through cache so the system ultimately serves content as fast as a flat file system.
All the purists are probably technically correct, but fast and easy have a place in my toolbox.