Posts

Showing posts from December, 2013

scalaz Validation, neo4j and for-comprehensions

The Problem I have an app that uses neo4j as the underlying database. Similar to all database applications, I also have a data access layer that helps abstract out the use of neo4j. The data access layer takes in string parameters, mostly, finds the neo4j nodes or relationships then manipulates the those objects to create a new object. In this access layer, I must gather several different objects together to process. For example, the start node, the end node, another node that holds my dynamic type system, and various other objects. When assembling these nodes, I typically find the pattern to go something like this: Check the input parameters Find the objects. This step typically takes an input parameter, then finds the object. Then use that object, in sequence, to find another object and so on. With all the objects assembled, create the new object The standard approach that I use for error handling is to throw as few exceptions as possible. Instead, I would rather ga