SlideShare a Scribd company logo
Feature-based JS apps
The naïve approach
ENGINEERING IMPLEMENTATIONS
A naive approach to feature based js apps
A naive approach to feature based js apps
A naive approach to feature based js apps
A naive approach to feature based js apps
A naive approach to feature based js apps
ROAD TO IDEA
A naive approach to feature based js apps
A naive approach to feature based js apps
A naive approach to feature based js apps
A naive approach to feature based js apps
ROAD TO SOLUTION
application = set of features​
features are pluggable
function shootOnTarget(model) {
// do stuffs
return newmodel;
}
const myApplication = globular.initializeApp(‘hockey-shot-recorder');
myApplication.extendWithFeature('shoot-on-target', shootOnTarget);
myApplication.executeFeature('shoot-on-target', {
“player”: 23,
“team”: “FTC”,
“period”: 1
});
application = set of features​
features are pluggable
outputs of features could be used in any number of views
class ShootOnTarget {
constructor() {
this.views = [];
}
execute(model) {
// do stuffs
this.views.forEach(view => {
view(newmodel);
});
}
pluginView(view) {
this.view.push(view);
}
}
const myApplication = globular.initializeApp('hockey-shot-record');
const shootOnTarget = new ShootOnTarget();
shootOnTarget.pluginView(model => {
// do stuffs
});
myApplication.extendWithFeature('shoot-on-target', shootOnTarget);
myApplication.executeFeature('shoot-on-target', {
"player": 23,
"team": "FTC",
"period": 1
});
application = set of features​
features are pluggable
outputs of features could be used in any number of views
features use common resources (e.g. persistency)​
class ShootOnTarget {
constructor({persistency, api}) {
this.persistency = persistency;
this.api = api;
this.views = [];
}
// …
// ‘execute()’ method refers to persistency and api props
// while doing its stuff
}
const myApplication = globular.initializeApp('hockey-shot-record');
const shootOnTarget = new ShootOnTarget({persistency, api}));
shootOnTarget.pluginView(model => {
// do stuffs
});
myApplication.extendWithFeature('shoot-on-target', shootOnTarget);
myApplication.executeFeature('shoot-on-target', {
"player": 97,
"team": "FTC",
"period": 1
});
const myApplication = globular.initializeApp('hockey-shot-record');
const shootOnTarget = new ShootOnTarget({persistency, api}));
shootOnTarget.pluginView(model => {
// do stuffs
});
myApplication.extendWithFeature('shoot-on-target', shootOnTarget);
myApplication.executeFeature('shoot-on-target', {
"player": 97,
"team": "FTC",
"period": 1
});
class ShootOnTarget {
constructor({persistency, api}) {
this.persistency = persistency;
this.api = api;
}
execute(model) {
// uses persistency/api and
// returns a promise
}
}
const myApplication = globular.initializeApp('hockey-shot-record');
myApplication.extendWithFeature('shoot-on-target', ShootOnTarget);
myApplication.getFeature('shoot-on-target').pluginView(model => {
// do stuffs
});
myApplication.executeFeature('shoot-on-target', {
"player": 11,
"team": "FTC",
"period": 1
});
WHY IS IT GOOD FOR ME?
testable applications via testing features
 pure Javascript/ES2015 implementations
 DOM-manipulation is out of app’s scope
focus on functionalities
WHAT IS IT, BY THE WAY?
A naive approach to feature based js apps
https://www.npmjs.com/package/globular
peppierre@gmail.com
@peppierre
peppierre

More Related Content

PDF
Android Wear Essentials
PDF
The 2016 Android Developer Toolbox [MOBILIZATION]
PDF
The 2016 Android Developer Toolbox [NANTES]
PPTX
Lightning talk Slides
PDF
jQquerysummit - Large-scale JavaScript Application Architecture
PDF
Design patterns - Common Solutions to Common Problems - Brad Wood
PDF
"Impact of front-end architecture on development cost", Viktor Turskyi
PDF
JavaScript Abstraction
Android Wear Essentials
The 2016 Android Developer Toolbox [MOBILIZATION]
The 2016 Android Developer Toolbox [NANTES]
Lightning talk Slides
jQquerysummit - Large-scale JavaScript Application Architecture
Design patterns - Common Solutions to Common Problems - Brad Wood
"Impact of front-end architecture on development cost", Viktor Turskyi
JavaScript Abstraction

More from Peter Abraham (6)

PPTX
We are professionals yet we make mistakes
PPTX
Orchestrating things in Angular application
PPTX
Discovering beautiful history of programming languages
PPTX
My thoughts about role of "Agile", in software engineering world.
PDF
CTO you would fall in love with
PDF
Pain in the J(S)
We are professionals yet we make mistakes
Orchestrating things in Angular application
Discovering beautiful history of programming languages
My thoughts about role of "Agile", in software engineering world.
CTO you would fall in love with
Pain in the J(S)
Ad

Recently uploaded (20)

PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
Digital Logic Computer Design lecture notes
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
additive manufacturing of ss316l using mig welding
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
Welding lecture in detail for understanding
PPTX
Sustainable Sites - Green Building Construction
DOCX
573137875-Attendance-Management-System-original
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
Construction Project Organization Group 2.pptx
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
CH1 Production IntroductoryConcepts.pptx
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Digital Logic Computer Design lecture notes
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
additive manufacturing of ss316l using mig welding
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Welding lecture in detail for understanding
Sustainable Sites - Green Building Construction
573137875-Attendance-Management-System-original
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Construction Project Organization Group 2.pptx
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
CH1 Production IntroductoryConcepts.pptx
Ad

A naive approach to feature based js apps

  • 1. Feature-based JS apps The naïve approach
  • 14. application = set of features​ features are pluggable
  • 15. function shootOnTarget(model) { // do stuffs return newmodel; } const myApplication = globular.initializeApp(‘hockey-shot-recorder'); myApplication.extendWithFeature('shoot-on-target', shootOnTarget); myApplication.executeFeature('shoot-on-target', { “player”: 23, “team”: “FTC”, “period”: 1 });
  • 16. application = set of features​ features are pluggable outputs of features could be used in any number of views
  • 17. class ShootOnTarget { constructor() { this.views = []; } execute(model) { // do stuffs this.views.forEach(view => { view(newmodel); }); } pluginView(view) { this.view.push(view); } }
  • 18. const myApplication = globular.initializeApp('hockey-shot-record'); const shootOnTarget = new ShootOnTarget(); shootOnTarget.pluginView(model => { // do stuffs }); myApplication.extendWithFeature('shoot-on-target', shootOnTarget); myApplication.executeFeature('shoot-on-target', { "player": 23, "team": "FTC", "period": 1 });
  • 19. application = set of features​ features are pluggable outputs of features could be used in any number of views features use common resources (e.g. persistency)​
  • 20. class ShootOnTarget { constructor({persistency, api}) { this.persistency = persistency; this.api = api; this.views = []; } // … // ‘execute()’ method refers to persistency and api props // while doing its stuff }
  • 21. const myApplication = globular.initializeApp('hockey-shot-record'); const shootOnTarget = new ShootOnTarget({persistency, api})); shootOnTarget.pluginView(model => { // do stuffs }); myApplication.extendWithFeature('shoot-on-target', shootOnTarget); myApplication.executeFeature('shoot-on-target', { "player": 97, "team": "FTC", "period": 1 });
  • 22. const myApplication = globular.initializeApp('hockey-shot-record'); const shootOnTarget = new ShootOnTarget({persistency, api})); shootOnTarget.pluginView(model => { // do stuffs }); myApplication.extendWithFeature('shoot-on-target', shootOnTarget); myApplication.executeFeature('shoot-on-target', { "player": 97, "team": "FTC", "period": 1 });
  • 23. class ShootOnTarget { constructor({persistency, api}) { this.persistency = persistency; this.api = api; } execute(model) { // uses persistency/api and // returns a promise } }
  • 24. const myApplication = globular.initializeApp('hockey-shot-record'); myApplication.extendWithFeature('shoot-on-target', ShootOnTarget); myApplication.getFeature('shoot-on-target').pluginView(model => { // do stuffs }); myApplication.executeFeature('shoot-on-target', { "player": 11, "team": "FTC", "period": 1 });
  • 25. WHY IS IT GOOD FOR ME?
  • 26. testable applications via testing features  pure Javascript/ES2015 implementations  DOM-manipulation is out of app’s scope focus on functionalities
  • 27. WHAT IS IT, BY THE WAY?

Editor's Notes

  • #2: intro of myself
  • #3: Why is it for? What is the purpose of this architecture?
  • #4: what you see: developer boxes meeting rooms  function: an office what you can do here: work talk to stakeholders
  • #5: what you see: ice rink seat practice rink function: an ice stadium what you can do here:  watch ice hockey games skating
  • #6: what you see: models views controllers function: an MVC app what you can do here:  ??? 
  • #7: what you see: components routing function: an Angular app what you can do here:  ??? 
  • #8: what you see:  goalie period shot team  function: an ice hockey shot recording and statistics software what you can do here:   record shots view game statistics
  • #10: 1992 Ivar Jacobson
  • #11: 1995 <div onclick=“alert(‘YIKES!’)”>..</div> nowadays: Node.JS
  • #12: 2016 Adam Rocska (Tumblr) yellow layer: out of our scope now provided by browser/device purple layer: application- AND context-dependent components vertically divided, no communication between input and output channel on this level only these components are allowed to communicate to layer above
  • #13: 2016 Adam Rocska (Tumblr) (cont.) yellow layer - again: persistency and API adapters should be separated from application code mockable green layer: application-dependent but context-independent components (may be) stateless THIS IS YOUR APPLICATION components in green layer input gateway: produces input boundary based on input input boundary: provides input model for feature implementation feature implementation: does what it must do and wraps output model into output boundary output boundary: provides output (view)model for presenter presenter: passes (view)model to view
  • #15: core criteria against feature-based application
  • #17: +1 criteria added: view-agnostic features
  • #20: +1 criteria added: supporting stateless features + clean code (responsibility) rule
  • #29: looked for a name. it gives a proper shape to an app => Angular would be fine reserved
  • #30: opposite kind of shape: Globular ;)