JavaScript Domain-Driven Design

Book description

Speed up your application development by leveraging the patterns of domain-driven design

In Detail

JavaScript backs some of the most advanced applications. It is time to adapt modern software development practices from JavaScript to model complex business needs.

JavaScript Domain-Driven Design allows you to leverage your JavaScript skills to create advanced applications. You'll start with learning domain-driven concepts and working with UML diagrams. You'll follow this up with how to set up your projects and utilize the TDD tools. Different objects and prototypes will help you create model for your business process and see how DDD develops common language for developers and domain experts. Context map will help you manage interactions in a system. By the end of the book, you will learn to use other design patterns such as DSLs to extend DDD with object-oriented design base, and then get an insight into how to select the right scenarios to implement DDD.

What You Will Learn

  • Make communication with businesses more productive by identifying your requirements
  • Analyze a project to build the right features at the right time
  • Test the vital parts of your project by implementing test-driven design
  • Create application prototypes and utilize UML to enhance developer productivity
  • Explore effective means of communicating with non-developers to find out more about their requirements
  • Discover how to create manageable applications in JavaScript from scratch
  • Learn to quickly build advanced JavaScript applications

Table of contents

  1. JavaScript Domain-Driven Design
    1. Table of Contents
    2. JavaScript Domain-Driven Design
    3. Credits
    4. About the Author
    5. About the Reviewers
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
        3. Instant updates on new Packt books
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. A Typical JavaScript Project
      1. The core idea of domain-driven design
      2. Managing an orc dungeon
        1. Inside the dungeon
          1. Managing incoming prisoners
          2. The current state of the art
          3. Digital dungeon management
        2. Specification
          1. Tracking available cells
          2. Starting outgoing transfers
          3. Tracking the state of incoming transfers
          4. Initiating incoming transfers
      3. From greenfield to application
        1. The first route and model
          1. Creating the model
          2. The first route and loading the dungeon
          3. Displaying the page
          4. Gluing the application together via express
        2. Moving the application forward
      4. Another look at the problem
        1. Thinking in an MVC web application
        2. Understanding the core problem
        3. Communication is key
      5. The concepts of domain-driven design
        1. It is all about distractions
        2. Focus on the problem at hand
      6. Further reading
      7. Summary
    9. 2. Finding the Core Problem
      1. Exploring a problem
        1. Outlining the problem
          1. Tracking knowledge
          2. The medium
        2. Paper programming
          1. So how does such a paper program work?
        3. Not so scary UML
      2. Involving the experts
        1. Finding the gaps
          1. Talking business
        2. Talking about the actors
      3. Identifying the hard problem
        1. Mapping the dependencies
        2. Drawing with code – spiking
      4. Getting started, it's about time
        1. Creating value without creating code
        2. Deciding on the first feature
      5. Summary
    10. 3. Setting Up a Project for Domain-driven Design
      1. Structuring a project as we see it
        1. Approachability
        2. Locality of edits
        3. Fitness
        4. Dealing with shared functionality
          1. A shared toolbox
          2. Moving up the dependencies
      2. Testing
        1. Setting up a test environment
        2. Different types of tests and goals
          1. Feature specs
          2. Unit tests
          3. Performance tests
        3. Continuous integration
      3. Managing the build
        1. Why every application needs a build system
          1. Running the tests
          2. Packaging the application
          3. Deploying
        2. Choosing the right system
      4. Isolating the domain
        1. The architecture of modern applications
          1. Hexagonal architecture
        2. Applying the pattern
        3. Plugging in a framework
      5. Summary
    11. 4. Modeling the Actors
      1. The shoulders of giants
      2. The Different approaches to development
        1. Introducing mocks
        2. Why and why not to mock
      3. Who is involved in the prisoner transfer?
        1. Different objects and their roles
      4. Naming objects according to the domain
        1. The traps of common names like *Manager
        2. Readability of method names
      5. Objects first
        1. The basics of objects in JavaScript
        2. Inheritance and why you won't need it
        3. Modeling patterns beyond inheritance
          1. The object composition
          2. Polymorphism without inheritance
      6. Applying object design to the domain
        1. Building a system on simple objects
      7. Summary
    12. 5. Classification and Implementation
      1. Building a common language
        1. The importance of object classification
        2. Seeing the bigger picture
      2. Value objects
        1. The advantages of value objects
        2. The referential transparency
      3. Objects defined as entities
        1. More on entities
      4. Managing the application's lifecycle
        1. Aggregations
        2. Grouping and interfaces
      5. Services
      6. Associations
      7. Insight during implementation
        1. Recognizing domain patterns
          1. Not everything is an entity
        2. Refactoring all the time towards malleable code
      8. Implementing language guidance
        1. Working with and on the business language
      9. Building context
        1. Separation and shared knowledge
      10. Summary
    13. 6. Context Map – The Big Picture
      1. Don't fear the monolith
      2. Service-oriented architecture and microservices
      3. Keeping it all in your head
        1. Recognizing the contexts
        2. Testing in contexts
          1. Integration across boundaries
          2. TDD and testing in production
      4. The different ways to manage contexts
        1. Drawing a context map
        2. The monolithic architecture
        3. A shared kernel
        4. The APIs
          1. The customer and the supplier
          2. Developing a client
        5. The conformist
        6. The anticorruption layer
          1. Isolating the methodologies
        7. Separate ways
          1. Unrelated applications
        8. An open protocol
      5. Sharing knowledge
        1. The publishing language
          1. Creating the documentation
          2. Updating the documentation
          3. Tests are not the only documentation
      6. Summary
    14. 7. It's Not All Domain-driven Design
      1. Matching the domain to the problem
        1. Growing into a domain
        2. A good domain for domain-driven design
      2. The power of object-orientation
        1. The object-oriented principles so far
        2. The object-oriented modeling of business domains
        3. The scenarios of pure object-orientation falling short
      3. Influences to keep close
        1. Aspect-oriented programming
        2. Command-query separation
        3. Plain old objects
      4. Domain-specific languages
        1. Creating DSLs
          1. DSLs in domain-driven design
      5. Drawing knowledge
        1. Functional programming
          1. Functional programming and JavaScript
          2. Value objects
        2. Events
          1. Event stores versus entity relational mapping
      6. Further reading
      7. Summary
    15. 8. Seeing It All Come Together
      1. The different kinds of JavaScript project
        1. Enhancing the user experience
        2. Single-page applications
          1. Different frameworks and their implications
          2. Rendering on the client side
        3. Using JavaScript server side
          1. The advantages of a controlled environment
          2. Advanced modularization
      2. The different kinds of complexity
        1. Algorithmic complexity
        2. Logical complexity
        3. The business rules
      3. The domains suitable for domain-driven design
        1. Banking applications
        2. Travel applications
        3. The domain prerequisites
      4. Further reading
      5. Summary
    16. Index

Product information

  • Title: JavaScript Domain-Driven Design
  • Author(s): Philipp Fehre
  • Release date: July 2015
  • Publisher(s): Packt Publishing
  • ISBN: 9781784394325