SlideShare a Scribd company logo
1 of 22
Delivering Business Value through IT
JS Modularization
- The Restaurant approach -
1
Delivering Business Value through IT
Modularization
Restaurant approach
▪ A Customer (Client) orders a meal
▪ Waiter Vasko (PM) takes the order
▪ Chef Me (Developer) prepares the meal
▪ Decorator Jakov (Designer)
• make it look beautiful
▪ Cvetanka (Tester) tastes the meal
▪ At the end Vasko serves the meal
2
Delivering Business Value through IT
Modularization
Problem – client requirements
▪ Client app extension
▪ 3 different countries / versions
▪ Need different style
▪ Need different set of features
• Add new features
• Change old ones
▪ Most of them same / reused
▪ Do it in 2 weeks :)
3
Delivering Business Value through IT
How we did it initially
▪ COPY PASTE THE APP
▪ DELETEEEEEEEEEEEEE THE CODE THAT WAS NOT NEEDED
▪ RE-DESIGN THE APP
▪ DEMO:
• Restaurant javaDay2014
▪ The story of two students with same task
4
Delivering Business Value through IT
Modularization
Agenda
▪ Problems / Motivation
▪ Monolithic V.S. Modularized Apps
▪ How to implement modularization?
• Module Identification
• Business V.S. Common modules
• Refactoring
• Build Scripts
• Module distribution
▪ Obstacles
▪ Benefits
5
Delivering Business Value through IT
Modularization
Problem – our goals (R&D team)
6
Reuse the code Other orders can have same starter?
Ease maintenance Not all of us want chicken with curry
Testing Ingredient can be tasted, but also the meal
Extensibility / new features Client can order multiple meals
Increase development speed Recipes how to prepare meals
Do it less than 2 weeks :)
Solution is simple: Use Modules! But how?
Delivering Business Value through IT
Modularization
Monolith Apps
▪ what is monolith app?
▪ is angular monolith?
▪ but wait, there are modules…
▪ hmm, how to use them,
▪ what is module, or what should be?
▪ yet they are not distributed
7
Delivering Business Value through IT8
Delivering Business Value through IT
Modularization
Benefits of using modules
▪ Distributed / independent development
▪ Code reusability
▪ Program readability / quality
▪ Encapsulation (module is a function)
▪ Manageable tasks
• design, implement and test
9
Delivering Business Value through IT
Modularization
Actual V.S.
Expected
10
Delivering Business Value through IT
Modularization
How to do it
▪ Think a lot
▪ R&D, evaluation of existing solutions
• Yeoman
• ng-boilerplate
• npm / bower / grunt /
▪ Distribution
• Git
• Bower
• requireJS
11
Delivering Business Value through IT
Modularization
How to do it
▪ Define our meaning of module
• business v.s. common modules
▪ Work in parallel:
• grouping / refactoring business code
(top down approach)
• grouping / refactoring common code
(bottom up)
• while r&d: build scripts, module distribution, etc.
12
Delivering Business Value through IT
Modularization
Business Modules
▪ Structure
▪ Module definition: config / routes / deps.
▪ Controllers: services, model,
▪ View: html / directives
▪ Other resources: css, images,
▪ examples:
• Starter meal
• Main dish
• Dessert
13
Delivering Business Value through IT
Modularization
Common Modules
▪ same structure as business modules
▪ mainly services and providers
▪ html, directives
▪ other resources: css, images
▪ examples:
• menu,
• dialogs,
• data / cache providers,
• logger,
• i18n
14
Delivering Business Value through IT
Modularization
Build Scripts
▪ Gruntfile.js = task / build manager
▪ bower.json = dependency management
▪ Jshint/esLint = checkstyle and error detection
▪ Karma / Jasmine / protractor = test runner / unit testing / end-2-end testing
▪ Sass / Compass = CSS extension language
▪ One script to rule them all:
• build, test, minify, compile a package
▪ We are now CI ready
15
Delivering Business Value through IT
Modularization
▪ Demo 2:
• Restaurant javaSkop2015
16
Delivering Business Value through IT
Modularization
New version
▪ javaSkop 1.0
• Starter 1.3
• Main dish 1.1
• Dessert 1.5
▪ javaSkop 2.0
• Main dish 1.4
• Dessert 2
17
Delivering Business Value through IT
Modularization
▪ Demo 3:
• restaurant javaSkop2016
18
Delivering Business Value through IT
Modularization
Distribution of modules
▪ not only separate folders,
but separate repos / versions
• bower modules
• node modules
• git submodules
▪ Maven-like modules / artifacts
▪ Resulted in 40 modules
• 6 in this demo
▪ Each repo has its own
module definition
19
Delivering Business Value through IT
Modularization
Obstacles
▪ Code everywhere
• it’s hard to gain control with a monolithic design
▪ Plug-ability of modules
• make them aware of each other using module manager / registration
▪ Generic common features
• menu, i18n bundles, configuration, caching, etc.
20
Delivering Business Value through IT
Modularization summary
Pros
▪ Increased speed of development
▪ Testable code, less regression bugs
▪ Faster, more secure application (sealed package)
▪ Improved the process of new app creation
▪ Ready for Continuous Integration
Cons
▪ Maintenance of module repositories is more time consuming
• New repo, merge, versioning, etc.
▪ Needs a lot of attention when creating a business module
• make it independent from other business modules
21
Delivering Business Value through IT
Thank You!
Questions?
Author:
Goran Kopevski
gkopevski@gmail.com
@gkopevski
Source code: https://github.com/gkopevski/2015.java2days.base
22

More Related Content

Recently uploaded

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Featured

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 

Featured (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 

Js modularization the restaurant approach - javaskop 2015.pptx

  • 1. Delivering Business Value through IT JS Modularization - The Restaurant approach - 1
  • 2. Delivering Business Value through IT Modularization Restaurant approach ▪ A Customer (Client) orders a meal ▪ Waiter Vasko (PM) takes the order ▪ Chef Me (Developer) prepares the meal ▪ Decorator Jakov (Designer) • make it look beautiful ▪ Cvetanka (Tester) tastes the meal ▪ At the end Vasko serves the meal 2
  • 3. Delivering Business Value through IT Modularization Problem – client requirements ▪ Client app extension ▪ 3 different countries / versions ▪ Need different style ▪ Need different set of features • Add new features • Change old ones ▪ Most of them same / reused ▪ Do it in 2 weeks :) 3
  • 4. Delivering Business Value through IT How we did it initially ▪ COPY PASTE THE APP ▪ DELETEEEEEEEEEEEEE THE CODE THAT WAS NOT NEEDED ▪ RE-DESIGN THE APP ▪ DEMO: • Restaurant javaDay2014 ▪ The story of two students with same task 4
  • 5. Delivering Business Value through IT Modularization Agenda ▪ Problems / Motivation ▪ Monolithic V.S. Modularized Apps ▪ How to implement modularization? • Module Identification • Business V.S. Common modules • Refactoring • Build Scripts • Module distribution ▪ Obstacles ▪ Benefits 5
  • 6. Delivering Business Value through IT Modularization Problem – our goals (R&D team) 6 Reuse the code Other orders can have same starter? Ease maintenance Not all of us want chicken with curry Testing Ingredient can be tasted, but also the meal Extensibility / new features Client can order multiple meals Increase development speed Recipes how to prepare meals Do it less than 2 weeks :) Solution is simple: Use Modules! But how?
  • 7. Delivering Business Value through IT Modularization Monolith Apps ▪ what is monolith app? ▪ is angular monolith? ▪ but wait, there are modules… ▪ hmm, how to use them, ▪ what is module, or what should be? ▪ yet they are not distributed 7
  • 9. Delivering Business Value through IT Modularization Benefits of using modules ▪ Distributed / independent development ▪ Code reusability ▪ Program readability / quality ▪ Encapsulation (module is a function) ▪ Manageable tasks • design, implement and test 9
  • 10. Delivering Business Value through IT Modularization Actual V.S. Expected 10
  • 11. Delivering Business Value through IT Modularization How to do it ▪ Think a lot ▪ R&D, evaluation of existing solutions • Yeoman • ng-boilerplate • npm / bower / grunt / ▪ Distribution • Git • Bower • requireJS 11
  • 12. Delivering Business Value through IT Modularization How to do it ▪ Define our meaning of module • business v.s. common modules ▪ Work in parallel: • grouping / refactoring business code (top down approach) • grouping / refactoring common code (bottom up) • while r&d: build scripts, module distribution, etc. 12
  • 13. Delivering Business Value through IT Modularization Business Modules ▪ Structure ▪ Module definition: config / routes / deps. ▪ Controllers: services, model, ▪ View: html / directives ▪ Other resources: css, images, ▪ examples: • Starter meal • Main dish • Dessert 13
  • 14. Delivering Business Value through IT Modularization Common Modules ▪ same structure as business modules ▪ mainly services and providers ▪ html, directives ▪ other resources: css, images ▪ examples: • menu, • dialogs, • data / cache providers, • logger, • i18n 14
  • 15. Delivering Business Value through IT Modularization Build Scripts ▪ Gruntfile.js = task / build manager ▪ bower.json = dependency management ▪ Jshint/esLint = checkstyle and error detection ▪ Karma / Jasmine / protractor = test runner / unit testing / end-2-end testing ▪ Sass / Compass = CSS extension language ▪ One script to rule them all: • build, test, minify, compile a package ▪ We are now CI ready 15
  • 16. Delivering Business Value through IT Modularization ▪ Demo 2: • Restaurant javaSkop2015 16
  • 17. Delivering Business Value through IT Modularization New version ▪ javaSkop 1.0 • Starter 1.3 • Main dish 1.1 • Dessert 1.5 ▪ javaSkop 2.0 • Main dish 1.4 • Dessert 2 17
  • 18. Delivering Business Value through IT Modularization ▪ Demo 3: • restaurant javaSkop2016 18
  • 19. Delivering Business Value through IT Modularization Distribution of modules ▪ not only separate folders, but separate repos / versions • bower modules • node modules • git submodules ▪ Maven-like modules / artifacts ▪ Resulted in 40 modules • 6 in this demo ▪ Each repo has its own module definition 19
  • 20. Delivering Business Value through IT Modularization Obstacles ▪ Code everywhere • it’s hard to gain control with a monolithic design ▪ Plug-ability of modules • make them aware of each other using module manager / registration ▪ Generic common features • menu, i18n bundles, configuration, caching, etc. 20
  • 21. Delivering Business Value through IT Modularization summary Pros ▪ Increased speed of development ▪ Testable code, less regression bugs ▪ Faster, more secure application (sealed package) ▪ Improved the process of new app creation ▪ Ready for Continuous Integration Cons ▪ Maintenance of module repositories is more time consuming • New repo, merge, versioning, etc. ▪ Needs a lot of attention when creating a business module • make it independent from other business modules 21
  • 22. Delivering Business Value through IT Thank You! Questions? Author: Goran Kopevski gkopevski@gmail.com @gkopevski Source code: https://github.com/gkopevski/2015.java2days.base 22