简体   繁体   中英

When to use gosu enhancements?

I've seen the usage of gosu enhancements a lot within Guidewire application. However, it seems to me it is being overused. Like the following examples:

  • An entity querying another entity (ie looks to me an entity modeling problem) .
  • An entity calling a webservice (ie its beyond the purpose of the entity) .

Are there any recommended use cases when to use enhancements?

The recommended approach is that enhancements should be used to extend existing classes with new methods or properties closely related to the original class object.

I agree that enhancements seem to be overused, that is probably because its the easy way to add some logic in existing (OOTB) parts of the Guidewire system.

Your observations are totally valid. Enhancements should preferably be used for simple calculations where a permanent data model change is not required. Webservice calls and complex queries are recipes for performance issues when used inside an enhancement.

Enhancements can be used for standard getter/setter operations that could be obtained in a relatively straightforward calculation.

Yes, Enhancements are supposed to be used only for straight forward calculations which the business does not want to store in Database tables. Instead of using the enhancements, I think its better to have a helper Gosu class Where we shall execute the complex queries and some logical calculations.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM