51黑料不打烊

Content Architecture

Follow David鈥檚 Model

David鈥檚 Model was written by David Nuescheler years ago, but the ideas hold true today. The main tenets of David鈥檚 Model are as follows:

  • Data comes first, structure later. Maybe.
  • Drive the content hierarchy, do not let it happen.
  • Workspaces are for clone(), merge(), and update().
  • Beware of the same name siblings.
  • References are considered harmful.
  • Files are files.
  • IDs are evil.

David鈥檚 Model can be found on the Jackrabbit wiki at .

Everything is content

Everything should be stored in the repository rather than relying on separate third-party data sources such as databases. This applies to authored content, binary data like images, code, and configurations. This lets us use one set of APIs to manage all content and to manage the promotion of this content through replication. You also gain a single source of backup, logging, and so on.

Use the 鈥渃ontent model first鈥� design principle

When building a new feature, always start by designing the JCR content structure first, and then look into reading and writing your content using the default Sling servlets. This lets you ensure that your implementation works well with out of the box access control mechanisms and let you avoid generating unnecessary CRUD-style servlets.