|
| 1 | +Domain-driven design in JavaScript Sample Code |
| 2 | +============================================== |
| 3 | + |
| 4 | +Sample code for the Domain-driven design in JavaScript book. The code samples |
| 5 | +and additional resources are organized by chapter and example. |
| 6 | + |
| 7 | +Chapter 1 |
| 8 | +--------- |
| 9 | +- [Express |
| 10 | + App](https://github.com/sideshowcoder/ddd-js-sample-code/tree/master/chapter_1) |
| 11 | + from chapter 1. |
| 12 | + |
| 13 | +Chapter 2 |
| 14 | +--------- |
| 15 | +No sample code in this chapter. |
| 16 | + |
| 17 | +Chapter 3 |
| 18 | +--------- |
| 19 | +- [Underscore](https://github.com/jashkenas/underscore) Source code is available |
| 20 | + on Github. |
| 21 | +- [Prisoner |
| 22 | + Transfer](https://github.com/sideshowcoder/ddd-js-sample-code/tree/master/chapter_3) |
| 23 | + prisoner transfer module, including the basic layout for the tests, and |
| 24 | + features runnable. |
| 25 | + |
| 26 | +Chapter 4 |
| 27 | +--------- |
| 28 | +- Weapons: Example how aggregation of weapons could work, calling deep inside |
| 29 | + objects, which is most likely a bad idea. `node weapons/weapons.js` |
| 30 | +- Composition and Inheritance: See the appropriate subfolder. |
| 31 | +- Domain Objects: See chapter 3 prisoner transfer. |
| 32 | +- My Mock: Example mock, built using a simple object, run via `node |
| 33 | + my_mock/my_mock.js` |
| 34 | +- Simple Object: Battle Orc `node simple_objects/battle_orc.js` Orc `node |
| 35 | + simple_objects/orc.js` |
| 36 | +- Sinon Example: Example usage `sinon` for mocking, run via `npm install` to |
| 37 | + install dependencies, and `npm test`. |
| 38 | + |
| 39 | +Chapter 5 |
| 40 | +--------- |
| 41 | +- ExaggeratingOrc `exaggerating_orc.js`, shows working with private and public |
| 42 | + methods |
| 43 | +- not a value object `not_value_objects.js`, show how objects can be modified |
| 44 | +- Value object example based on coins, `coin.js` |
| 45 | +- Using value objects in wallet `wallet.js` |
| 46 | +- Events `event.js` |
| 47 | +- Orcs repository `orcs.js` |
| 48 | +- Alternative active record style getting orcs `orcs_ar.js` |
| 49 | +- Sending letter via a postman `postman.js` |
| 50 | + |
| 51 | +Chapter 6 |
| 52 | +--------- |
| 53 | +- sample notifier `npm install` to load the dependencies and `npm run notifier` |
| 54 | + to run the code is in `notifier.js` |
| 55 | + |
| 56 | +Chapter 7 |
| 57 | +--------- |
| 58 | +- sample math `node math.js` |
| 59 | +- using array functions to process `node transport_time.js` |
| 60 | +- loggable example `node oo_orc.js` |
| 61 | +- state in basic objects example `node thing.js` |
| 62 | +- events `node events.js` |
| 63 | +- jumping counter managing state `node counter.js` |
| 64 | + |
| 65 | +Chapter 8 |
| 66 | +--------- |
| 67 | +- pjax-example: run `npm install` in the `chapter_8/pjax-example` folder and run |
| 68 | + `npm start` to try it out. |
| 69 | +- ember-example: run `npm install` in the `chapter_8/ember-example` folder and run |
| 70 | + `npm start` to try it out. |
| 71 | +- `deactivate_button.html` jquery example deativating a button inline, to try it |
| 72 | + simply open in a browser. |
| 73 | +- car configuration example to work with constraints and logic `node |
| 74 | + car_configurator.js` |
0 commit comments