Custom coding - SmartPlant Foundation - IM Update 48 - Help - Hexagon

SmartPlant Foundation Help

Language
English
Product
SmartPlant Foundation
Search by Category
Help
SmartPlant Foundation / SDx Version
10
SmartPlant Markup Plus Version
10.0 (2019)
Smart Review Version
2020 (15.0)

The two most time consuming items for code are retrieving data from the database to the server, and retrieving data from the server to the client.

The following list describes ways to minimize the impact to code:

  • Is there heavy load on a client? If so, could this be on the server?

    Consider carefully where custom code is written; versions 4.x and later provides a rich customization layer on the server.

  • Is the customization requiring multiple trips to the server for minimal data? If so, could you reduce the trips or go only once to get all the data using a new API? Relationship expansion in client code potentially goes to the server as well, if not previously cached.

  • If many individual relationship expansions are being done on the server, it is far more efficient to gather all the objects needed to expand, and bulk expand the relationship (relationship expansion from a collection). Subsequent code can then use the cached data.

With the following line of code, any subsequent expansions of this relationship from a revision scheme in this collection do not have to go to the database.

lcolRevSchemes.GetEnd1Relationships.GetRels("SPFRevisionSchemeConfigurationItem").GetEnd2s()

The main point for performance in code is to move data as little as possible and in the fewest possible transactions.