Injecting collections as constructor dependencies
We are using constructor dependency injection in our application. Following that approach we inject everything using an injection container so we are able to replace any dependency with a Mock.
Injecting collections as constructor dependencies
We are using constructor dependency injection in our application. Following that approach we inject everything using an injection container so we are able to replace any dependency with a Mock.
Java: why do collections accept a Comparator but not (a hypothetical) Hasher and Equator?
This issue is most apparent when you have different implementations of an interface, and for the purposes of a particular collection you only care about the interface-level view of the objects. For example, suppose you had an interface like this:
HashMap to replace Singletons?
Consider the following: I have controllers and views in a client-application. As this runs purely on the client side, each controller must only exist once.
Do we always need to override equals/hashcode when creating a new class?
When creating a new class, should we always override the equals
and hashCode
even if we don’t intent at that point to use the class with any Collection classes?
Or is it better to wait till such a need arises before overriding equals
and hashCode
so as to be sure on what the logical equality should be?
managing multiple fails in a flow
I would like to differntiate between 2 distinct tests in an if function in a flow.