Unit 4 - Lesson 3 - Unique IDs Flashcards
Describe purpose of key sets
Curam unique IDs are drawn from repopulated, pseudorandom key sets.
Developers can use default key set or nominate a specific key set.
Process of choosing keys and replenishing key sets is covered in detail in the API documentation.
Key sets defined in Keyserver.dmx and loaded to the key server table.
Explain how to generate unique IDs using the model approach
Auto ID field in a model on INSERT operation.
Auto ID Key to specify key set.
Generate and return a unique ID using the programmatic approach
Create unique ID from general set of IDs:
UniqueID using UniqueIDFactory.
getNextID() method.
From specific set of IDs:
UniqueIDKeySet with keySetName attribute = “ACCOUNTED”.
getNextIDFromKeySet(uniqueIDKeySet) method.
Outline the factors that influence the key generation approach to use
Business requirement specific key set.
Is default ID generation is sufficient for your code?
Programmatic IDs give full control.
Auto - Generic solution, no extra code.
Auto - centralise the choice of key set, reducing chances of a key conflict.
Describe system-generated Unique IDs
User should not create primary Keys
Unique IDs can be generated in 2 ways:
* Auto ID field in a model on INSERT operation
* Programmatically
Unique IDs can be human readable or non-human readable.
Explain KeyServer.dmx
keySetCode - attribute acts as an identifier for the key set.
nextUniqueIdBlock - Setting higher number in production system may be useful - allows to skip number that might have already been used when migrating data from a legacy system.
humanReadable - attribute is set to True if the Unique IDs should be human-readable.