Majid Hajian
Majid Hajian is a passionate software developer with years of developing and architecting complex web and mobile applications. He is passionate about web platform especially flutter, IoT, PWAs, and performance.
Majid Hajian
mhadaily
Updated - April 2020
mhadaily
mhadaily
mhadaily
Resource Capacity
Project Complexity
App development Complexity Growth
without DDD
Resource Capacity
Project Complexity
App development Complexity Growth
with DDD
You are not gonna need it
Shortening development time
Keep it short and simple
Maintainable code
Focus on essential parts
Simplifying the problem
Introduction to DDD
Proposed Flutter architectures
Strategic Domain Driven Design
DEMO
mhadaily
import 'package:flutter/material.dart';
MaterialApp(
ThemeData(
name: "Majid Hajian",
location: "Oslo, Norway",
description: '''
Passionate Software engineer,
Community Leader, Author and international Speaker
''',
main: "Flutter/Dart, PWA, IoT",
homepage: "https://www.majidhajian.com",
socials: {
twitter: "https://www.twitter.com/mhadaily",
github: "https://www.github.com/mhadaily"
},
books: {
"Progressive Web App with Angular": {
version: "1.0.0",
publishedBy: "Apress",
foundOn: "www.pwawithangular.com",
}
},
author: {
packtpub: "PWA development, 7 hours video course",
Udemy: "PWA development, 7 hours video course"
}
founder: "Softiware As (www.Softiware.com)"
devDependencies: {
tea: "green", mac: "10.14+",
},
engines: {
MobileEraConference: "Orginizer",
ngVikingsConference: "Orginizer",
MobileMeetupOslo:"Co-Orginizer",
FlutterDartOslo: "Co-Orginizer",
GDGOslo: "Co-Orginizer",
}
),
)
Find me on the internet by
mhadaily
mhadaily
mhadaily
mhadaily
Write code
Build An App
Understand Client Needs
Solve Problems
is for
mhadaily
mhadaily
mhadaily
Why is Strategic Domain-Driven Design Important?
mhadaily
mhadaily
Sales
Manage Employees
Accounting
Marketing
Product Catalog
mhadaily
customer
id
name
interest
Sales
customer
id
name
phone
Employees
customer
id
address
availability
Marketing
customer
id
name
payment method
Accounting
mhadaily
customer
id
name
interest
Sales
customer
id
name
phone
Support
customer
id
address
availability
Order
customer
id
name
payment method
Accounting
By
Namespace
Folder
Project
mhadaily
customer
id
name
interest
Sales
customer
id
name
phone
Employees
mhadaily
customer
id
name
interest
Sales
customer
id
name
phone
Employees
customer
id
address
availability
Marketing
customer
id
name
payment method
Accounting
mhadaily
customer
id
name
interest
Sales
customer
id
name
phone
Employees
customer
id
address
availability
Marketing
customer
id
name
payment method
Accounting
Shared
Kernel
e.g.
USER
Authentication
mhadaily
customer
id
name
interest
Sales
customer
id
name
phone
Support
customer
id
address
availability
Order
customer
id
name
payment method
Accounting
Open Host Service
mhadaily
customer
id
name
interest
Sales
customer
id
name
phone
Support
customer
id
address
availability
Order
customer
id
name
payment method
Accounting
Open Host Service
API
mhadaily
mhadaily
Navigation
Map
by Eric Evans
mhadaily
Manufacturing App
mhadaily
Sales
Common
Catalog
E-commerce App
mhadaily
Sales
Common
Catalog
E-commerce App
Presentation
Presentation
Presentation
Screen
Logic Holder
Widgets
Smart UI - Feature
Screen
Logic Holder
Smart UI - Feature
BLoC
ChangeNotifier
BLoC
ChangeNotifier
mhadaily
Sales
Common
Catalog
E-commerce App
Presentation
Presentation
Presentation
Application
Application
Application
Use Case Specific Facades
Simplify
mhadaily
Sales
Common
Catalog
E-commerce App
Domain
Domain
Domain
Presentation
Presentation
Presentation
Application
Application
Application
Text
Entities
Interfaces
Logic
mhadaily
Object Values
Sales
Common
Catalog
E-commerce App
Domain
Domain
Domain
Infrastructure
Infrastructure
Infrastructure
Presentation
Presentation
Presentation
Application
Application
Application
Text
Remote Data Source
Models
Local Data Source
Geo Location, ...
Raw Data
Raw Data
Raw Data
Models
Repositories
Sales
Catalog
E-commerce App
Domain
Domain
Infrastructure
Infrastructure
Presentation
Presentation
Application
Application
mhadaily
Sales
Catalog
E-commerce App
Domain
Domain
Infrastructure
Infrastructure
Presentation
Presentation
Application
Application
API
mhadaily
mhadaily
Sales
Common
Catalog
E-commerce App
Presentation
Presentation
Screen
Logic Holder
BLoC
Widgets
Screen
Logic Holder
BLoC
mhadaily
Utils
Sales
Common
Catalog
E-commerce App
Logic
Presentation
Presentation
Presentation
Text
mhadaily
Logic
Business logic
GetLatestNewsWithAuthorsUseCase
Sales
Common
Catalog
E-commerce App
Logic
Data
Presentation
Presentation
Presentation
Text
Remote Data Source
Local Data Source
Geo Location, ...
Raw Data
Raw Data
Raw Data
Models
Logic
Repositories
Sales
Catalog
E-commerce App
Logic
Data
Presentation
Presentation
Logic
mhadaily
├── lib
│ ├── catalog
│ │ ├── api
│ │ │ └── index.dart
│ │ ├── application
│ │ │ └── catalog_facade_service.dart
│ │ ├── domain
│ │ │ ├── entities
│ │ │ │ └── product.dart
│ │ │ ├── interfaces
│ │ │ │ └── product_interface.dart
│ │ │ └── logic
│ │ │ ├── catalog_logic.dart
│ │ │ └── get_official_product_manufacturer.dart
│ │ ├── infrastructure
│ │ │ ├── data_sources
│ │ │ │ ├── product_local_data_provider.dart
│ │ │ │ └── product_remote_data_provider.dart
│ │ │ ├── models
│ │ │ │ └── product_model.dart
│ │ │ └── repositories
│ │ │ └── product_repository.dart
│ │ └── presentation
│ │ ├── catalog-detail
│ │ │ ├── bloc
│ │ │ │ ├── bloc.dart
│ │ │ │ ├── catalog_detail_bloc.dart
│ │ │ │ ├── catalog_detail_event.dart
│ │ │ │ └── catalog_detail_state.dart
│ │ │ └── catalog_detail_screen.dart
│ │ ├── catalog-list
│ │ │ ├── bloc
│ │ │ │ ├── bloc.dart
│ │ │ │ ├── catalog_list_bloc.dart
│ │ │ │ ├── catalog_list_event.dart
│ │ │ │ └── catalog_list_state.dart
│ │ │ └── catalog_list_screen.dart
│ │ └── widgets
│ │ └── catalog_name.dart
│ ├── common
│ │ ├── config
│ │ │ └── config.dart
│ │ ├── exceptions
│ │ │ ├── exceptions.dart
│ │ │ ├── local_exceptions.dart
│ │ │ └── server_exceptions.dart
│ │ ├── helpers
│ │ │ └── helpers.dart
│ │ ├── platform
│ │ │ └── connectivity.dart
│ │ ├── utils
│ │ │ └── utils.dart
│ │ └── widgets
│ │ └── widgets.dart
│ ├── injections.dart
│ └── main.dart
mhadaily
Advanced
── catalog
│ ├── logic
│ │ ├── catalog_logic.dart
│ │ ├── get_official_product_manufacturer.dart
│ │ └── product_repository.dart
│ └── presentation
│ ├── catalog-detail
│ │ ├── bloc
│ │ │ ├── bloc.dart
│ │ │ ├── catalog_detail_bloc.dart
│ │ │ ├── catalog_detail_event.dart
│ │ │ └── catalog_detail_state.dart
│ │ └── catalog_detail_screen.dart
│ ├── catalog-list
│ │ ├── bloc
│ │ │ ├── bloc.dart
│ │ │ ├── catalog_list_bloc.dart
│ │ │ ├── catalog_list_event.dart
│ │ │ └── catalog_list_state.dart
│ │ └── catalog_list_screen.dart
│ └── widgets
│ └── catalog_name.dart
├── common
│ ├── config
│ │ └── config.dart
│ ├── exceptions
│ │ ├── exceptions.dart
│ │ ├── local_exceptions.dart
│ │ └── server_exceptions.dart
│ ├── helpers
│ │ └── helpers.dart
│ ├── platform
│ │ └── connectivity.dart
│ ├── utils
│ │ └── utils.dart
│ └── widgets
│ └── widgets.dart
├── data_sources
│ ├── product_local_data_provider.dart
│ ├── product_model.dart
│ └── product_remote_data_provider.dart
├── injections.dart
└── main.dart
mhadaily
Simple
BUT GUIDANCE
LET DDD GUIDE US
mhadaily
Introduction to DDD
Flutter architecture inspired by DDD
Strategic Domain Driven Design Ideas
What we have learned
mhadaily
Majid Hajian
mhadaily
Slides and link to source code
bit.ly/ddd-flutter
majid[at]softiware[dot]com
By Majid Hajian
Architecting software, especially on a large-scale where it needs to meet the business requirements is always a challenge and Flutter apps are not an exception. Strategic Domain-Driven Design techniques ensure your application is optimized to support business goals while identifying cohesive modules, known as bounded context which creates a maintainable, comprehensible codebase by isolating dependencies and describe business value. In this talk, I explorer the idea of the ubiquitous language, the bounded context, sub-domains while they are being implemented in a real application. All in all, You'll learn how I attempted to architect a (large-scale) Flutter application by technical solution and appropriate methodology in order to have a sustainable app.
Majid Hajian is a passionate software developer with years of developing and architecting complex web and mobile applications. He is passionate about web platform especially flutter, IoT, PWAs, and performance.