Is throwing an error in unpredictable subclass-specific circumstances a violation of LSP?
Let’s say I wanted to create a Java List<String>
(see spec) implementation that uses a complex subsystem, such as a database or file system, for its store so that it acts as a persistent collection rather than an in-memory one.
Should I return Collection or ImmutableCollection from a method?
When writing an API in Java, returning an immutable collection of some sort, I’ve got the option of returning Collection
(or List
, Map
, etc) from the method, or guava’s ImmutableCollection
(or ImmutableList
, ImmutableMap
, etc):
Should I return Collection or ImmutableCollection from a method?
When writing an API in Java, returning an immutable collection of some sort, I’ve got the option of returning Collection
(or List
, Map
, etc) from the method, or guava’s ImmutableCollection
(or ImmutableList
, ImmutableMap
, etc):
Should I return Collection or ImmutableCollection from a method?
When writing an API in Java, returning an immutable collection of some sort, I’ve got the option of returning Collection
(or List
, Map
, etc) from the method, or guava’s ImmutableCollection
(or ImmutableList
, ImmutableMap
, etc):
Is it a good practice to wrap collection in Java? [closed]
Closed 10 years ago.
Collection vs data structure vs aggregate
I know three terms that have to do with storing objects or data. I’m not sure I understand the exact differences between the terms. Please confirm if what I’m about to write is accurate.
Collection vs data structure vs aggregate
I know three terms that have to do with storing objects or data. I’m not sure I understand the exact differences between the terms. Please confirm if what I’m about to write is accurate.
Empty superclass for Collection of derived classes
Basically, what I would like to obtain is a way to iterate through ONE list, and call methods specific to the interface the objects in the collection implement.
“Collection Wrapper” pattern – is this common?
A different question of mine had to do with encapsulating member data structures inside classes. In order to understand this question better please read that question and look at the approach discussed.
“Collection Wrapper” pattern – is this common?
A different question of mine had to do with encapsulating member data structures inside classes. In order to understand this question better please read that question and look at the approach discussed.