Julien Martin wrote:Let's suppose my Book objects are very large.
Aditya Jha wrote:@Pat Could you please describe how ISBN-as-key approach is better than Book-as-key in concrete terms?
Aditya Jha wrote:@Jesper Technically, does it really make a difference, assuming the whole of Book objects have to be kept in memory. What you described does hold true for databases from the point of view of normalization (or, reducing data redundancy). However, in terms of objects, having a heavy instance as key in a map shouldn't be making operations on that map any slower, I think. Introducing a BookInfo will only add resource usage.
Though, I agree it is a better OOD, and BookInfo might help in some other use-cases. Purely from this problem's perspective however, it will be an overkill, IMHO.
Don't get me started about those stupid light bulbs. |