Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
/ node-vie-knex Public archive

Library for Node.js to implement the VIE pattern with Knex.

Notifications You must be signed in to change notification settings

CGamesPlay/node-vie-knex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VIE - Viewer, Interactor, Entity

VIE is a design pattern for separating your data access and application logic layers. VIE fits into the traditional MVC (Model, View, Controller) pattern, by specifying how the Models should be designed. VIE does not specify how your Controllers or Views should be designed, so the developer is free to use whatever design pattern they prefer for those aspects of the system.

Core Concepts

The three components of VIE are the Viewer, Interactors, and Entities.

Entities are the basic building blocks for the application logic. An entity class typically represents a single table in a database, similar to Models in MVC. In VIE, however, the Entities are only responsible for locating and reading the records. Entities are fundamentally read-only structures and do not control modifying the underlying data source.

Interactors are methods responsible for mutating the underlying data source and may also be used to organize an otherwise complex query. The interactor is responsible for managing the access control for the mutation.

The Viewer is the owner of the underlying data source connection and is responsible for providing that connection to Entities and Interactors. The Viewer also provides authentication information to these so that they may enforce access controls as desired.

Knex implementation

This package provides a Knex implementation of the VIE pattern. See the example folder for a walkthrough of the usage and the docs folder for detailed documentation.

About

Library for Node.js to implement the VIE pattern with Knex.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published