= Nature _(enum)_
:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

The different sorts of domain objects recognized by Isis.

== API

[source,java]
.Nature.java
----
enum Nature {
  NOT_SPECIFIED     // <.>
  ENTITY     // <.>
  VIEW_MODEL     // <.>
  MIXIN     // <.>
  BEAN     // <.>
  boolean isNotSpecified()
  boolean isEntity()
  boolean isMixin()
  boolean isViewModel()
  boolean isBean()
}
----

<.> xref:#NOT_SPECIFIED[NOT_SPECIFIED]
+
--
The default; allows the programmer to combine `@DomainObject` annotation with the xref:refguide:applib:index/ViewModel.adoc[ViewModel] annotation, or the _XmlRootElement_ annotation, or by implementing the xref:refguide:applib:index/ViewModel.adoc[ViewModel] interface.
--
<.> xref:#ENTITY[ENTITY]
+
--
A domain entity whose persistence is managed internally by Isis, using JPA or JDO as the persistence implementation.
--
<.> xref:#VIEW_MODEL[VIEW_MODEL]
+
--
An object that is conceptually part of the application layer, and which surfaces behavior and/or state that is aggregate of one or more domain entity.
--
<.> xref:#MIXIN[MIXIN]
+
--
An object that acts as a mix-in to some other object, contributing behavior and/or derived state based on the domain object.
--
<.> xref:#BEAN[BEAN]
+
--
An object that is entirely managed by the underlying IoC container.
--

== Members

[#NOT_SPECIFIED]
=== NOT_SPECIFIED

The default; allows the programmer to combine `@DomainObject` annotation with the xref:refguide:applib:index/ViewModel.adoc[ViewModel] annotation, or the _XmlRootElement_ annotation, or by implementing the xref:refguide:applib:index/ViewModel.adoc[ViewModel] interface.

[#ENTITY]
=== ENTITY

A domain entity whose persistence is managed internally by Isis, using JPA or JDO as the persistence implementation.

Domain entities are considered to be part of the domain model layer.

Currently implies no additional semantics other than documentation.

[#VIEW_MODEL]
=== VIEW_MODEL

An object that is conceptually part of the application layer, and which surfaces behavior and/or state that is aggregate of one or more domain entity.

The identity of a view model is determined solely by the state of object's properties. Using this nature should be considered exactly equivalent to annotating with xref:refguide:applib:index/ViewModel.adoc[ViewModel] .

Note that collections are ignored; if their state is required to fully identify the view model, define the view model using the JAXB _XmlRootElement_ annotation instead (where the object's state is serialized to an arbitrarily deep graph of data, with references to persistent entities transparently resolved to `<oid-dto>` elements).

[#MIXIN]
=== MIXIN

An object that acts as a mix-in to some other object, contributing behavior and/or derived state based on the domain object.

[#BEAN]
=== BEAN

An object that is entirely managed by the underlying IoC container.
