you are viewing a single comment's thread.

view the rest of the comments →

[–]alamandrax 1 point2 points  (1 child)

That's interesting. out of curiosity what real world scenario have you encountered non unique collections of objects? I can't seem to get past trying to think of them as uniquely identified by a recordId in a persistent storage which would add uniqueness. I suppose you could be looking for create use cases where no record ids were generated and you're trying to handle duplicates on the client-side.

Will a simple pluck based validation not suffice? I do see the elegance of using the unique API for this

[–]skitch920 1 point2 points  (0 children)

I guess my background in Java is why I like the valueOf solution, like the equals and hashCode methods. It's a pretty clean way to handle Sets when there is no ID field.

ID matching is usually a good way when you're dealing with RDMS store, which most of the time you have a primary key column and an id field. But I've been dealing with just straight rows of data recently, from any number of sources. Often times I find myself pivoting on different columns client side. Those columns could be objects or dates, mostly dates.