OCLOperators dictionary
No edit summary
(Updated Edited template to July 12, 2025.)
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<message>Write the content here to display this box</message>
  dictionary(loopvar| ExpressionForKeyDefinition ,  ExpressionForLookUpInDictionary )
  dictionary(loopvar| ExpressionForKeyDefinition ,  ExpressionForLookUpInDictionary )
ACollectionOf1000->collect(ac1| SomeSecondaryCollectionOf1000->dictionary(ss2|ss2.Name,ac1.Name)->first.HomeAddress:=ac1.DeliveryAddress)
When you need to iterate over two lists to match on some common attribute, a dictionary will greatly reduce the work performed by the CPU if the list is read more than written.
When you need to iterate over two lists to match on some common attribute, a dictionary will greatly reduce the work performed by the CPU if the list is read more than written.
# Dictionaries in OCL use a hash table implementation, which means that it can provide fast lookups of objects based on a value. This is because the hash function can map the key to a unique index in the table, allowing for constant-time access to the value associated with that key.
# Dictionaries in OCL use a hash table implementation, which means that they can provide fast lookups of objects based on a value. This is because the hash function can map the key to a unique index in the table, allowing for constant-time access to the value associated with that key.
# A dictionary helps to reduce the time of searching for a particular value in a collection. Instead of searching through the entire collection, the dictionary can perform a hash lookup to quickly locate the desired value.
# A dictionary helps reduce the time of searching for a particular value in a collection. Instead of searching through the entire collection, the dictionary can perform a hash lookup to quickly locate the desired value.
Overall, using a dictionary in OCL can improve performance by providing fast lookup and efficient searching.
Overall, using a dictionary in OCL can improve performance by providing fast lookup and efficient searching.


Line 8: Line 11:
<iframe width="560" height="315" src="https://www.youtube.com/embed/2ppGlbzC80A" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/2ppGlbzC80A" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</html>
</html>
[[Category:OCLOperators]]
[[Category:OCL Collection Operators]]
{{Edited|July|12|2025}}

Latest revision as of 05:57, 20 January 2025

This page was created by Hans.karlsen@mdriven.net on 2018-12-02. Last edited by Edgar on 2025-01-20.
dictionary(loopvar| ExpressionForKeyDefinition ,  ExpressionForLookUpInDictionary )
ACollectionOf1000->collect(ac1| SomeSecondaryCollectionOf1000->dictionary(ss2|ss2.Name,ac1.Name)->first.HomeAddress:=ac1.DeliveryAddress)

When you need to iterate over two lists to match on some common attribute, a dictionary will greatly reduce the work performed by the CPU if the list is read more than written.

  1. Dictionaries in OCL use a hash table implementation, which means that they can provide fast lookups of objects based on a value. This is because the hash function can map the key to a unique index in the table, allowing for constant-time access to the value associated with that key.
  2. A dictionary helps reduce the time of searching for a particular value in a collection. Instead of searching through the entire collection, the dictionary can perform a hash lookup to quickly locate the desired value.

Overall, using a dictionary in OCL can improve performance by providing fast lookup and efficient searching.