GUIDEWIRE BEST PRACTICES EXAMPREP
QUESTIONS AND DETAILED SOLUTIONS
◉ Class naming conventions.
Answer: Use UpperCamelCase
Do not add _Ext to classes within customer package spaces
◉ Function naming conventions.
Answer: Use lowerCamelCase
Use a verb that describes that the function is doing i.e. verifyAddress
Do not add _Ext suffix to private functions or enhancements in
customer package spaces
◉ Variable naming conventions.
Answer: Member variable names use lowerCamelCase with a leading
underscore i.e. _pluginCallbackHandler
Local variable names use lowerCamelCase short names that describe
the purpose i.e. latestPolicyRevision
◉ Display key naming conventions.
Answer: Add suffix _Ext too all new display keys
Do not modify automatically generated display keys
,◉ Logging is.
Answer: The process of recording application actions and state to a
secondary interface
◉ Logging is used for.
Answer: Application maintenance and troubleshooting
Creating statistics relating to application usage
Auditing by capturing significant events
◉ Typical events to log are.
Answer: Success / Failure - a transaction or action has succeeded or
failed
Recovery - a system went down or connection failed, retried, and
recovered
Identification - any large functional areas such as integration, rating,
reinsurance, and rules
◉ Logging components - Logger.
Answer: has a category and level, sends content to an Appender
◉ Logging components - Appender.
Answer: is an output destination (server console or rolling file)
,◉ Logging components - Layout.
Answer: defines the format of the content sent to an appender
◉ Logging Level - Trace.
Answer: Description: Fine-grained informational events
When to use: Log method entry and exit
◉ Logging Level - Debug.
Answer: Description: Detailed informational events
When to use: Log important steps and calculations for diagnosing
problems
◉ Logging Level - Info.
Answer: Description: Coarse-grained informational messages of
progress
When to use: Log the occurrence or result of an important event
◉ Logging Level - Warn.
Answer: Description: Indicate a potential problem
When to use: The user experience has not been affected
, ◉ Logging Level - Error.
Answer: Description - Indicate definite problems
When to use: The user experience has been affected
◉ There are 2 ways to initialize a logger in Gosu.
Answer: Integration: PLLoggerCategory.INTEGRATION
Plugin: PLLoggerCategory.PLUGIN
Use sub-level of existing logging category to maintain structure.
Example: PLUGIN.MotorVehicleRecord
static var _motorVehiclePluginLogger =
LoggerFactory.getLogger(PLLoggerCategory.PLUGIN."MotorVehicleR
ecord")
◉ Logging Format should be.
Answer: a standard format to simplify analysis of large logs
◉ Guarded Logging should be used.
Answer: To test log level before logging costly messages (those with
expensive expressions)
QUESTIONS AND DETAILED SOLUTIONS
◉ Class naming conventions.
Answer: Use UpperCamelCase
Do not add _Ext to classes within customer package spaces
◉ Function naming conventions.
Answer: Use lowerCamelCase
Use a verb that describes that the function is doing i.e. verifyAddress
Do not add _Ext suffix to private functions or enhancements in
customer package spaces
◉ Variable naming conventions.
Answer: Member variable names use lowerCamelCase with a leading
underscore i.e. _pluginCallbackHandler
Local variable names use lowerCamelCase short names that describe
the purpose i.e. latestPolicyRevision
◉ Display key naming conventions.
Answer: Add suffix _Ext too all new display keys
Do not modify automatically generated display keys
,◉ Logging is.
Answer: The process of recording application actions and state to a
secondary interface
◉ Logging is used for.
Answer: Application maintenance and troubleshooting
Creating statistics relating to application usage
Auditing by capturing significant events
◉ Typical events to log are.
Answer: Success / Failure - a transaction or action has succeeded or
failed
Recovery - a system went down or connection failed, retried, and
recovered
Identification - any large functional areas such as integration, rating,
reinsurance, and rules
◉ Logging components - Logger.
Answer: has a category and level, sends content to an Appender
◉ Logging components - Appender.
Answer: is an output destination (server console or rolling file)
,◉ Logging components - Layout.
Answer: defines the format of the content sent to an appender
◉ Logging Level - Trace.
Answer: Description: Fine-grained informational events
When to use: Log method entry and exit
◉ Logging Level - Debug.
Answer: Description: Detailed informational events
When to use: Log important steps and calculations for diagnosing
problems
◉ Logging Level - Info.
Answer: Description: Coarse-grained informational messages of
progress
When to use: Log the occurrence or result of an important event
◉ Logging Level - Warn.
Answer: Description: Indicate a potential problem
When to use: The user experience has not been affected
, ◉ Logging Level - Error.
Answer: Description - Indicate definite problems
When to use: The user experience has been affected
◉ There are 2 ways to initialize a logger in Gosu.
Answer: Integration: PLLoggerCategory.INTEGRATION
Plugin: PLLoggerCategory.PLUGIN
Use sub-level of existing logging category to maintain structure.
Example: PLUGIN.MotorVehicleRecord
static var _motorVehiclePluginLogger =
LoggerFactory.getLogger(PLLoggerCategory.PLUGIN."MotorVehicleR
ecord")
◉ Logging Format should be.
Answer: a standard format to simplify analysis of large logs
◉ Guarded Logging should be used.
Answer: To test log level before logging costly messages (those with
expensive expressions)