Database Reference
In-Depth Information
Listing 7-13. The RegisterServices method in NinjectWebCommon.cs
namespace PracticalNeo4j_DotNet.App_Start
{
public static class NinjectWebCommon
{
...
//other methods
...
private static void RegisterServices(IKernel kernel)
{
kernel.Load <Neo4jModule>();
}
}
}
Controller and Service Layers
All of the controllers in the sample application extend a parent controller called GraphStoryController . The
GraphStoryController provides access to the GraphStory class and the GraphStoryInterface service. The
SecurityController provides a login check on the application as well as providing the string value of the username that
is currently logged into the application via the cookie called graphstoryUserAuthKey .
The GraphStory object encapsulates the domain objects for the sample application and is primarily used for
convenience. This object allows domain objects to be sent to the service layer and returned, in some cases, with
additional objects and properties.
The GraphStoryInterface service provides access to each of the individual service interfaces that support
persistence and other service-level operations on each of the domain objects. For example, if an exception is raised
in the service layer, such as when attempting to create a User that matches an existing User's username, then the
GraphStory object can be returned with message information, such as an error message, which can then be used to
determine the next part of the application flow as well as return messages to the view.
Social Graph Model
This section explores the social graph model and a few of the operations that typically accompany the use of that type
of model. In particular, this section looks at the following:
The User Entity
Sign-up and Login
Updating a user
Creating a relationship type through a user by following other users
Managing user content, such as displaying, adding, updating, and removing status updates
 
Search WWH ::




Custom Search