
Modeling Summary
A content model describes the data being stored in the repository. The content model is critical. Without it, Alfresco would be little more than a file system. Here is a list of key information that the content model provides Alfresco:
- Fundamental data types and how those data types should persist to the database. For example, without a content model, Alfresco wouldn't know the difference between a string and a date.
- Higher order data types such as "content" and "folder" as well as custom content types such as "SomeCo Standard Operating Procedure" or "SomeCo Sales Contract".
- Out of the box aspects such as "auditable" and "classifiable" as well as SomeCo-specific aspects such as "rateable", "commentable", or "client-related".
- Properties (or metadata) specific to each content type.
- Constraints placed on properties (such as property values that must match a certain pattern or property values that must come from a specific list of possible values).
- Relationships or "associations" between content types.
Alfresco content models are built using a small set of building blocks: Types, Properties, Property Types, Constraints, Associations, and Aspects. When planning your Alfresco implementation, it may make sense to diagram the proposed content model just as you would a data model in a traditional web application.
The content model implemented in the examples could be diagrammed as follows:

The Appendix contains similar diagrams for the out of the box content models for your reference.
Custom Behavior
You may find that your custom aspect or custom type needs to have behavior or business logic associated with it. For example, every time an Expense Report is checked in, you might want to recalculate the total by iterating through the associated Expenses. One option would be to incorporate this logic into rules or actions in the Alfresco web client or your custom web application. But some behaviors are so fundamental to the aspect or type that they should really be "bound" to the aspect or type, and invoked any time Alfresco works with those objects. Behavior really gets out of the realm of modeling and into "handling content automatically", which is the subject of Chapter 4. For now, just realize that associating business logic with your custom aspects and types (or overriding out of the box behavior) is possible.