GithubHelp home page GithubHelp logo

vuongwphamj / hotel-booking-ddd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fongx777/hotel-booking-ddd

0.0 1.0 0.0 250 KB

hotel booking app using ddd and clean architeucture to implement

JavaScript 0.34% TypeScript 88.66% Gherkin 11.00%

hotel-booking-ddd's Introduction

Hotel Booling DDD

Build Status

A hotel room booking app which is implemented under the principle of Domain-Driven Design. Also we used some tools such as user story mapping, specification by example, and event storming to help us model the domain.

Tools

Use case exploration:

  • User Story Mapping: build a big picture and general use cases
  • Specification by Example: for each user story, specification by example helps elaborate business logic
  • Event Stroming:

Development Methodology:

  • Test-Driven Design
  • Behavior-Driven Design
  • Domain-Driven Design

Development Framework and tools:

  • ExpressJS: nodeJS http framework
  • TypeScript: a typed superset of JavaScript that compiles to plain JavaScript
  • Jest: testing framework
  • CircleCI
  • ESlint

Methodology

Entity Pattern Rules

  1. all private properties
  2. public getters & private setters
  3. behavior-driven

(o) a.updateInfo(name, ..,,.., ...); (x) a.setXXX();

Why used props ?

it is just a simple way to avoid tons of this assignment

Design Notes

Controller and Persenters

http://www.plainionist.net/Implementing-Clean-Architecture-Controller-Presenter/ https://crosp.net/blog/software-architecture/clean-architecture-part-2-the-clean-architecture/

img

External Packages

At first, I put all external npm modules in src/booking/infrastructure/, and they all implemnt interfaces from src/booking/usecase/.

for example, if I want to use bcrypt packages, first I would declare an interface: src/booking/usecase/infrastructure/i-bcrypt, then create src/booking/infrastructure/bcrypt to implemnt the interface.

After that, I can injection the bcrypt dependency into usecase constructor to avoid violate the direction of dependency; however, it doesn't worth taking so much time for a single utiliy.

The advantage is obvious, but here are disadvantages:

  1. Hard to used by other bounded context.
  2. Too much work for a simple utility.
  3. Make constructor too complicated to use (more parameters)

Reference

hotel-booking-ddd's People

Contributors

fongx777 avatar hankle10 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.