-
Notifications
You must be signed in to change notification settings - Fork 9
Description
It can be important that properties be translated in a particular order, particularly when dealing with the translation cache.
This example comes from a client project:
- An application domain object refers to an insurance application.
- These applications can be grouped together, and when they are, the application contains a reference to the group.
- The group contains references to all of the applications within that group, and they're stored in a map structure indexed by the primary id of the application.
When you translate an application that belongs to a group, you start translating an application, "A", which refers to group "G". When translating the map containing "G"'s members, a reference back to "A" will result in a hit on the translation cache. However, A's primary key may not have been translated, and if the translation results in reindexing the map, A's lack of a primary key could cause the translated map to have a null key.
This specific scenario could be resolved by informing Moo that you would like it to translate the application's id before it translates the application's group. Unfortunately, there is no way to indicate desired ordering or bump the priority of a particular property, which means that this scenario must be avoided, or corrected after the translation is complete.