SlideShare uma empresa Scribd logo
1 de 37
Bojan Veljanovski
Chief Technology Officer @ HASELT
@bojanv91
Modular Software
Architecture & Design
1
2
General
Sponsors
Platinum
Sponsors
Silver
Sponsors
Gold
Sponsors
Bronze
Sponsors
Outline
• Why we need to apply architecture & design?
• Path to modularity
– Layers, Use cases, Hexagons
• DEMO
• Benefits and tradeoffs
• Questions & Discussions
3
Goal: Make apps easier to understand.
4
Perfect software does not exist!
Only good enough.
5
But, how good is “good enough”?
6
• Imprecise, ambiguous or unclear requirements
• Implementing features with no design
– Tight coupling
– Cyclic dependencies
– Not well separated concerns
• Ignoring software entropy
– System complexity increases with code modifications.
7
What makes Software bad?
8
What problems can you spot?
• Code becomes hard to maintain
• Simple changes become complex changes
• Feature/Change estimates increase drastically
• Fixed bugs start to re-appear
• Developers start to freak out and get demotivated
• Testing becomes hard and expensive
• Projects fail or forced to be rewritten
9
Consequences
• Increase Maintainability
– reduction of technical debt
• Decrease Technical Debt
– debt payed in time and frustration for bad decisions
10
The need for arc. & design
• Maintainability
– Changes in one area of an app does not affect other
– Adding new features does not need large code-base
changes (new features -> new code)
– Adding new ways to interact with the app does not need
changes in application or domain logic
– Testing is straightforward
• Technical Debt
– Number of team hours to re-factor the codebase to a state
that the team would be comfortable and productive to work
with
11
The need for arc. & design (2)
12
Everything is interrelated
(beware of context!)
Modular-based architecture styles
13
• Application decomposed into reusable logical modules
and components that expose well-defined
communication interfaces.
• Aligning modular structure around domain concepts
• Organize responsibility around business features
instead of technical functions
Key principles
14
• Reusable
• Replaceable
• Not context specific
• Extensible
• Encapsulated
• Independent
Hexagonal Architecture
• Allow an application to be equally driven by users,
programs, automated test or batch scripts, and to be
developed and tested in isolation from its eventual run-
time devices and databases.
• http://alistair.cockburn.us/Hexagonal+architecture
15
16
17
18
Structure
• Domain
– Entities, Aggregates
– Events
– Repositories
• Application
– Actions (Commands and Queries)
– Handlers
• Infrastructure
– Adapters for database, filesystem, message buses, http
connections, action runners
• Delivery
– Web UIs, HTTP API endpoints, Console app, Bots, Test
framework
19
20
• Ports
– Allow for communication to happen
• Adapters
– Translate messages from the outside world
Communication between layers
“Loudest” design patterns
• Domain Layer
– Domain modeling with DDD principles
• Application Layer
– CQRS components
– Dependency Injection
– Decorator
• Infrastructure
– Composite root
– Mediator
• SOLID principles apply everywhere
21
Implementation…
22
23
Organization by
Technical Functions
24
Organization by
Business Features
25
Horizontal vs. Vertical structure
26
Action / Feature
• Intention revealing
• One responsibility
• Says WHAT, not HOW
• Application service component
– Command
• Tells entities what to do
– Query
• Retrieves data from storage
• e.g.: Register user, Buy ticket, Filter active customers etc.
27
Action object is defined with
• Communication Boundary
– Request
– Response
• Coordination Logic
– Validator
– Handler
28
29
Application interaction flow
Common Handler execution steps
1. Audit log
2. Validate request
3. Begin transaction
4. Load Aggregate
5. Operate to Aggregate
6. Store Aggregate
7. Dispatch raised domain events / notifications
8. Commit transaction
30
DEMO
31
32
How to reuse modules?
• Separate Assembly (Shared Assembly)
• NuGet package
• Distributed service (Microservice)
33
Natural evolution towards
SOA / Microservices
Benefits
• Increased maintainability
• Developing, testing and tuning modules independently
• Making applications more flexible and extensible
• Easier to test in isolation
• Easily re-use modules in other projects
• Modules can evolve independently
– By functional requirements
– By non-functional requirements
– By team organization size and style
• Things are much easier to find
– Thus apps are easier to understand
34
Challenges and tradeoffs
• Mind-shift from the mainstream .NET development
• Need of a full-stack development team
• Larger number of files and classes
35
Complete the evaluation
and earn the chance to win
prizes in the closing raffle
http://eval.codecamp.mk
36
Questions?
Thank you
37

Mais conteúdo relacionado

Mais procurados

Component design and implementation tools
Component design and implementation toolsComponent design and implementation tools
Component design and implementation tools
Kalai Vani V
 
1 introduction to sa
1 introduction to sa1 introduction to sa
1 introduction to sa
david10hm
 
Design process and concepts
Design process and conceptsDesign process and concepts
Design process and concepts
Slideshare
 
Presentation on component based software engineering(cbse)
Presentation on component based software engineering(cbse)Presentation on component based software engineering(cbse)
Presentation on component based software engineering(cbse)
Chandan Thakur
 

Mais procurados (20)

Design Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software EngineeringDesign Model & User Interface Design in Software Engineering
Design Model & User Interface Design in Software Engineering
 
Domain specific Software Architecture
Domain specific Software Architecture Domain specific Software Architecture
Domain specific Software Architecture
 
Software design
Software designSoftware design
Software design
 
Strategy of software design
Strategy of software designStrategy of software design
Strategy of software design
 
Layered Architecture - Software Architecture Pattern
Layered Architecture - Software Architecture PatternLayered Architecture - Software Architecture Pattern
Layered Architecture - Software Architecture Pattern
 
EC8791 Requirement-Specifications-Quality assurance techniques
EC8791 Requirement-Specifications-Quality assurance techniquesEC8791 Requirement-Specifications-Quality assurance techniques
EC8791 Requirement-Specifications-Quality assurance techniques
 
Architectural design of software
Architectural  design of softwareArchitectural  design of software
Architectural design of software
 
Unit v -Construction and Evaluation
Unit v -Construction and EvaluationUnit v -Construction and Evaluation
Unit v -Construction and Evaluation
 
Component design and implementation tools
Component design and implementation toolsComponent design and implementation tools
Component design and implementation tools
 
Soa 1 7.ppsx
Soa 1 7.ppsxSoa 1 7.ppsx
Soa 1 7.ppsx
 
Layered architecture style
Layered architecture styleLayered architecture style
Layered architecture style
 
Software Design Concepts
Software Design ConceptsSoftware Design Concepts
Software Design Concepts
 
1 introduction to sa
1 introduction to sa1 introduction to sa
1 introduction to sa
 
Design process and concepts
Design process and conceptsDesign process and concepts
Design process and concepts
 
Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UG
Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UGVertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UG
Vertical Slices in .NET - Bojan Veljanovski, March 2016, MK.NET UG
 
Software engineering 17 architectural design
Software engineering 17 architectural designSoftware engineering 17 architectural design
Software engineering 17 architectural design
 
Presentation on component based software engineering(cbse)
Presentation on component based software engineering(cbse)Presentation on component based software engineering(cbse)
Presentation on component based software engineering(cbse)
 
Se ii unit3-architectural-design
Se ii unit3-architectural-designSe ii unit3-architectural-design
Se ii unit3-architectural-design
 
Software architecture design ppt
Software architecture design pptSoftware architecture design ppt
Software architecture design ppt
 
Software architecture and software design
Software architecture and software designSoftware architecture and software design
Software architecture and software design
 

Destaque

Software design principles
Software design principlesSoftware design principles
Software design principles
Ritesh Singh
 
modelingtools
modelingtoolsmodelingtools
modelingtools
learnt
 
Doing Your HW - A UX approach to your web design
Doing Your HW - A UX approach to your web designDoing Your HW - A UX approach to your web design
Doing Your HW - A UX approach to your web design
Fabian Alcantara
 

Destaque (20)

Software design principles
Software design principlesSoftware design principles
Software design principles
 
Modular architecture today
Modular architecture todayModular architecture today
Modular architecture today
 
modelingtools
modelingtoolsmodelingtools
modelingtools
 
Software Architecture Taxonomies - modularity
Software Architecture Taxonomies - modularitySoftware Architecture Taxonomies - modularity
Software Architecture Taxonomies - modularity
 
Coding pilkades
Coding pilkadesCoding pilkades
Coding pilkades
 
Web design ux trends 2013
Web design ux trends 2013Web design ux trends 2013
Web design ux trends 2013
 
Doing Your HW - A UX approach to your web design
Doing Your HW - A UX approach to your web designDoing Your HW - A UX approach to your web design
Doing Your HW - A UX approach to your web design
 
Web, Design, and UX Trends for 2008
Web, Design, and UX Trends for 2008Web, Design, and UX Trends for 2008
Web, Design, and UX Trends for 2008
 
Web, Design, and UX Trends for 2006
Web, Design, and UX Trends for 2006Web, Design, and UX Trends for 2006
Web, Design, and UX Trends for 2006
 
Mobile Web UX - TdT@Cluj #17
Mobile Web UX - TdT@Cluj #17Mobile Web UX - TdT@Cluj #17
Mobile Web UX - TdT@Cluj #17
 
Responsive Web Design (Microsoft Web & Phone UX Tour 2011)
Responsive Web Design (Microsoft Web & Phone UX Tour 2011)Responsive Web Design (Microsoft Web & Phone UX Tour 2011)
Responsive Web Design (Microsoft Web & Phone UX Tour 2011)
 
Web Form Design (Web Visions 2009)
Web Form Design (Web Visions 2009)Web Form Design (Web Visions 2009)
Web Form Design (Web Visions 2009)
 
Introduction to Antetype - Web UX design tool
Introduction to Antetype - Web UX design toolIntroduction to Antetype - Web UX design tool
Introduction to Antetype - Web UX design tool
 
#4_web_ux_wakizaka
#4_web_ux_wakizaka#4_web_ux_wakizaka
#4_web_ux_wakizaka
 
Web, Design, and UX Trends for 2005
Web, Design, and UX Trends for 2005Web, Design, and UX Trends for 2005
Web, Design, and UX Trends for 2005
 
Conflict is the Key to Great UX - Web Design Day Pittsburgh Lightning Talk
Conflict is the Key to Great UX - Web Design Day Pittsburgh Lightning TalkConflict is the Key to Great UX - Web Design Day Pittsburgh Lightning Talk
Conflict is the Key to Great UX - Web Design Day Pittsburgh Lightning Talk
 
form-form pilkades
form-form pilkadesform-form pilkades
form-form pilkades
 
Hexagonal architecture - message-oriented software design (Symfony Live Berli...
Hexagonal architecture - message-oriented software design (Symfony Live Berli...Hexagonal architecture - message-oriented software design (Symfony Live Berli...
Hexagonal architecture - message-oriented software design (Symfony Live Berli...
 
Evolution of Web Design (UX / Usability) by eDesign - ArabNet Riyadh 2015
Evolution of Web Design (UX / Usability) by eDesign - ArabNet Riyadh 2015Evolution of Web Design (UX / Usability) by eDesign - ArabNet Riyadh 2015
Evolution of Web Design (UX / Usability) by eDesign - ArabNet Riyadh 2015
 
Software Architecture Design Patterns
Software Architecture Design PatternsSoftware Architecture Design Patterns
Software Architecture Design Patterns
 

Semelhante a Bojan Veljanovski - Modular Software Architecture and Design (Code Camp 2016)

API-driven Legacy Migration: Results from Project Winterfell
API-driven Legacy Migration: Results from Project WinterfellAPI-driven Legacy Migration: Results from Project Winterfell
API-driven Legacy Migration: Results from Project Winterfell
Keith McFarlane
 
Extending and improving bps romania 30th of nov 2010
Extending and improving bps   romania 30th of nov 2010Extending and improving bps   romania 30th of nov 2010
Extending and improving bps romania 30th of nov 2010
Doina Draganescu
 
Agile methodology in cloud computing
Agile methodology in cloud computingAgile methodology in cloud computing
Agile methodology in cloud computing
Ahmed M. Abed
 

Semelhante a Bojan Veljanovski - Modular Software Architecture and Design (Code Camp 2016) (20)

Sysdev
SysdevSysdev
Sysdev
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
340_18CS35_se_mod1(secab).pdf
340_18CS35_se_mod1(secab).pdf340_18CS35_se_mod1(secab).pdf
340_18CS35_se_mod1(secab).pdf
 
Software Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuableSoftware Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuable
 
Understanding Microservices
Understanding Microservices Understanding Microservices
Understanding Microservices
 
How Microsoft ALM Tools Can Improve Your Bottom Line
How Microsoft ALM Tools Can Improve Your Bottom LineHow Microsoft ALM Tools Can Improve Your Bottom Line
How Microsoft ALM Tools Can Improve Your Bottom Line
 
API-driven Legacy Migration: Results from Project Winterfell
API-driven Legacy Migration: Results from Project WinterfellAPI-driven Legacy Migration: Results from Project Winterfell
API-driven Legacy Migration: Results from Project Winterfell
 
Inventory and manufacturing system migration - case study
Inventory and manufacturing system migration - case studyInventory and manufacturing system migration - case study
Inventory and manufacturing system migration - case study
 
170215 msa intro
170215 msa intro170215 msa intro
170215 msa intro
 
Pros & Cons of Microservices Architecture
Pros & Cons of Microservices ArchitecturePros & Cons of Microservices Architecture
Pros & Cons of Microservices Architecture
 
Student feedback system
Student feedback systemStudent feedback system
Student feedback system
 
Software models
Software modelsSoftware models
Software models
 
Top Devops bottlenecks, constraints and best practices
Top Devops bottlenecks, constraints and best practicesTop Devops bottlenecks, constraints and best practices
Top Devops bottlenecks, constraints and best practices
 
Extending and improving bps romania 30th of nov 2010
Extending and improving bps   romania 30th of nov 2010Extending and improving bps   romania 30th of nov 2010
Extending and improving bps romania 30th of nov 2010
 
ADF Performance Monitor
ADF Performance MonitorADF Performance Monitor
ADF Performance Monitor
 
System Development Life Cycle Overview.ppt
System Development Life Cycle Overview.pptSystem Development Life Cycle Overview.ppt
System Development Life Cycle Overview.ppt
 
Serverless microservices
Serverless microservicesServerless microservices
Serverless microservices
 
Software Architecture
Software ArchitectureSoftware Architecture
Software Architecture
 
Agile methodology in cloud computing
Agile methodology in cloud computingAgile methodology in cloud computing
Agile methodology in cloud computing
 
Webinar: Ten Ways to Enhance Your Salesforce.com Application in 2013
Webinar: Ten Ways to Enhance Your Salesforce.com Application in 2013Webinar: Ten Ways to Enhance Your Salesforce.com Application in 2013
Webinar: Ten Ways to Enhance Your Salesforce.com Application in 2013
 

Mais de Bojan Veljanovski

Quick look at Web Components and Project Polymer - MKNET UG
Quick look at Web Components and Project Polymer - MKNET UGQuick look at Web Components and Project Polymer - MKNET UG
Quick look at Web Components and Project Polymer - MKNET UG
Bojan Veljanovski
 

Mais de Bojan Veljanovski (6)

CodeCamp 2018 - Architecting Systems with CQRS - Four Years Experience Report...
CodeCamp 2018 - Architecting Systems with CQRS - Four Years Experience Report...CodeCamp 2018 - Architecting Systems with CQRS - Four Years Experience Report...
CodeCamp 2018 - Architecting Systems with CQRS - Four Years Experience Report...
 
NoSQL document oriented data access for .net systems with postgresql and marten
NoSQL document oriented data access for .net systems with postgresql and martenNoSQL document oriented data access for .net systems with postgresql and marten
NoSQL document oriented data access for .net systems with postgresql and marten
 
DIGIT Noe 2016 - Overview of front end development today
DIGIT Noe 2016 - Overview of front end development todayDIGIT Noe 2016 - Overview of front end development today
DIGIT Noe 2016 - Overview of front end development today
 
Quick look at Web Components and Project Polymer - MKNET UG
Quick look at Web Components and Project Polymer - MKNET UGQuick look at Web Components and Project Polymer - MKNET UG
Quick look at Web Components and Project Polymer - MKNET UG
 
Real-world software design practices when developing ASP.NET web systems by B...
Real-world software design practices when developing ASP.NET web systems by B...Real-world software design practices when developing ASP.NET web systems by B...
Real-world software design practices when developing ASP.NET web systems by B...
 
AngularJS + NancyFx + MongoDB = The best trio for ultimate SPA by Bojan Velja...
AngularJS + NancyFx + MongoDB = The best trio for ultimate SPA by Bojan Velja...AngularJS + NancyFx + MongoDB = The best trio for ultimate SPA by Bojan Velja...
AngularJS + NancyFx + MongoDB = The best trio for ultimate SPA by Bojan Velja...
 

Último

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Último (20)

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

Bojan Veljanovski - Modular Software Architecture and Design (Code Camp 2016)

  • 1. Bojan Veljanovski Chief Technology Officer @ HASELT @bojanv91 Modular Software Architecture & Design 1
  • 3. Outline • Why we need to apply architecture & design? • Path to modularity – Layers, Use cases, Hexagons • DEMO • Benefits and tradeoffs • Questions & Discussions 3
  • 4. Goal: Make apps easier to understand. 4
  • 5. Perfect software does not exist! Only good enough. 5
  • 6. But, how good is “good enough”? 6
  • 7. • Imprecise, ambiguous or unclear requirements • Implementing features with no design – Tight coupling – Cyclic dependencies – Not well separated concerns • Ignoring software entropy – System complexity increases with code modifications. 7 What makes Software bad?
  • 9. • Code becomes hard to maintain • Simple changes become complex changes • Feature/Change estimates increase drastically • Fixed bugs start to re-appear • Developers start to freak out and get demotivated • Testing becomes hard and expensive • Projects fail or forced to be rewritten 9 Consequences
  • 10. • Increase Maintainability – reduction of technical debt • Decrease Technical Debt – debt payed in time and frustration for bad decisions 10 The need for arc. & design
  • 11. • Maintainability – Changes in one area of an app does not affect other – Adding new features does not need large code-base changes (new features -> new code) – Adding new ways to interact with the app does not need changes in application or domain logic – Testing is straightforward • Technical Debt – Number of team hours to re-factor the codebase to a state that the team would be comfortable and productive to work with 11 The need for arc. & design (2)
  • 13. Modular-based architecture styles 13 • Application decomposed into reusable logical modules and components that expose well-defined communication interfaces. • Aligning modular structure around domain concepts • Organize responsibility around business features instead of technical functions
  • 14. Key principles 14 • Reusable • Replaceable • Not context specific • Extensible • Encapsulated • Independent
  • 15. Hexagonal Architecture • Allow an application to be equally driven by users, programs, automated test or batch scripts, and to be developed and tested in isolation from its eventual run- time devices and databases. • http://alistair.cockburn.us/Hexagonal+architecture 15
  • 16. 16
  • 17. 17
  • 18. 18
  • 19. Structure • Domain – Entities, Aggregates – Events – Repositories • Application – Actions (Commands and Queries) – Handlers • Infrastructure – Adapters for database, filesystem, message buses, http connections, action runners • Delivery – Web UIs, HTTP API endpoints, Console app, Bots, Test framework 19
  • 20. 20 • Ports – Allow for communication to happen • Adapters – Translate messages from the outside world Communication between layers
  • 21. “Loudest” design patterns • Domain Layer – Domain modeling with DDD principles • Application Layer – CQRS components – Dependency Injection – Decorator • Infrastructure – Composite root – Mediator • SOLID principles apply everywhere 21
  • 26. 26
  • 27. Action / Feature • Intention revealing • One responsibility • Says WHAT, not HOW • Application service component – Command • Tells entities what to do – Query • Retrieves data from storage • e.g.: Register user, Buy ticket, Filter active customers etc. 27
  • 28. Action object is defined with • Communication Boundary – Request – Response • Coordination Logic – Validator – Handler 28
  • 30. Common Handler execution steps 1. Audit log 2. Validate request 3. Begin transaction 4. Load Aggregate 5. Operate to Aggregate 6. Store Aggregate 7. Dispatch raised domain events / notifications 8. Commit transaction 30
  • 32. 32 How to reuse modules? • Separate Assembly (Shared Assembly) • NuGet package • Distributed service (Microservice)
  • 34. Benefits • Increased maintainability • Developing, testing and tuning modules independently • Making applications more flexible and extensible • Easier to test in isolation • Easily re-use modules in other projects • Modules can evolve independently – By functional requirements – By non-functional requirements – By team organization size and style • Things are much easier to find – Thus apps are easier to understand 34
  • 35. Challenges and tradeoffs • Mind-shift from the mainstream .NET development • Need of a full-stack development team • Larger number of files and classes 35
  • 36. Complete the evaluation and earn the chance to win prizes in the closing raffle http://eval.codecamp.mk 36 Questions?