=== Reference Data

: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.
:page-partial:

Some domain classes are immutable to the user, and moreover have only a fixed number of instances.
Often these are "reference" ("standing") data, or lookup data/pick lists.
Typical examples could include categories, countries, states, and tax or interest rate tables.

Where the number of instances is relatively small, ie bounded, then the xref:refguide:applib:index/annotation/DomainObject.adoc#bounding[bounding()] element can be used as a hint.
For such domain objects the framework will automatically allow instances to be selected; xref:vw:ROOT:about.adoc[Web UI (Wicket viewer)] displays these as a drop-down list.

For example:

[source,java]
----
@DomainObject(
    bounding=Bounding.BOUNDED,
    editing=Editing.DISABLED        // <.>
)
public class Currency {
    ...
}
----
<.> This attribute is commonly combined with `editing=DISABLED` to enforce the fact that reference data is immutable

[TIP]
====
There is nothing to prevent you from using this attribute for regular mutable entities, and indeed this is sometimes worth doing during early prototyping.
However, if there is no realistic upper bound to the number of instances of an entity that might be created, generally you should use xref:refguide:applib-methods:prefixes.adoc#autoComplete[autoComplete...()] supporting method or the xref:refguide:applib:index/annotation/DomainObject.adoc#autoCompleteRepository[@DomainObject#autoCompleteRepository] attribute instead.
====




