开发者

How does Virtuemart do EAV without using EAV?

I understand the three basic failures in EAV, namely that it takes a lot of work to reassemble the data. However, I want a database where I can add custom fields. A lot of people say that Virtuemart allows custom fields but without using an EAV database structure. Can someone explain how this can be do开发者_如何学编程ne or provide links?


I believe they store custom fields in a chunk of XML or YAML or other domain-specific language.

Basically, they use Martin Fowler's Serialized LOB pattern.

This makes it hard to use SQL expressions to query the custom attributes. You have to fetch the whole row back into your application and parse out the custom attributes. But this is no worse than the pain caused by EAV.

See http://web.archive.org/web/20110709125812/http://sankuru.biz/en/blog/8-joomla-configuration-issues/35-the-cck-buzz-content-creation-kit-and-the-eav-problem.html

Virtuemart and CCK

Virtuemart (VM) custom user fields are CCK-style, but do not rely on EAV. Therefore, they are very usable, and useful. I do recommend their use.

VM product types are also CCK-style, but unfortunately do rely on EAV. Therefore, I avoid VM product types like the plague. Instead, I just manually create additional fields in the product record.

The VM attribute system (simple, custom, advanced) is actually too underpowered to be considered CCK grade.

A good improvement to VM, would consist in rephrasing the VM product types and attributes to non-EAV CCK-style custom fields (and therefore make them work more like the VM custom user fields).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜