thenativeweb / node-cqrs-domain

Node-cqrs-domain is a node.js module based on nodeEventStore that. It can be very useful as domain component if you work with (d)ddd, cqrs, eventdenormalizer, host, etc.
http://cqrs.js.org/pages/domain.html
MIT License
269 stars 57 forks source link

Merge commandHandlers to single file #8

Closed bkak closed 11 years ago

bkak commented 11 years ago

Is there a way to merge these command handlers :

SalesCommandHandler.js module.exports = commandHandlerBase.extend({ aggregate: 'SalesAggregate', commands: ['CreateSale', 'UpdateSale', 'DeleteSale' ] });

JournalCommandHandler.js module.exports = commandHandlerBase.extend({ aggregate: 'JournalAggregate', commands: ['CreateJournal'] });

Can I merge them into single file?

adrai commented 11 years ago

No, but why do you want to do this?

bkak commented 11 years ago

Since the pattern of these files is similar, I was thinking of code generating them.

adrai commented 11 years ago

As long as the command handlers are just beginning is true, but passing the time the files become larger and more individual... you will see ;-)

bkak commented 11 years ago

Oh ya ok I get it.