Strategies for extending the base data model

Extending the data model means one of the following:

  • You want to add new fields to an existing entity.
  • You want to create a new entity.

During planning for data model extensions, you need to consider performance implications. For example, if you add hundreds of extensions to a major object, this can conceivably exceed a reasonable row size in the database.

Adding fields to an entity

If an entity has almost all the functionality you need to support your business case, you can add one or more fields to it. In this sense, Guidewire uses the term field to denote one of the following:

  • Column
  • Typekey
  • Array
  • Foreign key

Subtyping a non-final entity

If you want to find a new use for an existing entity, you can subtype and rename it. For instance, suppose that you want to track individuals who have already had the role of IssueOwner. In this case, it can be useful to create PastIssueOwner.

Creating a new entity

Occasionally, careful review of the base application data model makes it clear that you need to create a new entity. There are several types of base entities within Guidewire applications. However, Guidewire recommends in general practice that you always use one of the following types if you create a new entity:

retireable

This type of entity is an extension of the editable entity. It is not possible to delete this entity. It is possible to retire it, however.

versionable

This type of entity has a version and an ID. It is possible to delete entities of this type from the database.

Guidewire recommends the following:

  • If another entity contains a foreign key reference to the new entity, then make the new entity retireable. For example, any entity that contains an array must be retireable.
  • If there is no foreign key reference, and you desire the entity to contain the fields CreateTime, UpdateTime, CreateUser, and UpdateUser, then make the new entity editable.
  • Otherwise, make the entity versionable.
Note: To later change an existing entity from retireable to versionable, you must drop the database.

See Data entities and the application database for more information on these data types.

In general, you typically want to create a new entity under the following circumstances:

  • If your business model requires an object that does not logically exist in the application. Or, if you have added too many fields to an existing entity, and want to abstract away some of it into a new, logical entity.
  • If you need to manage arrays of objects, as opposed to multiple objects, you can create an entity array.

Reference entities

To store some unchanging reference data, such as a lookup table that seldom changes, you can create a reference entity. An example of a business case for a reference entity is a list of typical reserve amounts for a given exposure. To avoid the overhead of maintaining foreign keys, make reference entities keyable. Unless you want to build in the ability to edit this information from within the application, set setterscriptability = hidden. This prevents Gosu code from accidentally overwriting the data.

Guidewire recommends that you determine that this is not really a case for creating a typelist before you create a reference entity.