JavaScript Domain-Driven Design
eBook - ePub

JavaScript Domain-Driven Design

Philipp Fehre

Share book
  1. 206 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

JavaScript Domain-Driven Design

Philipp Fehre

Book details
Book preview
Table of contents
Citations

About This Book

If you are an experienced JavaScript developer who wants to improve the design of his or her applications, or find yourself in a situation to implement an application in an unfamiliar domain, this book is for you. Prior knowledge of JavaScript is required and prior experience with Node.js will also be helpful.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is JavaScript Domain-Driven Design an online PDF/ePUB?
Yes, you can access JavaScript Domain-Driven Design by Philipp Fehre in PDF and/or ePUB format, as well as other popular books in Computer Science & Open Source Programming. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781784394325
Edition
1

JavaScript Domain-Driven Design


Table of Contents

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

JavaScript Domain-Driven Design

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: July 2015
Production reference: 1270715
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78439-432-5
www.packtpub.com

Credits

Author
Philipp Fehre
Reviewers
Vahagn Grigoryan
Max Kirchoff
Michael Smith
Commissioning Editor
Taron Pereira
Acquisition Editors
Sonali Vernekar
Greg Wild
Content Development Editor
Rohit Kumar Singh
Technical Editor
Rohith Rajan
Copy Editors
Charlotte Carneiro
Ameesha Smith-Green
Project Coordinator
Mary Alex
Proofreader
Safis Editing
Indexer
Tejal Soni
Graphics
Jason Monteiro
Production Coordinator
Melwyn D'sa
Cover Work
Melwyn D'sa

About the Author

Philipp Fehre is a software engineer, conference organizer, speaker, and educator. Having seen many different applications as a consultant, he moved on to educate developers as an advocate of the NoSQL technology and is now working as a backend software engineer. He has also been a writer for the German Linux magazine in the past.
For years, he has been fascinated by the possibilities of JavaScript and followed Node.js from its beginnings, using it for research projects and production web services.

About the Reviewers

Vahagn Grigoryan is a senior web developer who is currently working at Learnship Networks. He has more than 10 years of full-stack application development experience, ranging from LAMP to frontend RESTful applications. He has worked for companies such as Lycos and Telegate, and is currently working at Learnship Networks. This is the first book that he has reviewed. He is married and has a 2-year-old son.
Max Kirchoff built his first website in 1996 on a little hosting service called GeoCities. He was not only immediately fascinated by the ability to distribute information with a graphical interface, but was also frustrated with how difficult it was to do interesting things with those early web browsers. As time passed and the technology evolved, Max built more and more websites, eventually working as a consultant for e-commerce early adopter businesses and then with advertising agencies, building campaigns that were on the bleeding edge of the Web. Along the way, he has worked on everything from leading the implementation of service-oriented architecture to UX prototyping and a thousand things in between. JavaScript was never his favorite language, but after working with a friend who "loved JS," he also came around and saw the strength and flexibility it provided for building beautiful and powerful web applications.
Max currently works for Google, where he works closely with advertisment platform partners to inform and enhance their web interfaces for better user experience.
Michael Smith is a developer and consultant with 15 years of experience. He has worked in a broad range of industries, including banking, finance, ...

Table of contents