Logging Guidelines ✔️✔️Log with enough information to explain the state of the application
and what was happening
Excessive logging results in large logs with potential performance risk
Insufficient logging results in logs that lack utility
Use care with:
Data that is protected by legal, regulatory, or contractual obligations
Personally Identifiable Information (PII) - do not log PII at all!
Guidewire Query API General Best Practices ✔️✔️Use the property reference
(EntityType#Property) for type-safe access to the properties on the query entity type
Use the property reference to filter query results, join to another entity type, order rows in the
result set, or to specify a column for a row query
Use query.contains() after other query.compare() operations against indexed columns for better
performance against large data sets
Guidewire Query API - Denormalized columns improve performance of ✔️✔️Ends with
searches
Case-insensitive searches
,Guidewire Query API Anti-Patterns - Bring back only the data you need by ✔️✔️Avoid
filtering query results in memory
Avoid filtering query results in the application server
Perform filtering in the database
Avoid the use of where(), first(), last(), firstWhere(), and lastWhere()
Guidewire Query API Anti-Patterns - use dot notation with care because ✔️✔️accessing
foreign keys or array fields retrieve additional entities into memory
Guidewire Query API Anti-Patterns - Check for existence of an entity when the number of
results is not important by ✔️✔️Verifying the results of a targeted query are not empty
Avoiding hasMatch(), countWhere(), and select().Count
Guidewire Query API Anti-Patterns - When a count is necessary, let the database count the
entities and ✔️✔️Avoid countWhere()
Avoid counting collections
Avoid iterating over entities from the database to count them
Avoid counting entities before accessing them
Avoid countWhere() and select().Count
Guidewire Query API Anti-Patterns - Avoid queries to check for new or changed entities, instead
✔️✔️Use Boolean methods getChangedFields, getAddedArrayElements,
getChangedArrayElements,
, and getRemovedArrayElements
Use specialized methods that test for new or changed entities when available
(Claim.PolicyChanged)
Guidewire Query API Anti-Patterns - Avoid queries to access new or changed entities by
✔️✔️Use Boolean methods getChanged, isFieldChanged, isArrayElementAddedOrRemoved,
and isArrayElementChanged
Check the Gosu API for specialized methods on entities
Guidewire Query API Advanced Concepts - Entity queries ✔️✔️should be used unless
performance is not adequate
Guidewire Query API Advanced Concepts - Row queries ✔️✔️Use a single database query on
the main entity and related entities to return only the data columns you select from the database
Allow you to use only the values contained the query results
Filter the rows returned from the database using query.compare
Involve more code maintenance and should only be used when performance issues are
encountered with an entity query
Support database aggregate functions (Avg, Count, Min, Max, Sum)
Guidewire Bundle Management - General information for Bundles ✔️✔️A bundle is an in-
memory container for entity instances representing rows in the database
Bundles are read via queries or foreign key and array accessors