Best Practices Questions and Certified Answers
What are the lesson categories in the Best Practices course? - Answer General coding
Early problem detection
Cloud specific
What are some of the benefits of having best practices and standards? - Answer Best practices and
standards:
- Produce standardized solutions
- Ensure stability and integrity of custom code
- Improve performance
- Reduce rework and wasted effort
- Save on maintenance
- Promote security
- Facilitate upgrades
Indicate whether this is a best practice, standard, or both:
Provides informal rules and recommendations. - Answer Best practice.
Indicate whether this is a best practice, standard, or both:
Promotes quality, efficiency, consistency. - Answer Both.
Indicate whether this is a best practice, standard, or both:
Written so that compliance can be independently determined. - Answer Standard.
Indicate whether this is a best practice, standard, or both:
Helps improve the quality of the software. - Answer Both
, What are the reasons to avoid using the com.guidewire.* classes, which are internal? - Answer - Internal
classes may be removed or modified in future versions
What should be done if internal classes (com.guidewire.*) are used? - Answer - Development team
should be made aware of their usage
- Support team can expose the package or find a substitute in a public package
When referencing typecode values in conditional statements, what is a standard to follow? - Answer
Always use the static properties on the typelist class to reference typecode values. Avoid using a string
representation of the typecode value.
if (claim.LossCause == LossCause.TC_REAREND) {
//some code
}
When writing a conditional with logical operators, should they be represented with text or symbol
formats? - Answer They should be represented with text formats because it produces clean code that is
easy to read.
Use "and" instead of &&, "or" instead of ||, and "not" instead of !
Where should code required to support screen operations be placed? - Answer In a UI helper class.
Avoid placing Gosu code directly in the code section of a PCF because it is easily overlooked.
What is an exception to the best practice regarding placing logic to a PCF file in a UI helper class? -
Answer If there is a small amount of code that is specific to the PCF, such as code that initializes a local
variable or entity type.
Why should you avoid extending entity enhancements to support UI operations? - Answer They are
meant for logic that extends a domain object.
UI code pollutes the interface of a domain object with logic useful to a small set of PCF files.