Book Image

Getting Started with Hazelcast, Second Edition

By : Matthew Johns
Book Image

Getting Started with Hazelcast, Second Edition

By: Matthew Johns

Overview of this book

Table of Contents (19 chapters)
Getting Started with Hazelcast Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Don't pass what you need, depend on it


Most of the examples that 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 poses the age-old problem of how to avoid passing around the supporting dependencies of the application layers but still having access to them, when and where 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 this existing technology to help solve this problem.

One of the most popular application frameworks providing DI is Spring, and Hazelcast features provide complimentary support for this framework, allowing us to configure our cluster as part of the standard Spring application context. To enable...