6 Developing an application
This chapter covers
- Setting up a project
- Choosing the database driver and connecting to the database
- Translating recursive and pathfinding traversals into Java methods
- Processing traversal results within an application
In chapters 3, 4, and 5, we covered the process of writing traversals. But writing traversals is only part of what is required to create an application. Applications also require handling tasks, such as connecting to a database, managing user input, and processing the traversal results into a usable form. While the process for doing these is similar to how we work with relational databases, there are a few critical differences, so let’s find out how to approach these tasks when working with graph databases.
In this chapter, we’ll use the traversals we built in the earlier chapters to demonstrate the process for translating these into a console application written in Java. We’ll start by setting up our project, including selecting the proper graph database driver. Next, we’ll walk through how to connect to our graph database. Finally, we’ll show how to translate our Gremlin traversals into the equivalent Java code and process the results. By the end of this chapter, we’ll have a fully functioning application based on our DiningByFriends social network.