M
mparish
Guest
Collection operators are very different from integer operators. Collection operators work on set of objects, each of which may have many attributes. Integer operators work on single attributes. However there are some operators (such as +, +=, - and -=) that can be used with collections and with integers but their behavior is different. For example Assuming total and discount are integer attributes: Customer.total-=Customer.discount subtracts the value of discount from the value of total This is a shorter way of writing Customer.total=Customer.total-Customer.discount In contrast, when you are working with collections, the same operators add or remove instances from collections. customers+=Customer.new would create a new instance of Customer and add it to the collection alias named collections. Take a look at this articles for a more complete example: https://dmcommunity.files.wordpress.com/2015/09/collections-of-cars-corticon.pdf https://dmcommunity.files.wordpress.com/2015/08/duplicates-corticon.pdf https://dmcommunity.files.wordpress.com/2016/11/passenger-rebooking-decision-modeling-challenge-corticon.pdf https://community.progress.com/community_groups/corticon/m/documents/1386 When you use collections there are some very powerful operators available to you: Also take a look at the Corticon documentation which describes collections
Continue reading...
Continue reading...