开发者

What is the node pattern?

开发者 https://www.devze.com 2022-12-21 09:11 出处:网络
In a book i recently read, the author presented the \'node pattern\' which looks close to EAV, but i couldn\'t find any useful and concrete informa开发者_StackOverflow中文版tions about it.

In a book i recently read, the author presented the 'node pattern' which looks close to EAV, but i couldn't find any useful and concrete informa开发者_StackOverflow中文版tions about it.

Do you know any good document to point me to ? or explain what's it exactly ?


After reading through a couple of pages, I realised node pattern is not a pattern on its own, its an adaptation of Entity-attribute-value pattern (EAV) for CMSs. You can find out more about the EAV pattern at http://en.wikipedia.org/wiki/Entity-attribute-value_model . Hope thats helpfull


it is a pattern , a database pattern , a way to abstract content types from te content itself .In a MVC application, instead of defining a content type with a db table ( ie an article with a title and a content ) , the content type is abstract and defined in the model of your application. so your database only holds content nodes without a structure , and you use reflection in order to get the nodes linked to a content type in the model of your application. Drupal cms uses this pattern too , so you can create content types within your app without create a new db table for the new type ( check cck in drupal ). so you'll get a very simple db table but your model will be more complicated , but you'll be able to add new content types in you app just by creating a new class.


There is no such pattern. Design pattern is, by definition, something precisely defined and widely encountered - an observation, not an idea.

If it's not explained in the book and hard to find elsewhere - it's not a pattern.

0

精彩评论

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