SlideShare a Scribd company logo
S
UI Components
Development Guidelines
Create life cycle
S Initiate
S Render
S Loading Meta
S Loading Template
S Loading Data
S Actual Render
S Create sub views/components
S Bind Internal events
S Bind External events
Remove life cycle
S Stop any running animations
S Unbind/stop listening external Events
S Unbind/stop listening internal Events
S Unbind loading complete/failure handlers (meta, template ,data)
S Abort any loading calls
S Clear timeouts, intervals, debounced/deferred executions
S Remove trails (popups)
S Remove Sub views / child components
S Remove element from DOM
Dependencies
S Meta (country list, options list)
S Template
S Data (user selection)
S Other components
Create States
S Initiated
S Waiting for other components to render
S Loading (meta, template, data)
S Rendered
S Custom States (edit, summary etc)
Error States
S Network/Time out (meta, template, data)
S No Records
S Invalid Input / Other service errors
S Wrong Selection
Selection States
S No Selection
S Default Selection
S All Selection
S Some Selection
View Model DOM sync
User
Interaction
updateModel Change
Change updateDOM
Update
Elements
Plan for
S Meta Refresh
S External Model manipulation
S Deep-linking widget state
S Widget defaults
Dos
S JSHINT code from day one, it saves a lot of errors and
debugging
S Use deferred for any async operation (loading, rendering)
S Handle success and failure case for each deferred
S Defer creating DOM elements more than 20
S Debounce function calls if needed
S Keep functions short, this increases re-usability
Dos ctnd..
S Cleanup all event handlers, setTimeouts and deferreds, they
are the main source of memory leaks
S Go defensive, start with error case then code for success case
S Provide user feedback about all waiting/loading to user, it
makes your app look snappy.
S Validate every user input, every input should have upper limit
S Sanitize user input if needed before posting it to server
Donts
S Don’t do DOM query for reading Widget state – should always be
read from model
S Don’t change elements outside given view, using $.closest,
$.parent $(‘selector’) is possible use cases
S Don’t update DOM without updating model, they are easy, but
creates problems in future
S Don’t use $.html(value) unless you know what you are doing,
prefer rendering model values through template engine
(handlebars etc)
S Don’t write JavaScript files bigger than 200 lines, smaller the
better.

More Related Content

PPT
Towards a Unified Business Strategy Language: a Meta-model of Strategy Maps
PPTX
Model-driven Strategic Awareness: From a Unified Business Strategy Meta-model...
PDF
Beck2
PDF
System Architecture Meta Model
PPTX
Meta cloud architecture for the mobile agile enterprise
PDF
この20年に見るシステム工学とインターネットテクノロジー
PDF
Everware cbdi-mm l1
PPT
Final Evaluation
Towards a Unified Business Strategy Language: a Meta-model of Strategy Maps
Model-driven Strategic Awareness: From a Unified Business Strategy Meta-model...
Beck2
System Architecture Meta Model
Meta cloud architecture for the mobile agile enterprise
この20年に見るシステム工学とインターネットテクノロジー
Everware cbdi-mm l1
Final Evaluation

Viewers also liked (20)

PPTX
Meta Model Parts
PPTX
Meta data migration
PDF
CMA-ES with local meta-models
PPTX
Cloud meta model
PDF
MR^3: Meta-Model Management based on RDFs Revision Reflection
PPTX
Quality, and the 7Loci Meta-Model as one of my 2016-2017 lectures at the Univ...
PPTX
COBI 2014 - An Empirical Evaluation of Capability Modelling using Design Rati...
PPTX
COBI 2014 - Designing a Meta Model as the Foundation for Compliance Capability
PDF
Applying Quality Function Deployment method for business architecture alignment
PDF
Practical meta-model extension for modeling language profiles An enterprise ar...
PPSX
Semantic Web Services Meta-model
PPTX
Web Service Capability Meta Model
PDF
Pbmr Ea Meta Model Poster V01.03
PPT
Modeling Business Strategy: A meta-model of Strategy Maps and Balance Scorecards
PPT
A common meta model for data analysis based on DSM
PDF
Archimate Meta Model
PDF
Introducing the Enterprise Transformation Meta Model
PDF
The Cha-Q Meta-Model: A Comprehensive, Change-Centric Software Representation
PPTX
An intro to building an architecture repository meta model and modeling frame...
PPT
Introduction to the NLP Meta Model - NLP Business Coaching Series
Meta Model Parts
Meta data migration
CMA-ES with local meta-models
Cloud meta model
MR^3: Meta-Model Management based on RDFs Revision Reflection
Quality, and the 7Loci Meta-Model as one of my 2016-2017 lectures at the Univ...
COBI 2014 - An Empirical Evaluation of Capability Modelling using Design Rati...
COBI 2014 - Designing a Meta Model as the Foundation for Compliance Capability
Applying Quality Function Deployment method for business architecture alignment
Practical meta-model extension for modeling language profiles An enterprise ar...
Semantic Web Services Meta-model
Web Service Capability Meta Model
Pbmr Ea Meta Model Poster V01.03
Modeling Business Strategy: A meta-model of Strategy Maps and Balance Scorecards
A common meta model for data analysis based on DSM
Archimate Meta Model
Introducing the Enterprise Transformation Meta Model
The Cha-Q Meta-Model: A Comprehensive, Change-Centric Software Representation
An intro to building an architecture repository meta model and modeling frame...
Introduction to the NLP Meta Model - NLP Business Coaching Series
Ad

Similar to Ui components development (20)

PPT
Building Rich User Experiences Without JavaScript Spaghetti
PDF
Gainesville Web Developer Group, Sept 2012
PPT
Developing For The Web
PDF
Maintainable Javascript carsonified
PPT
jQuery Performance Rules
PDF
Enabling Lean with Tech: lessons learned applying lean at paypal
PPTX
jQuery Conf 2012
PDF
Lean Engineering. Applying Lean Principles to Building Experiences
KEY
Single Page Applications - Desert Code Camp 2012
PPT
High Performance Ajax Applications 1197671494632682 2
PPT
High Performance Ajax Applications
PPTX
Mobile native-hacks
PDF
Agile Prototyping Best Practices
PDF
Prototyping like it is 2022
PDF
Amplify your stack - Jsfoo pune 2012
PDF
An approach to responsive, realtime with Backbone.js and WebSockets
PDF
The Lean Tech Stack
PDF
Unit Testing in JavaScript with MVC and QUnit
PPT
Vanjs backbone-powerpoint
PPT
Smarr Oscon 2007
Building Rich User Experiences Without JavaScript Spaghetti
Gainesville Web Developer Group, Sept 2012
Developing For The Web
Maintainable Javascript carsonified
jQuery Performance Rules
Enabling Lean with Tech: lessons learned applying lean at paypal
jQuery Conf 2012
Lean Engineering. Applying Lean Principles to Building Experiences
Single Page Applications - Desert Code Camp 2012
High Performance Ajax Applications 1197671494632682 2
High Performance Ajax Applications
Mobile native-hacks
Agile Prototyping Best Practices
Prototyping like it is 2022
Amplify your stack - Jsfoo pune 2012
An approach to responsive, realtime with Backbone.js and WebSockets
The Lean Tech Stack
Unit Testing in JavaScript with MVC and QUnit
Vanjs backbone-powerpoint
Smarr Oscon 2007
Ad

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
A Presentation on Artificial Intelligence
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Big Data Technologies - Introduction.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Empathic Computing: Creating Shared Understanding
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
cuic standard and advanced reporting.pdf
Encapsulation theory and applications.pdf
Network Security Unit 5.pdf for BCA BBA.
Mobile App Security Testing_ A Comprehensive Guide.pdf
Review of recent advances in non-invasive hemoglobin estimation
A Presentation on Artificial Intelligence
MIND Revenue Release Quarter 2 2025 Press Release
Dropbox Q2 2025 Financial Results & Investor Presentation
Spectroscopy.pptx food analysis technology
Big Data Technologies - Introduction.pptx
The AUB Centre for AI in Media Proposal.docx
Empathic Computing: Creating Shared Understanding
A comparative analysis of optical character recognition models for extracting...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Agricultural_Statistics_at_a_Glance_2022_0.pdf
sap open course for s4hana steps from ECC to s4
Advanced methodologies resolving dimensionality complications for autism neur...
“AI and Expert System Decision Support & Business Intelligence Systems”
Encapsulation_ Review paper, used for researhc scholars
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
cuic standard and advanced reporting.pdf

Ui components development

  • 2. Create life cycle S Initiate S Render S Loading Meta S Loading Template S Loading Data S Actual Render S Create sub views/components S Bind Internal events S Bind External events
  • 3. Remove life cycle S Stop any running animations S Unbind/stop listening external Events S Unbind/stop listening internal Events S Unbind loading complete/failure handlers (meta, template ,data) S Abort any loading calls S Clear timeouts, intervals, debounced/deferred executions S Remove trails (popups) S Remove Sub views / child components S Remove element from DOM
  • 4. Dependencies S Meta (country list, options list) S Template S Data (user selection) S Other components
  • 5. Create States S Initiated S Waiting for other components to render S Loading (meta, template, data) S Rendered S Custom States (edit, summary etc)
  • 6. Error States S Network/Time out (meta, template, data) S No Records S Invalid Input / Other service errors S Wrong Selection
  • 7. Selection States S No Selection S Default Selection S All Selection S Some Selection
  • 8. View Model DOM sync User Interaction updateModel Change Change updateDOM Update Elements
  • 9. Plan for S Meta Refresh S External Model manipulation S Deep-linking widget state S Widget defaults
  • 10. Dos S JSHINT code from day one, it saves a lot of errors and debugging S Use deferred for any async operation (loading, rendering) S Handle success and failure case for each deferred S Defer creating DOM elements more than 20 S Debounce function calls if needed S Keep functions short, this increases re-usability
  • 11. Dos ctnd.. S Cleanup all event handlers, setTimeouts and deferreds, they are the main source of memory leaks S Go defensive, start with error case then code for success case S Provide user feedback about all waiting/loading to user, it makes your app look snappy. S Validate every user input, every input should have upper limit S Sanitize user input if needed before posting it to server
  • 12. Donts S Don’t do DOM query for reading Widget state – should always be read from model S Don’t change elements outside given view, using $.closest, $.parent $(‘selector’) is possible use cases S Don’t update DOM without updating model, they are easy, but creates problems in future S Don’t use $.html(value) unless you know what you are doing, prefer rendering model values through template engine (handlebars etc) S Don’t write JavaScript files bigger than 200 lines, smaller the better.