cureapp / base-domain Goto Github PK
View Code? Open in Web Editor NEWsimple module to help build Domain-Driven Design
License: MIT License
simple module to help build Domain-Driven Design
License: MIT License
module
is a set of domain models, factories, repositories and services, all of which have something in common (works in the same environment, support a specific feature, and so on...)
The structure of the module directories are the same as that of core module.
domain = Facade.createInstance
dirname: '/path/to/core-module'
modules:
foo: '/path/to/module1'
bar: '/path/to/module2'
service = domain.createService('foo/xxxx') # foo is the module name
or
service = domain.getModule('foo').createService('xxxx')
domain = Facade.createInstance
dirname: '/path/to/core-module'
modules:
foo: '/path/to/module1'
bar: '/path/to/module2'
preferred:
module: 'foo'
with prefix
,
domain.createPreferredFactory(name)
domain.createPreferredRepository(name)
domain.createPreferredService(name)
these code choose 'foo/' + name if the file exists.
Fallback will be calmly done If the file doesn't exist.
sorry, mistakenly added :o
e.g.
PatientList should be created not by PatientListFactory,
but PatientFactory
patientFactory.createList()
(aproximately deelEqual)
base-domain/src/lib/util.coffee
Line 67 in 9bfd749
This check seems always returning false in titanium/Android environment.
Maybe the relationship between the resource path and the script path is different from titanium/iPhone architecture.
create their files.
https://github.com/CureApp/base-domain/blob/master/src/lib/base-repository.coffee#L83
In "upserting" process, we hardly know the given data is new in data resource.
debug()
is not a function in non-debug mode...
Do not depend on class names, which are mangled by uglifyjs
column name 'disabled' is just an idea.
modelA = new Foo()
sub = new SubFoo(id: 'abc')
modelA.set('sub', sub)
modelA.subId # abc
modelA.sub.Id # abc
modelB = new Foo()
modelB.subId = 'xyz'
modelA.inherit(modelB)
modelA.subId # xyz
modelA.sub.Id # abc
@TYPES
の中で引数を取れるものの仕組み (特にどういう引き数を取るとどうなるなど) をまとめて欲しいです。
すでにどこかにまとまってたらすみません。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.