# Somewhere on client
Space.messaging.Api.call MyCommand
class @MyApi extends Space.messaging.Api
@method MyCommand, (context, command) ->
@commandBus.send command
class @MyAggregateHandler extends Space.messaging.Controller
Dependencies:
repository: ‘Space.cqrs.Repository’
...
@handle MyCommand, (command) ->
aggregate = @repository.find MyAggregate, command.aggregateId
aggregate.doSomething(command)
@repository.save aggregate
space-cqrs
is not a good fit for the ORM based orionjs solution anyway. But we sparked the idea of building a good example application that shows the concepts and benefits of DDD / CQRS with space-cqrs
orders
and payments
) that could be dropped into your application and configured. This would provide great examples of how to model a self-contained bounded context and possibly draw more attention to space (get more devs on board).
orders
and payments
BCs: https://github.com/SpaceJs/cqrs-shop-example
package.js
is programmable in Meteor we can use environment vars to include only those value objects that are needed by modules / apps.
environment.example.sh
to environment.sh
. Then run the app via the ./run.sh
shell script.
environment.sh
file :-)