Hello,
Are the instances of a class part of a collection of the class?
Element.ClassifierID in the instance matches the classifier's .ElementID, but there's no collection in Element that holds its instances.
But I do not understand why there is no collection.
If this was an actual design decision, rather than a simple omission, I suspect it's for performance reasons.
Pre-loading collections of elements from the database which might in many cases not be needed slows the API down. (If indeed collection contents are pre-loaded and not loaded on demand.)
/U
From my experience most collections are not preloaded.
Some don't even load completely when used. They load the objects when iterating. (you can see queries to the database when iterating a collection)
Especially this last one is a gotcha. We are using to think about collections as things that exist in memory, and that are cheap to iterate.
But some EA.Collections are really slow to iterate, as they have to load the objects details when doing a next.
So I learned myself to avoid EA.Collections as much as possible. The main thing is to get the ID's of what I need with an SQLQuery() and then get the objects using Repository.GetXXXByID
Doesn't work for everything, but it does speed up a lot of things.
Another thing is to never iterate an EA.Collection more than once.
If I have no choice but to iterate an EA.Collection (say I need the tagged values of a connector or something like that), and I'm going to need to iterate over it more then once, then I first put them in a regular collection such as a List<> (or ArrayList in vbscript)
Once that is done you can iterate the other collection as much as you want, without a performance penalty.
Geert