Facade Class
Facade class of DDD pattern.
- create instance of factories
- create instance of repositories
Item Index
Methods
addClass
-
name -
klass -
skipNameValidation
add copied class to facade. the class is acquired by @require(name)
attaches getFacade() method (for both class and instance)
Parameters:
-
nameString -
klassFunction -
skipNameValidationBooleanvalidate class name is compatible with the name to register
Returns:
create
-
name -
[options]
read a file and returns the instance of the file's class
Parameters:
-
nameString -
[options]Object optional
Returns:
createFactory
-
name -
[useAnonymousWhenFailed=false]
create a factory instance
Parameters:
-
nameString -
[useAnonymousWhenFailed=false]Boolean optional
Returns:
createInstance
-
[options]
create instance of Facade
Parameters:
-
[options]Object optional
Returns:
createRepository
-
name -
[options]
create a repository instance
Parameters:
-
nameString -
[options]Object optional
Returns:
error
-
reason -
[message]
create instance of DomainError
Parameters:
-
reasonStringreason of the error
-
[message]String optional
Returns:
getFactory
-
name -
[useAnonymousWhenFailed=false]
get a factory class
ISSUE: user will never know load failure
Parameters:
-
nameString -
[useAnonymousWhenFailed=false]Boolean optional
Returns:
getModel
-
name
get a model class
Parameters:
-
nameString
Returns:
getRepository
-
name
get a repository class
Parameters:
-
nameString
Returns:
hasClass
-
name
check existence of the class of the given name
Parameters:
-
nameString
Returns:
insertFixtures
-
[options]
insert fixture data (Node.js only)
Parameters:
-
[options]Object optional-
[dataDir='./data']String optionaldirectory to have fixture data files
-
[tsvDir='./tsv']String optionaldirectory to have TSV files
-
[models=null]Array(String) optionalmodel names to insert. default: all models
-
Returns:
dataPool inserted data
isBaseClass
-
klass
check the given class is registered in facade
Parameters:
-
klassFunction
Returns:
isDomainError
-
e
check if given object is instance of DomainError
Parameters:
-
eError
Returns:
loadMasterTables
()
Promise
load master tables
Returns:
registerBaseClass
-
klass
registers the given class as a base class
Parameters:
-
klassFunction
require
-
name
read a file and returns class
Parameters:
-
nameString
