Most of the examples we have developed so far have created HazelcastInstance
that we use to programmatically access various collections and features of the cluster. However as we begin to move away from simple conceptual examples, we will need to start passing references to various collections around our application in order to access data. This exposes the age-old problem of how to avoid passing around supporting dependencies around the application layers, but still having access to them, when and where they are required. Luckily this problem has already been solved for us in the form of dependency injection. Rather than reinventing the wheel, we should be able to use the existing technology to help solve this problem.
One of the most popular DI frameworks is Spring, and Hazelcast features complimentary support for this framework allowing us to configure our cluster in a way in keeping with it. To enable this support we need to add the hazelcast-spring...