Facade Class
Facade class of DDD pattern.
- create instance of factories
- create instance of repositories
Item Index
Methods
- addClass
- create
- createFactory
- createInstance static
- createModel
- createPreferred
- createPreferredFactory
- createPreferredRepository
- createPreferredService
- createRepository
- createService
- deserialize
- error
- fullName
- getFacade deprecated
- getModel
- getModelProps
- getModule
- getPreferredNames
- hasClass
- insertFixtures
- isDomainError
- moduleName
- require
- serialize
Properties
- isRoot static
- latestInstance static
- master
Methods
addClass
-
modFullName
-
klass
add class to facade. the class is acquired by @require(modFullName)
Parameters:
-
modFullName
String -
klass
Function
Returns:
create
-
Class
Create instance of given Class.
Parameters:
-
Class
Function | Class
Returns:
createFactory
-
modFirstName
create a factory instance 2nd, 3rd, 4th ... arguments are the params to pass to the constructor of the factory
Parameters:
-
modFirstName
String
Returns:
createInstance
-
[options]
create instance of Facade
Parameters:
-
[options]
Object optional
Returns:
createModel
-
modFirstName
-
obj
-
[options]
-
[root]
create an instance of the given modFirstName using obj if obj is null or undefined, empty object will be created.
Parameters:
-
modFirstName
String -
obj
Object -
[options]
Object optional -
[root]
RootInterface optional
Returns:
createPreferred
-
modFirstName
-
type
-
[options]
-
[params]
-
root
create a preferred factory|repository|service instance
Parameters:
-
modFirstName
String -
type
Stringfactory|repository|service
-
[options]
Object optional -
[params]
Object optionalparams pass to constructor of Repository, Factory or Service
-
root
RootInterface
Returns:
createPreferredFactory
-
firstName
-
[options]
create a preferred factory instance 3rd, 4th ... arguments are the params to pass to the constructor of the factory
Parameters:
-
firstName
String -
[options]
Object optional-
[noParent=true]
Object optionalif true, stop requiring parent class
-
Returns:
createPreferredRepository
-
firstName
-
[options]
create a preferred repository instance 3rd, 4th ... arguments are the params to pass to the constructor of the repository
Parameters:
-
firstName
String -
[options]
Object optional-
[noParent]
Object optionalif true, stop requiring parent class
-
Returns:
createPreferredService
-
firstName
-
[options]
create a preferred service instance 2nd, 3rd, 4th ... arguments are the params to pass to the constructor of the factory
Parameters:
-
firstName
String -
[options]
Object optional-
[noParent=true]
Object optionalif true, stop requiring parent class
-
Returns:
createRepository
-
modFirstName
create a repository instance 2nd, 3rd, 4th ... arguments are the params to pass to the constructor of the repository
Parameters:
-
modFirstName
String
Returns:
createService
-
modFirstName
create a service instance 2nd, 3rd, 4th ... arguments are the params to pass to the constructor of the service
Parameters:
-
modFirstName
String
Returns:
deserialize
-
str
Deserializes serialized string
Parameters:
-
str
String
Returns:
error
-
reason
-
[message]
create instance of DomainError
Parameters:
-
reason
Stringreason of the error
-
[message]
String optional
Returns:
fullName
-
modFullName
get fullName from modFullName
Parameters:
-
modFullName
String
Returns:
getModel
-
firstName
get a model class
Parameters:
-
firstName
String
Returns:
getModelProps
-
modFullName
Get ModelProps by firstName. ModelProps summarizes properties of this class
Parameters:
-
modFullName
String
Returns:
getPreferredNames
-
modFirstName
-
type
Parameters:
-
modFirstName
String -
type
Stringrepository|factory|service
Returns:
modFullName
hasClass
-
modFullName
check existence of the class of the given name
Parameters:
-
modFullName
String
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 firstNames to insert. default: all models
-
Returns:
inserted data
isDomainError
-
e
check if given object is instance of DomainError
Parameters:
-
e
Error
Returns:
moduleName
-
modFullName
get moduleName from modFullName
Parameters:
-
modFullName
String
Returns:
require
-
modFullName
read a file and returns class
Parameters:
-
modFullName
String
Returns:
serialize
-
val
Serialize the given object containing model information
Parameters:
-
val
Any
Returns:
Properties
isRoot
Boolean
static
is root (to identify RootInterface)
latestInstance
Facade
static
Latest instance created via @createInstance() This instance will be attached base instances with no @root property.
master
MasterDataResource
instance of MasterDataResource Exist only when "master" property is given to Facade's option