Ticket #496 (closed clarification: invalid)

Opened 1 year ago

Last modified 7 months ago

Use of set vs. list in Aggregation.java. In general do we create a best practice document for modelling?

Reported by: amit Assigned to: amit
Priority: high Milestone:
Component: information-model Version: 0.8
Keywords: information-model Cc:
Blocking: Blocked By:

Description

With the different number of folks making changes to the content model, it would be nice to have a rough best practice document to set some type of guidelines to help make the decision faster and consistent. Please note the internal translation, once this is created, you better have a very good reason for not following it...:)

Dependency Graph

Change History

07/20/07 10:16:35 changed by amit

  • milestone changed from Bugs to 0.9.

07/20/07 12:01:45 changed by ronald

From a pure modelling perspective, if your collection is of type Predicate then it makes sense to use a Set, though the items really have implement hashCode() and equals() to properly match the RDF equality being used for this to make correct sense.

The collection types RdfBag and RdfAlt are best modelled by Collection, with the concrete instantiations using a List subclass (since they can contain duplicates).

For the other collection types (RdfSeq and RdfList) the field must be an array or a List.

In addition to the above mentioned constraints on items imposed by Set's, Set's also have the advantage or disadvantage (depending on your use cases) of effectively causing an eager load of all the items in the Set - this is because when put an item into a Set the Set must at the very least invoke equals() on the item to ensure uniqueness, and that invocation will cause OTM to load the item.

09/02/07 22:41:40 changed by

  • milestone deleted.

Milestone 0.9 deleted

06/19/08 16:00:49 changed by amit

  • status changed from new to closed.
  • resolution set to invalid.
  • blocking changed.
  • blockedby changed.

Really need to get rid of these tickets or create new ones with tighter focus.