UNPKG

locustjs-locator

Version:

A locustjs library implementing Service Locator pattern to provide loose coupling through IoC (Inversion of Control).

27 lines (25 loc) 735 B
const { throwIfInstantiateAbstract, throwNotImplementedException } = require('locustjs-exception'); class ColorServiceBase { constructor() { throwIfInstantiateAbstract(ColorServiceBase, this) } getById(id) { throwNotImplementedException('getById()') } getByName(name) { throwNotImplementedException('getByName()') } getAll() { throwNotImplementedException('getAll()') } save(color) { throwNotImplementedException('save()') } deleteById(id) { throwNotImplementedException('deleteById()') } deleteByName(name) { throwNotImplementedException('deleteByName()') } } module.exports = ColorServiceBase;