# When to use BaseDocument or HippoCompound

**URL:** <https://community.bloomreach.com/t/when-to-use-basedocument-or-hippocompound/3924>\
**Category:** Experience Manager (PaaS/OnPrem)\
**Created:** [May 17, 2023, 6:37pm UTC](https://community.bloomreach.com/t/when-to-use-basedocument-or-hippocompound/3924 "2023-05-17T18:37:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![andorian](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/andorian/32/1557_2.png) [@andorian](https://community.bloomreach.com/u/andorian)\
**Post date:** [May 17, 2023, 6:37pm UTC](https://community.bloomreach.com/t/when-to-use-basedocument-or-hippocompound/3924/1 "2023-05-17T18:37:14Z")

</div>

Dear community,

I was searchingto find the difference and why use/extend those two classes, but not a clear answer. I hopeyou can expalin me better

---

<div class="post-metadata">

**Author:** ![Nicholas\_Pavao](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/nicholas_pavao/32/1370_2.png) [@Nicholas\_Pavao](https://community.bloomreach.com/u/Nicholas_Pavao)\
**Post date:** [May 17, 2023, 6:41pm UTC](https://community.bloomreach.com/t/when-to-use-basedocument-or-hippocompound/3924/2 "2023-05-17T18:41:42Z")

</div>

Hi andorian,

from [Content Model Concepts - Bloomreach Experience Manager (PaaS/Self-Hosted) - The Fast and Flexible Headless CMS](https://xmdocumentation.bloomreach.com/library/concepts/document-types/concepts.html)

## Document Type

A _document type_ defines the data structure and the editing template of a class of documents. A document type can contain both primitive and compound type fields.

## Compound Type

A _compound type_ defines the data structure and the editing template of a reusable block of document fields. A compound type can contain both primitive and compound type fields. An instance of a compound type can only exist within a document instance.

Either can be selected while creating document types in the [Document Type editor](https://xmdocumentation.bloomreach.com/library/concepts/document-types/document-type-editor.html)

---

<div class="post-metadata">

**Author:** ![andorian](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/andorian/32/1557_2.png) [@andorian](https://community.bloomreach.com/u/andorian)\
**Post date:** [May 18, 2023, 9:55am UTC](https://community.bloomreach.com/t/when-to-use-basedocument-or-hippocompound/3924/4 "2023-05-18T09:55:24Z")

</div>

Thank for your answer.

So means if i want to created a custom document type and in this document type has a:

- imagelink and/or
- link
- resource
- rich text

I must extends HippoCompound

If the custom document type has not any of the above I just extends BaseDocument, is that correct?

Thans in advance

---

<div class="post-metadata">

**Author:** ![jeroen.hoffman](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.bloomreach.com/jeroen.hoffman/32/43_2.png) [@jeroen.hoffman](https://community.bloomreach.com/u/jeroen.hoffman)\
**Post date:** [May 19, 2023, 7:25am UTC](https://community.bloomreach.com/t/when-to-use-basedocument-or-hippocompound/3924/5 "2023-05-19T07:25:27Z")

</div>

Hi,  
It’s not a matter of whether the document type contains such fields, it’s a matter of whether you are designing your data structure in reusable field groups, a.k.a. compounds.

Your example seems to not have that, so use BaseDocument for your custom document type.

Jeroen
