SlideShare a Scribd company logo
JavaScript for
Enterprise
Applications
Piyush Katariya
Software Architect, Red Panda Innovation Labs
● Pune● Mumbai
We are ...
We believe in meaningful iterations such as
...
We rely on ...
Why
( people rant / believe / think )
JavaScript sucks ?
Most like it Static and Strong
● Dynamic :
○ Duck typing (No help from Compiler)
○ Late binding (Runtime is the King)
○ Polymorphism by capability
● Weak :
○ Not agnostic about types while code
execution (Recipe for all disasters)
○ Allow weird operations ( [ ] + { } )
○ Implicit conversions ( “2” * “3” = 6 )
● Static typing does not mean that TDD/BDD
can be ignored
● Productivity due to
○ Duck typing
○ Map/JSON over concrete object
Other Accusations
My reply against Accusation for To reactions by Newbies
Yep it sucks. Use “yield” instead Callbacks WTF ???
Better syntax and error handling but use
“yield” instead
Promises Really ?? WTF ???
Corporate vs Open specification trade off
Are your requirements clear ?
Evaluate case by case basis.
Fragmented community at least
hundred options of libs and
frameworks for given task
What to choose ?
Why to choose ?
Why isn’t there a standard ?
Understand Concurrency vs Parallelism.
Little slower at computation but much
better at memory usage and IO
multiplexing than JVM/CLR.
No synchronization problems. period.
Single threaded and Slow Execution is slow because its
dynamic language !
What ? It does not have
multithreading support???
Atom, Visual Code, ESLint, TypeScript ? IDE, Compiler Basic and Refactoring support ?
Procedural, functional and event driven Multiple Paradigm confusion OO, Prototypal, functional, event ?
Paradigms and Disciplines
● Structured [ Edgar Dijkstra : Go To Statement Considered Harmful ]
○ Avoid “goto” statements
○ Embrace block structures, for/while loops and small functions/subroutines
● Object Oriented [ Simula and Simula-67 language]
○ Avoid pointer to functions
○ Embrace code reuse - Inheritance and (Parametric and Subtype) Polymorphism
● Functional [ John McCarthy : LISP ]
○ Avoid variables, use only constants (Referential Transparency)
○ Avoid mutation or IO side effects (or reduce it by wrapping it inside a Monad)
○ Embrace Higher Order functions, Recursion, Persistent data structures, CT
● Event Driven [CSP, Actor Model]
○ Avoid function/subroutine call by direct reference
○ Embrace communication between isolated components by generating an event
and registering callback function/subroutine
NodeJS Runtime
What they ignore (or less aware of)
➔ Application reload within milliseconds during development and deployment
➔ PM2 process manager for painless deployment and monitoring
➔ V8 engine performance
➔ Serving Tens of thousands of network connections with little memory overhead
➔ ES6 “yield” is here. ES7 “async” and “await” is not necessary
➔ Using Babel (transpiler) to emit ECMAScript 5 code
➔ RamdaJS and date-fp - functional replacement for collection and date API
➔ Programmable Module level polymorphism using CommonJS
➔ Isomorphism - Mobile devices, Browser, Server and NoSql DB query
➔ NodeJS Long Time Support - https://github.com/nodejs/LTS
ES6 Basics and Generators
ECMAScript 6
● No semicolons
● Fat arrows (with bind feature)
● Template strings
● let - control scoping
● const - control assignments
● Destructuring
● Generator
○ Lazy collections
○ Avoid callbacks
○ Avoid promise (use but not creation)
● for-of loop
All features :- http://es6-features.org/
Must Have ESLint and FP plugin
● eslint - Takes care of JS language quirks
● eslint_plugin_fp - JS as pure FP language
fp/no-arguments fp/no-mutating-methods
fp/no-class fp/no-mutation
fp/no-delete fp/no-nil
fp/no-events fp/no-proxy
fp/no-get-set fp/no-rest-parameters
fp/no-let fp/no-this
fp/no-loops fp/no-throw
fp/no-mutating-assign fp/no-unused-expression
no-var fp/no-valueof-field
Communicating
Sequential
Processes
C S P for Dummies
➔ Don't communicate by sharing state, share state by communicating
➔ Communicating
◆ Conversation over channel/queues/distributed queues
◆ Remote procedure calls
➔ Sequential
◆ Execution flow
➔ Processess
◆ Coroutines
◆ Green threads (scheduled by VM)
◆ Real threads (scheduled by OS)
◆ OS Process
◆ Machines
◆ Cluster of Machines
➔ Original Paper - http://usingcsp.com/cspbook.pdf
CSP vs Actor Model
CSP Actor Model
Process Identity Anonymous Concrete
Message Passing Synchronous Asynchronous
Communication Channels/Queues Direct
Composition NA Applicable
Fault Tolerance Easy to built with Distributed
Queue
Hierarchy of Local and
Distributed Supervisors
➔ Hybrid approach is also viable and more practical
RamdaJS
Data - Structure and Types
● Data is all we have
● Data is what we need to transform in order to create a user experience
○ Photoshop without the images is nothing
○ Word is nothing without the characters
● Instructions are data too
● Immutability matters
○ Value - Always Immutable
○ State - Snapshot. Value of something at certain point of time
○ Identity - Stable logical entity associated with a series of different values over time
○ Time - Relative term, not physically measurable
Computation - Function and HOF
● Higher Order Function (does either or both)
○ Accepts a function
○ Returns a function
● Higher order abstraction for
○ Computation
○ Combinators
○ DSL - Composition of computation and combinators
Thinking functionally
● Use function as first class citizen to build abstraction
● Avoid mutation of variable(memory pointer handle) and data (state)
● Chant this mantra every morning, “null is a billion dollar mistake”
● Favour recursion over iteration
● Procure laziness with Streams
● Use expressions over statements
● Composition over inheritance
● Many identical functions for few data structures than few different functions for many
data structures
RamdaJS HOF Abstraction
● Auto Currying
● Abstraction Categories
○ Object
○ Function
○ List
○ Math
○ Logic
○ Relation
○ Type
● Transducers
http://ramdajs.com/docs/
Server Side
Architecture
Software Architecture in a nutshell
“ In most successful software projects, the expert developers working
on that project have a shared understanding of the design.
This shared understanding is called ‘Architecture.’
This understanding includes how the system is divided into
components and how the components interact through interfaces.
These components are usually composed of smaller components, but
the architecture only includes the components and interfaces that
are understood by all the developers ”
- Martin Fowler
Abstraction and Indirection
“ The essence of abstractions is preserving information that is relevant in a given context,
and forgetting information that is irrelevant in that context ”
– John V. Guttag
“ In computer programming, indirection is the ability to reference something using a name,
reference, or container instead of the value itself ”
“ All problems in computer science can be solved by another level of indirection ….”
- David Wheeler
“ ….. except the problem of too many
layers of indirection ”
“ Making something easy to
change makes the overall
system a little more complex,
and making everything easy to
change makes the entire system
very complex.
Complexity is what makes
software hard to change “
Scaling with MicroServices
Architecture decisions starts with
“ Optimism is an occupational hazard of programming;
feedback is the treatment. ”
- Kent Beck
● Initial market research for given Business Domain
● Security
● Transaction capability and boundaries
● Online active users growth - total vs active vs online users
● Data growth
● Testability (and hence modularity)
● External integration points
● Response generation eagerness - sync, or async
Micro Services done right
● It’s more social than technical
● Always start with monolith and scale gradually
● Scaling few business use cases
○ Computational complexity
○ Number of requests and responsiveness
● Scaling a business module
○ Computational complexity
○ Software as a Service
● Scaling a team
○ Programming platform expertise
○ Business Domain expertise
○ Maintenance
● Embrace async flow and Distributed Message Queues
Use DDD iff Domain is Rich and Complex
KoaJS
● By authors which gave us ExpressJS
● ES6 Framework
● Promise continuation based on “co” library
● Modular Architecture
● Composable
● Compatible with NodeJS 4.x and later
● Various community plugins
http://koajs.com/
PM2 Process Manager
● Superior version of “cluster” module
● Load Balancing & Zero second Downtime Reload
● Compatible with almost all major web frameworks
● CPU Process monitors
● Log monitors
http://pm2.keymetrics.io/
Hybrid Apps with Cordova
Cordova Architecture
Cordova Apps
● Written in HTML, CSS and JS
● Single codebase for multiple target platforms
○ Internet Browsers - IE, firefox, Chrome, Safari etc.
○ Mobile devices - Android, iOS, Windows etc.
● Webview - Chrome browser engine
● Fast development cycles compared to Native apps
● HTML5 Canvas for Game Programming
● Modern WebViews are as responsive as Native platform
● Access various device features through cordova plugins
https://cordova.apache.org
Features/Characteristics Hybrid Native
Runs on Chrome browser runtime OS runtime
Additional Runtime Crosswalk for 4.x, Not required for 5.x and later Not required
Approximate Software artefact
download size for say 10 screens
4.5 MB for 4.x, 3 MB for Android 5.x and later 4 MB
Increase in download Size due to
additional runtime
23 MB (one time) for Android 4.x and iOS 7 ZERO
Development HTML, CSS and JS, More widely adopted tools Java for Android, Swift for iOS
Required Tech Skills Anyone who knows web programming specific skill according to platform and
native SDK
Supported Platform Android, iOS, Windows, Symbian etc. only one platform
Relative Development and Debugging
time and responding to frequently
changing business requirements
1x 2x to 3x
Performance
Responsive. can be tuned to minute level of browser runtime
Best in class. Can be tuned to minute
level to OS runtime
Security Issues:
Insecure local data storage
Weak SSL implementation
Unintended data leaks
Reverse Engineering
Code Injection
Can be dealt Can be dealt
Additional features supported Only major features are supported. here is the detailed list
https://cordova.apache.org/docs/en/latest/guide/support/
All of which device is capable of
ClojureScript
ClojureScript
● by Rich Hickey
● Compiles to JS
● LISP - Code is Data is Code
● Macros - Homoiconicity
● Immutable Data Structures - Referential transparency
● Higher Order Functions - Sheer joy of computation
● Google Closure compiler - Lots of goodies including dead code elimination
● Figwheel - Interactive development
● Nice interop with JS and NPM
● Higher learning curve but worth it
https://clojurescript.org/
Reagent
● Based on React
○ Functional
○ Component based architecture
○ Higher order components
● Hiccup (embed HTML)
● reagent-utils
● re-frame
https://reagent-project.github.io
core.async
● CSP implementation for Clojure(Script)
● First class Goroutines support inspired by Go lang
● Being Reactive
○ Responsive - Rapid and consistent response time with reliable upper bounds
○ Resilient - replication, containment, isolation and delegation.
○ Elastic - responsive under varying workload, ability to add
○ Message Driven - loose coupling, isolation and location transparency.
http://www.reactivemanifesto.org/
Thank You
Piyush Katariya
@AhamPiyush

More Related Content

PPTX
What is scala
PDF
Thinking Functionally
PPTX
Fp and scala
PPTX
Introduction to Reactjs
PDF
SKIL - Dl4j in the wild meetup
PPTX
Functional Solid, Aleksandr Sugak
PPTX
Functional solid
ODP
ActiveRecord is good enough
What is scala
Thinking Functionally
Fp and scala
Introduction to Reactjs
SKIL - Dl4j in the wild meetup
Functional Solid, Aleksandr Sugak
Functional solid
ActiveRecord is good enough

What's hot (20)

PPTX
Test driven development v1.0
PDF
Stockholm JAM September 2018
PDF
'How to build your first micro frontend in a matter of minutes' by Vladlen Fe...
PDF
Tech io nodejs_20130531_v0.6
PDF
Perl6 DBDI YAPC::EU 201008
PPTX
Building Massive AngularJS Apps
PPTX
Tech io spa_angularjs_20130814_v0.9.5
PDF
Clojure presentation
PDF
'Architecture of modern frontend apps' by YURIY DOBRYANSKYY at OdessaJS'2020
PDF
Workflow Yapceu2010
PDF
Sprint Boot & Kotlin - Meetup.pdf
PPT
Testing Storm components with Groovy and Spock
PDF
Adopting language server for apache camel feedback from a java/Eclipse plugi...
PDF
Assembly thy Web
PPTX
Kotlin - A Programming Language
PDF
Simple Pure Java
PPTX
Java 8 parallel stream
PDF
Yet Another Continuous Integration Story
PPTX
The modern view on implementation of classic design patterns in Java
PPTX
JAVA 8 Parallel Stream
Test driven development v1.0
Stockholm JAM September 2018
'How to build your first micro frontend in a matter of minutes' by Vladlen Fe...
Tech io nodejs_20130531_v0.6
Perl6 DBDI YAPC::EU 201008
Building Massive AngularJS Apps
Tech io spa_angularjs_20130814_v0.9.5
Clojure presentation
'Architecture of modern frontend apps' by YURIY DOBRYANSKYY at OdessaJS'2020
Workflow Yapceu2010
Sprint Boot & Kotlin - Meetup.pdf
Testing Storm components with Groovy and Spock
Adopting language server for apache camel feedback from a java/Eclipse plugi...
Assembly thy Web
Kotlin - A Programming Language
Simple Pure Java
Java 8 parallel stream
Yet Another Continuous Integration Story
The modern view on implementation of classic design patterns in Java
JAVA 8 Parallel Stream
Ad

Viewers also liked (14)

PPTX
JavaScript (without DOM)
PDF
Javascript Libraries & Frameworks | Connor Goddard
PDF
JavaScript Libraries: The Big Picture
PPTX
Java vs javascript (XPages)
PDF
JavaOne 2014: Java vs JavaScript
PDF
Javascript libraries
PDF
Java vs. Java Script for enterprise web applications - Chris Bailey
PDF
Choosing Javascript Libraries to Adopt for Development
PPTX
Hybrid Mobile Development
PDF
10 Building Blocks for Enterprise JavaScript
PDF
Tools For jQuery Application Architecture (Extended Slides)
PDF
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
PDF
Microservice Architecture on AWS using AWS Lambda and Docker Containers
PDF
Scalable JavaScript Application Architecture
JavaScript (without DOM)
Javascript Libraries & Frameworks | Connor Goddard
JavaScript Libraries: The Big Picture
Java vs javascript (XPages)
JavaOne 2014: Java vs JavaScript
Javascript libraries
Java vs. Java Script for enterprise web applications - Chris Bailey
Choosing Javascript Libraries to Adopt for Development
Hybrid Mobile Development
10 Building Blocks for Enterprise JavaScript
Tools For jQuery Application Architecture (Extended Slides)
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
Microservice Architecture on AWS using AWS Lambda and Docker Containers
Scalable JavaScript Application Architecture
Ad

Similar to JavaScript for Enterprise Applications (20)

PDF
Viktor Turskyi "Effective NodeJS Application Development"
PDF
Migrate to Microservices Judiciously!
PDF
Deconstructing Monoliths with Domain Driven Design
PDF
Microservices as an evolutionary architecture: lessons learned
PDF
Cpp In Soa
PDF
From class to architecture
PPTX
Pragmatic Approach to Microservices and Cell-based Architecture
PDF
Microservice
PPTX
Building multi tenancy enterprise applications - quick
PPTX
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
PDF
introduction to micro services
PDF
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
PDF
Public Cloud Workshop
PDF
Lagom : Reactive microservice framework
PDF
Rapid app building with loopback framework
PPTX
Bff and GraphQL
PPTX
Clean architecture
PDF
BISSA: Empowering Web gadget Communication with Tuple Spaces
PDF
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
PPTX
Choosing the right parallel compute architecture
Viktor Turskyi "Effective NodeJS Application Development"
Migrate to Microservices Judiciously!
Deconstructing Monoliths with Domain Driven Design
Microservices as an evolutionary architecture: lessons learned
Cpp In Soa
From class to architecture
Pragmatic Approach to Microservices and Cell-based Architecture
Microservice
Building multi tenancy enterprise applications - quick
Building Microservices with .NET (speaker Anton Vasilenko, Binary Studio)
introduction to micro services
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
Public Cloud Workshop
Lagom : Reactive microservice framework
Rapid app building with loopback framework
Bff and GraphQL
Clean architecture
BISSA: Empowering Web gadget Communication with Tuple Spaces
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
Choosing the right parallel compute architecture

More from Piyush Katariya (6)

PDF
Concurrency, Parallelism And IO
PDF
Handling the growth of data
PDF
Expression problem
PDF
My inspirations and learned lessons
PPTX
Rise of the Single Page Application
PPTX
Introduction to Web Application Clustering
Concurrency, Parallelism And IO
Handling the growth of data
Expression problem
My inspirations and learned lessons
Rise of the Single Page Application
Introduction to Web Application Clustering

Recently uploaded (20)

PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
cuic standard and advanced reporting.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Electronic commerce courselecture one. Pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Cloud computing and distributed systems.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
MIND Revenue Release Quarter 2 2025 Press Release
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
cuic standard and advanced reporting.pdf
Network Security Unit 5.pdf for BCA BBA.
The Rise and Fall of 3GPP – Time for a Sabbatical?
Programs and apps: productivity, graphics, security and other tools
Mobile App Security Testing_ A Comprehensive Guide.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
NewMind AI Weekly Chronicles - August'25 Week I
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Electronic commerce courselecture one. Pdf
20250228 LYD VKU AI Blended-Learning.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Review of recent advances in non-invasive hemoglobin estimation
Cloud computing and distributed systems.
Advanced methodologies resolving dimensionality complications for autism neur...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Spectral efficient network and resource selection model in 5G networks
Digital-Transformation-Roadmap-for-Companies.pptx

JavaScript for Enterprise Applications

  • 3. We believe in meaningful iterations such as ...
  • 5. Why ( people rant / believe / think ) JavaScript sucks ?
  • 6. Most like it Static and Strong ● Dynamic : ○ Duck typing (No help from Compiler) ○ Late binding (Runtime is the King) ○ Polymorphism by capability ● Weak : ○ Not agnostic about types while code execution (Recipe for all disasters) ○ Allow weird operations ( [ ] + { } ) ○ Implicit conversions ( “2” * “3” = 6 ) ● Static typing does not mean that TDD/BDD can be ignored ● Productivity due to ○ Duck typing ○ Map/JSON over concrete object
  • 7. Other Accusations My reply against Accusation for To reactions by Newbies Yep it sucks. Use “yield” instead Callbacks WTF ??? Better syntax and error handling but use “yield” instead Promises Really ?? WTF ??? Corporate vs Open specification trade off Are your requirements clear ? Evaluate case by case basis. Fragmented community at least hundred options of libs and frameworks for given task What to choose ? Why to choose ? Why isn’t there a standard ? Understand Concurrency vs Parallelism. Little slower at computation but much better at memory usage and IO multiplexing than JVM/CLR. No synchronization problems. period. Single threaded and Slow Execution is slow because its dynamic language ! What ? It does not have multithreading support??? Atom, Visual Code, ESLint, TypeScript ? IDE, Compiler Basic and Refactoring support ? Procedural, functional and event driven Multiple Paradigm confusion OO, Prototypal, functional, event ?
  • 8. Paradigms and Disciplines ● Structured [ Edgar Dijkstra : Go To Statement Considered Harmful ] ○ Avoid “goto” statements ○ Embrace block structures, for/while loops and small functions/subroutines ● Object Oriented [ Simula and Simula-67 language] ○ Avoid pointer to functions ○ Embrace code reuse - Inheritance and (Parametric and Subtype) Polymorphism ● Functional [ John McCarthy : LISP ] ○ Avoid variables, use only constants (Referential Transparency) ○ Avoid mutation or IO side effects (or reduce it by wrapping it inside a Monad) ○ Embrace Higher Order functions, Recursion, Persistent data structures, CT ● Event Driven [CSP, Actor Model] ○ Avoid function/subroutine call by direct reference ○ Embrace communication between isolated components by generating an event and registering callback function/subroutine
  • 10. What they ignore (or less aware of) ➔ Application reload within milliseconds during development and deployment ➔ PM2 process manager for painless deployment and monitoring ➔ V8 engine performance ➔ Serving Tens of thousands of network connections with little memory overhead ➔ ES6 “yield” is here. ES7 “async” and “await” is not necessary ➔ Using Babel (transpiler) to emit ECMAScript 5 code ➔ RamdaJS and date-fp - functional replacement for collection and date API ➔ Programmable Module level polymorphism using CommonJS ➔ Isomorphism - Mobile devices, Browser, Server and NoSql DB query ➔ NodeJS Long Time Support - https://github.com/nodejs/LTS
  • 11. ES6 Basics and Generators
  • 12. ECMAScript 6 ● No semicolons ● Fat arrows (with bind feature) ● Template strings ● let - control scoping ● const - control assignments ● Destructuring ● Generator ○ Lazy collections ○ Avoid callbacks ○ Avoid promise (use but not creation) ● for-of loop All features :- http://es6-features.org/
  • 13. Must Have ESLint and FP plugin ● eslint - Takes care of JS language quirks ● eslint_plugin_fp - JS as pure FP language fp/no-arguments fp/no-mutating-methods fp/no-class fp/no-mutation fp/no-delete fp/no-nil fp/no-events fp/no-proxy fp/no-get-set fp/no-rest-parameters fp/no-let fp/no-this fp/no-loops fp/no-throw fp/no-mutating-assign fp/no-unused-expression no-var fp/no-valueof-field
  • 15. C S P for Dummies ➔ Don't communicate by sharing state, share state by communicating ➔ Communicating ◆ Conversation over channel/queues/distributed queues ◆ Remote procedure calls ➔ Sequential ◆ Execution flow ➔ Processess ◆ Coroutines ◆ Green threads (scheduled by VM) ◆ Real threads (scheduled by OS) ◆ OS Process ◆ Machines ◆ Cluster of Machines ➔ Original Paper - http://usingcsp.com/cspbook.pdf
  • 16. CSP vs Actor Model CSP Actor Model Process Identity Anonymous Concrete Message Passing Synchronous Asynchronous Communication Channels/Queues Direct Composition NA Applicable Fault Tolerance Easy to built with Distributed Queue Hierarchy of Local and Distributed Supervisors ➔ Hybrid approach is also viable and more practical
  • 18. Data - Structure and Types ● Data is all we have ● Data is what we need to transform in order to create a user experience ○ Photoshop without the images is nothing ○ Word is nothing without the characters ● Instructions are data too ● Immutability matters ○ Value - Always Immutable ○ State - Snapshot. Value of something at certain point of time ○ Identity - Stable logical entity associated with a series of different values over time ○ Time - Relative term, not physically measurable
  • 19. Computation - Function and HOF ● Higher Order Function (does either or both) ○ Accepts a function ○ Returns a function ● Higher order abstraction for ○ Computation ○ Combinators ○ DSL - Composition of computation and combinators
  • 20. Thinking functionally ● Use function as first class citizen to build abstraction ● Avoid mutation of variable(memory pointer handle) and data (state) ● Chant this mantra every morning, “null is a billion dollar mistake” ● Favour recursion over iteration ● Procure laziness with Streams ● Use expressions over statements ● Composition over inheritance ● Many identical functions for few data structures than few different functions for many data structures
  • 21. RamdaJS HOF Abstraction ● Auto Currying ● Abstraction Categories ○ Object ○ Function ○ List ○ Math ○ Logic ○ Relation ○ Type ● Transducers http://ramdajs.com/docs/
  • 23. Software Architecture in a nutshell “ In most successful software projects, the expert developers working on that project have a shared understanding of the design. This shared understanding is called ‘Architecture.’ This understanding includes how the system is divided into components and how the components interact through interfaces. These components are usually composed of smaller components, but the architecture only includes the components and interfaces that are understood by all the developers ” - Martin Fowler
  • 24. Abstraction and Indirection “ The essence of abstractions is preserving information that is relevant in a given context, and forgetting information that is irrelevant in that context ” – John V. Guttag “ In computer programming, indirection is the ability to reference something using a name, reference, or container instead of the value itself ” “ All problems in computer science can be solved by another level of indirection ….” - David Wheeler
  • 25. “ ….. except the problem of too many layers of indirection ” “ Making something easy to change makes the overall system a little more complex, and making everything easy to change makes the entire system very complex. Complexity is what makes software hard to change “
  • 27. Architecture decisions starts with “ Optimism is an occupational hazard of programming; feedback is the treatment. ” - Kent Beck ● Initial market research for given Business Domain ● Security ● Transaction capability and boundaries ● Online active users growth - total vs active vs online users ● Data growth ● Testability (and hence modularity) ● External integration points ● Response generation eagerness - sync, or async
  • 28. Micro Services done right ● It’s more social than technical ● Always start with monolith and scale gradually ● Scaling few business use cases ○ Computational complexity ○ Number of requests and responsiveness ● Scaling a business module ○ Computational complexity ○ Software as a Service ● Scaling a team ○ Programming platform expertise ○ Business Domain expertise ○ Maintenance ● Embrace async flow and Distributed Message Queues
  • 29. Use DDD iff Domain is Rich and Complex
  • 30. KoaJS ● By authors which gave us ExpressJS ● ES6 Framework ● Promise continuation based on “co” library ● Modular Architecture ● Composable ● Compatible with NodeJS 4.x and later ● Various community plugins http://koajs.com/
  • 31. PM2 Process Manager ● Superior version of “cluster” module ● Load Balancing & Zero second Downtime Reload ● Compatible with almost all major web frameworks ● CPU Process monitors ● Log monitors http://pm2.keymetrics.io/
  • 32. Hybrid Apps with Cordova
  • 34. Cordova Apps ● Written in HTML, CSS and JS ● Single codebase for multiple target platforms ○ Internet Browsers - IE, firefox, Chrome, Safari etc. ○ Mobile devices - Android, iOS, Windows etc. ● Webview - Chrome browser engine ● Fast development cycles compared to Native apps ● HTML5 Canvas for Game Programming ● Modern WebViews are as responsive as Native platform ● Access various device features through cordova plugins https://cordova.apache.org
  • 35. Features/Characteristics Hybrid Native Runs on Chrome browser runtime OS runtime Additional Runtime Crosswalk for 4.x, Not required for 5.x and later Not required Approximate Software artefact download size for say 10 screens 4.5 MB for 4.x, 3 MB for Android 5.x and later 4 MB Increase in download Size due to additional runtime 23 MB (one time) for Android 4.x and iOS 7 ZERO Development HTML, CSS and JS, More widely adopted tools Java for Android, Swift for iOS Required Tech Skills Anyone who knows web programming specific skill according to platform and native SDK Supported Platform Android, iOS, Windows, Symbian etc. only one platform Relative Development and Debugging time and responding to frequently changing business requirements 1x 2x to 3x Performance Responsive. can be tuned to minute level of browser runtime Best in class. Can be tuned to minute level to OS runtime Security Issues: Insecure local data storage Weak SSL implementation Unintended data leaks Reverse Engineering Code Injection Can be dealt Can be dealt Additional features supported Only major features are supported. here is the detailed list https://cordova.apache.org/docs/en/latest/guide/support/ All of which device is capable of
  • 37. ClojureScript ● by Rich Hickey ● Compiles to JS ● LISP - Code is Data is Code ● Macros - Homoiconicity ● Immutable Data Structures - Referential transparency ● Higher Order Functions - Sheer joy of computation ● Google Closure compiler - Lots of goodies including dead code elimination ● Figwheel - Interactive development ● Nice interop with JS and NPM ● Higher learning curve but worth it https://clojurescript.org/
  • 38. Reagent ● Based on React ○ Functional ○ Component based architecture ○ Higher order components ● Hiccup (embed HTML) ● reagent-utils ● re-frame https://reagent-project.github.io
  • 39. core.async ● CSP implementation for Clojure(Script) ● First class Goroutines support inspired by Go lang ● Being Reactive ○ Responsive - Rapid and consistent response time with reliable upper bounds ○ Resilient - replication, containment, isolation and delegation. ○ Elastic - responsive under varying workload, ability to add ○ Message Driven - loose coupling, isolation and location transparency. http://www.reactivemanifesto.org/