base-domain
Version:
simple module to help build Domain-Driven Design
118 lines (90 loc) • 3.05 kB
text/coffeescript
'use strict'
###*
interface of Aggregate Root
Followings are the meanings of argument name of files in detail.
Let's see difference with two file examples.
- A: core/post-submission-service
- B: server/diary-factory
- firstName: A => post-submission, B => diary
- fullName: A => post-submission-service, B => diary-factory
- modFirstName: A => core/post-submission | post-submission, B => server/diary
- modFullName: A => core/post-submission-service, | post-submission-service, B => server/diary-factory
"mod" requires module name except "core" module, which can be omitted
RootInterface
base-domain
###
class RootInterface
# this file is just a concept and no implementation here.
###*
is root (to identify RootInterface)
{Boolean} isRoot
###
###*
create a factory instance
2nd, 3rd, 4th ... arguments are the params to pass to the constructor of the factory
createFactory
{String} modFirstName
{BaseFactory}
###
###*
create a repository instance
2nd, 3rd, 4th ... arguments are the params to pass to the constructor of the repository
createRepository
{String} modFirstName
{BaseRepository}
###
###*
create a service instance
2nd, 3rd, 4th ... arguments are the params to pass to the constructor of the service
createService
{String} name
{BaseRepository}
###
###*
get facade
getFacade
{Facade}
###
###*
get module the class belongs to
getModule
{BaseModule}
###
###*
create an instance of the given modFirstName using obj
if obj is null or undefined, empty object will be created.
createModel
{String} modFirstName
{Object} obj
{Object} [options]
{BaseModel}
###
###*
create a preferred repository instance
3rd, 4th ... arguments are the params to pass to the constructor of the repository
createPreferredRepository
{String} firstName
{Object} [options]
{Object} [options.noParent] if true, stop requiring parent class
{BaseRepository}
###
###*
create a preferred factory instance
3rd, 4th ... arguments are the params to pass to the constructor of the factory
createPreferredFactory
{String} firstName
{Object} [options]
{Object} [options.noParent=true] if true, stop requiring parent class
{BaseFactory}
###
###*
create a preferred service instance
3rd, 4th ... arguments are the params to pass to the constructor of the factory
createPreferredService
{String} firstName
{Object} [options]
{Object} [options.noParent=true] if true, stop requiring parent class
{BaseService}
###
module.exports = RootInterface