SlideShare a Scribd company logo
1 of 20
Download to read offline
Sencha Best Practices:
Coworkee App
Marc Gusmano
Senior Sales Engineer
marc.gusmano@sencha.com
Agenda
• First decision: which toolkit?
• Best Practices
First decision: which toolkit?
• Need IE 9 or below?
• Need ARIA support?
- Use both toolkits
• Classic Toolkit for desktop/tablet
• Modern Toolkit for tablet/phone
• Otherwise…
- Use Modern Toolkit and profiles
3
Best Practice: Utilize Sencha Cmd
• Use Sencha Cmd to create the application
- sencha -sdk ~/aaExt/ext-6.5.2 generate app appBoth2 ./appBoth2
• sencha -sdk ~/aaExt/ext-6.5.2 generate app -modern appModern2 ./appModern2
• Use at least these Sencha Cmd functions
- sencha generate app
- sencha generate view
- sencha app watch
- sencha app build testing/development/production
4
Best Practice: Enforce common application naming and
structure
• Have folders for each type of class (model, store, view)
• Follow class namespace guidelines for views
• {appname}.{classtype}.{class}.{Class(type)}
• For example: MyApp.view.user.UserView
• (note: Sencha Cmd enforces these conventions)
5
sencha generate
This category contains code generators used to generate applications as well
as add new classes to the application.
Commands
* app - Generates a starter application
* controller - Generates a Controller for the current application
* form - Generates a Form for the current application (Sencha Touch Specific)
* model - Generates a Model for the current application
* package - Generates a starter package
* profile - Generates a Profile for the current application (Sencha Touch Specific)
* theme - Generates a theme page for slice operations (Ext JS Specific)
* view - Generates a View for the current application (Ext JS Specific)
* workspace - Initializes a multi-app workspace
6
Create new application with 4 views
• sencha -sdk ~/aaExt/ext-6.5.2 generate app -modern AppModern ./AppModern
• sencha generate view employee.EmployeeView
• sencha generate view organization.OrganizationView
• sencha generate view office.OfficeView
• sencha generate view activity.ActivityView
• sencha generate view viewport.ViewportView
• sencha generate view login.LoginView
• Add xtype to each: the name in all small letters ( ie: xtype: 'employeeview’,)
7
Best Practice: Application Resources
• Put all external resources in a resources/app folder
- Separate folders by type
- Images
- Data
- ETC.
• The ‘sencha app build’ will copy all resources (in the resources folder)
8
Best Practice: Universal Applications
• If using both toolkits
- app folder is for common code
- classic folder is for classic toolkit
- Modern folder is for modern toolkit
• If using modern toolkit only
- application.js has profiles section
- Each entry is a file name in the app/profile folder
- Different views can be defined in each profile file
9
Best Practice: Add routing to an application
Decision: need a login? If so…
• Remove mainview property in app.js
• sencha generate view viewport.ViewportView
• Add to Application.js
init: function () {
Ext.Viewport.setController({type: 'viewport-viewportview'});
Ext.Viewport.setViewModel({type: 'viewport-viewportview'});
},
ViewportViewController is all about routing
10
Best Practice: Add routing to an application
Decision: need a login? If not…
• Remove mainview property in app.js
• Add Launch function to application.js
• Do any pre-view work
• Create initial view
11
12
Viewport
LoginView MainView
Application
Menu ‘card’
• cls === xtype
• All scss in the sass folder in the same name as the class file
• Give a reference to every component you want to refer to in the ViewController
• *Put all references into properties of the ViewController in the init event
• In app.cs you can do this:
Ext.application({ name: 'AppCamp',extend: 'AppCamp.Application', requires: ['AppCamp.*'] });
makes code cleaner, detailed requires for the app not needed
still need requires for framework classes
any ‘unused’ app classes will get included
Best Practices for Ext JS Applications
Folder Structure
App
Model
Store
View
View1
View1Model.cs
View1Controller.cs
View1View.cs
Best Practices for Ext JS Applications
For Large multi-function app
Package
Function1
Model
Store
View
Function2
• Use class name as xtype with small letters: xtype: ’userview’
• Use app.json for additional file includes, if needed
• For class names, add the type as a suffix ( ie, GroupView.cs, , GroupModel.cs,
GroupView.cs, SalesStore.cs)
easier to know the purpose of the file just by reading the file name
• Use consistent spacing/tabbing in a class (I prefer 1 tab per indent)
• If a config/array has 1 item, put it on a single line
example: store: { type: 'personnel' }
• Create a splash screen
Best Practices for Ext JS Applications
• Organize common configs in each class to be in the same order
• No code in the view; use the ViewController for all code
• No css in the view, should be in the .scss file next to the view
• Have an ‘init’ function in all ViewControllers that define all referenced variables
• Use consistent naming pattern for ViewController event
( if reference is ‘reportcombo’ and event is ‘change’,
the ViewController event is ‘onReportComboChange’)
• Use the launch function in application.js to create root view with the viewport plugin instead
of the mainView property in app.js
Ext.create(’MyApp.view.main.Main',{ plugins: 'viewport' });
Best Practices for Ext JS Applications
• Use ‘Sencha App Build Production’ to create production-ready application
• Use Sencha Packages as approach for sharing common code/components
• Use a static component for global variables and functions
Best Practices for Ext JS Applications
18
Ext JS
Stencils
Sencha
Architect
UI Design IDE with
Sencha
Plugin
Sencha
Test
Studio
Sencha
Inspector
Workspace
/ App
Continuous
Integration
Environment
Bug
Reporting
from
CI
Best Practice: Use Sencha Tools
Ext JS Code
Unit Tests
Code Fixes
Sencha
Themer
Theme Fixes
Theme Changes
CI Reporting
Ext JS Code
Version
Control
Version
Control
Ext JS
Framework
Questions?
Sencha Roadshow 2017: Sencha Best Practices: Coworkee App

More Related Content

What's hot

AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave TaylorAtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor
Atlassian
 
Hanselman lipton asp_connections_ams304_mvc
Hanselman lipton asp_connections_ams304_mvcHanselman lipton asp_connections_ams304_mvc
Hanselman lipton asp_connections_ams304_mvc
denemedeniz
 
Javascript framework and backbone
Javascript framework and backboneJavascript framework and backbone
Javascript framework and backbone
Daniel Lv
 

What's hot (20)

Oracle 12c Launch Event 01 JDeveloper Jonathan Damen and Marcel Oldenkamp
Oracle 12c Launch Event 01 JDeveloper Jonathan Damen and Marcel OldenkampOracle 12c Launch Event 01 JDeveloper Jonathan Damen and Marcel Oldenkamp
Oracle 12c Launch Event 01 JDeveloper Jonathan Damen and Marcel Oldenkamp
 
ExtJS: La piattaforma vincente (tools)
ExtJS: La piattaforma vincente (tools)ExtJS: La piattaforma vincente (tools)
ExtJS: La piattaforma vincente (tools)
 
Bootstrap4XPages webinar
Bootstrap4XPages webinarBootstrap4XPages webinar
Bootstrap4XPages webinar
 
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave TaylorAtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor
 
Simplifying End-user Drupal 7 Content Administration
Simplifying End-user Drupal 7 Content Administration Simplifying End-user Drupal 7 Content Administration
Simplifying End-user Drupal 7 Content Administration
 
Top 20 mistakes you will make on your 1st Drupal project
Top 20 mistakes you will make on your 1st Drupal projectTop 20 mistakes you will make on your 1st Drupal project
Top 20 mistakes you will make on your 1st Drupal project
 
ExtJS: La piattaforma vincente
ExtJS: La piattaforma vincenteExtJS: La piattaforma vincente
ExtJS: La piattaforma vincente
 
Drupal & AngularJS - DrupalCamp Spain 2014
Drupal & AngularJS - DrupalCamp Spain 2014Drupal & AngularJS - DrupalCamp Spain 2014
Drupal & AngularJS - DrupalCamp Spain 2014
 
Style guides in drupal development workflows
Style guides in drupal development workflowsStyle guides in drupal development workflows
Style guides in drupal development workflows
 
Hanselman lipton asp_connections_ams304_mvc
Hanselman lipton asp_connections_ams304_mvcHanselman lipton asp_connections_ams304_mvc
Hanselman lipton asp_connections_ams304_mvc
 
Integrating AngularJS with Drupal 7
Integrating AngularJS with Drupal 7Integrating AngularJS with Drupal 7
Integrating AngularJS with Drupal 7
 
DNN Database Tips & Tricks
DNN Database Tips & TricksDNN Database Tips & Tricks
DNN Database Tips & Tricks
 
Javascript framework and backbone
Javascript framework and backboneJavascript framework and backbone
Javascript framework and backbone
 
Mvvm knockout vs angular
Mvvm knockout vs angularMvvm knockout vs angular
Mvvm knockout vs angular
 
Drupal 8 Deep Dive: Plugin System
Drupal 8 Deep Dive: Plugin SystemDrupal 8 Deep Dive: Plugin System
Drupal 8 Deep Dive: Plugin System
 
Moving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMSMoving from PHP to a nodejs full stack CMS
Moving from PHP to a nodejs full stack CMS
 
Building Angular Component Libraries
Building Angular Component LibrariesBuilding Angular Component Libraries
Building Angular Component Libraries
 
OpenMRS Reference Application, Getting Started
OpenMRS Reference Application, Getting StartedOpenMRS Reference Application, Getting Started
OpenMRS Reference Application, Getting Started
 
Drupal Presentation for CapitalCamp 2011: Features Driven Development
Drupal Presentation for CapitalCamp 2011: Features Driven DevelopmentDrupal Presentation for CapitalCamp 2011: Features Driven Development
Drupal Presentation for CapitalCamp 2011: Features Driven Development
 
Media handling in Drupal (Drupalcamp Leuven 2013)
Media handling in Drupal (Drupalcamp Leuven 2013)Media handling in Drupal (Drupalcamp Leuven 2013)
Media handling in Drupal (Drupalcamp Leuven 2013)
 

Viewers also liked

Viewers also liked (16)

SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
 
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data GridLeveraging React and GraphQL to Create a Performant, Scalable Data Grid
Leveraging React and GraphQL to Create a Performant, Scalable Data Grid
 
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React AppsIntroducing ExtReact: Adding Powerful Sencha Components to React Apps
Introducing ExtReact: Adding Powerful Sencha Components to React Apps
 
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
 
Building Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff StanoBuilding Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff Stano
 
Sencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop FirstSencha Roadshow 2017: Mobile First or Desktop First
Sencha Roadshow 2017: Mobile First or Desktop First
 
Learn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research ReportLearn Key Insights from The State of Web Application Testing Research Report
Learn Key Insights from The State of Web Application Testing Research Report
 
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App TestingSencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
Sencha Roadshow 2017: Best Practices for Implementing Continuous Web App Testing
 
Sencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha TestSencha Roadshow 2017: What's New in Sencha Test
Sencha Roadshow 2017: What's New in Sencha Test
 
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
 
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
SenchaCon 2016: Mobile First? Desktop First? Or Should you Think Universal Ap...
 
Ext JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell SimeonsExt JS Architecture Best Practices - Mitchell Simeons
Ext JS Architecture Best Practices - Mitchell Simeons
 
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
 
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
 
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
Sencha Roadshow 2017: BufferedStore Internals featuring eyeworkers interactiv...
 
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
 

Similar to Sencha Roadshow 2017: Sencha Best Practices: Coworkee App

Similar to Sencha Roadshow 2017: Sencha Best Practices: Coworkee App (20)

Architecting iOS Project
Architecting iOS ProjectArchitecting iOS Project
Architecting iOS Project
 
iOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for BeginnersiOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for Beginners
 
Lec005 android start_program
Lec005 android start_programLec005 android start_program
Lec005 android start_program
 
How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkHow to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular Framework
 
GTU Asp.net Project Training Guidelines
GTU Asp.net Project Training GuidelinesGTU Asp.net Project Training Guidelines
GTU Asp.net Project Training Guidelines
 
iOS Application Exploitation
iOS Application ExploitationiOS Application Exploitation
iOS Application Exploitation
 
Expanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate UsabilityExpanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate Usability
 
Client Building Functional webapps.
Client   Building Functional webapps.Client   Building Functional webapps.
Client Building Functional webapps.
 
XPages -Beyond the Basics
XPages -Beyond the BasicsXPages -Beyond the Basics
XPages -Beyond the Basics
 
Android Studio development model and.pptx
Android Studio development model and.pptxAndroid Studio development model and.pptx
Android Studio development model and.pptx
 
Creating Developer-Friendly Docker Containers with Chaperone
Creating Developer-Friendly Docker Containers with ChaperoneCreating Developer-Friendly Docker Containers with Chaperone
Creating Developer-Friendly Docker Containers with Chaperone
 
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
 
Rapidly prototyping web applications using BackPress
Rapidly prototyping web applications using BackPressRapidly prototyping web applications using BackPress
Rapidly prototyping web applications using BackPress
 
Android Training Ahmedabad , Android Course Ahmedabad, Android architecture
Android Training Ahmedabad , Android Course Ahmedabad, Android architectureAndroid Training Ahmedabad , Android Course Ahmedabad, Android architecture
Android Training Ahmedabad , Android Course Ahmedabad, Android architecture
 
My web application in 20 minutes with Telosys
My web application in 20 minutes with Telosys My web application in 20 minutes with Telosys
My web application in 20 minutes with Telosys
 
Mon application web en 20 minutes
Mon application web en 20 minutesMon application web en 20 minutes
Mon application web en 20 minutes
 
CUST-3 Document Management with Share
CUST-3 Document Management with ShareCUST-3 Document Management with Share
CUST-3 Document Management with Share
 
Code Quality Management iOS
Code Quality Management iOSCode Quality Management iOS
Code Quality Management iOS
 
Basic Android
Basic AndroidBasic Android
Basic Android
 
Android app development lesson 1
Android app development lesson 1Android app development lesson 1
Android app development lesson 1
 

More from Sencha

More from Sencha (10)

Breathe New Life into Your Existing JavaScript Applications with Web Components
Breathe New Life into Your Existing JavaScript Applications with Web ComponentsBreathe New Life into Your Existing JavaScript Applications with Web Components
Breathe New Life into Your Existing JavaScript Applications with Web Components
 
Ext JS 6.6 Highlights
Ext JS 6.6 HighlightsExt JS 6.6 Highlights
Ext JS 6.6 Highlights
 
SenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil Manvar
SenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil ManvarSenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil Manvar
SenchaCon 2016: Developing and Delivering Quality Code, Frequently - Neil Manvar
 
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...
SenchaCon 2016: Creating a Flexible and Usable Industry Specific Solution - D...
 
SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy
SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory HardySenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy
SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy
 
SenchaCon 2016: Using Ext JS 6 for Cross-Platform Development on Mobile - And...
SenchaCon 2016: Using Ext JS 6 for Cross-Platform Development on Mobile - And...SenchaCon 2016: Using Ext JS 6 for Cross-Platform Development on Mobile - And...
SenchaCon 2016: Using Ext JS 6 for Cross-Platform Development on Mobile - And...
 
SenchaCon 2016: Handling Undo-Redo in Sencha Applications - Nickolay Platonov
SenchaCon 2016: Handling Undo-Redo in Sencha Applications - Nickolay PlatonovSenchaCon 2016: Handling Undo-Redo in Sencha Applications - Nickolay Platonov
SenchaCon 2016: Handling Undo-Redo in Sencha Applications - Nickolay Platonov
 
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
 
SenchaCon 2016: Turbocharge your Ext JS App - Per Minborg, Anselm McClain, Jo...
SenchaCon 2016: Turbocharge your Ext JS App - Per Minborg, Anselm McClain, Jo...SenchaCon 2016: Turbocharge your Ext JS App - Per Minborg, Anselm McClain, Jo...
SenchaCon 2016: Turbocharge your Ext JS App - Per Minborg, Anselm McClain, Jo...
 
SenchaCon 2016: Integrating Geospatial Maps & Big Data Using CartoDB via Ext ...
SenchaCon 2016: Integrating Geospatial Maps & Big Data Using CartoDB via Ext ...SenchaCon 2016: Integrating Geospatial Maps & Big Data Using CartoDB via Ext ...
SenchaCon 2016: Integrating Geospatial Maps & Big Data Using CartoDB via Ext ...
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

Sencha Roadshow 2017: Sencha Best Practices: Coworkee App

  • 1. Sencha Best Practices: Coworkee App Marc Gusmano Senior Sales Engineer marc.gusmano@sencha.com
  • 2. Agenda • First decision: which toolkit? • Best Practices
  • 3. First decision: which toolkit? • Need IE 9 or below? • Need ARIA support? - Use both toolkits • Classic Toolkit for desktop/tablet • Modern Toolkit for tablet/phone • Otherwise… - Use Modern Toolkit and profiles 3
  • 4. Best Practice: Utilize Sencha Cmd • Use Sencha Cmd to create the application - sencha -sdk ~/aaExt/ext-6.5.2 generate app appBoth2 ./appBoth2 • sencha -sdk ~/aaExt/ext-6.5.2 generate app -modern appModern2 ./appModern2 • Use at least these Sencha Cmd functions - sencha generate app - sencha generate view - sencha app watch - sencha app build testing/development/production 4
  • 5. Best Practice: Enforce common application naming and structure • Have folders for each type of class (model, store, view) • Follow class namespace guidelines for views • {appname}.{classtype}.{class}.{Class(type)} • For example: MyApp.view.user.UserView • (note: Sencha Cmd enforces these conventions) 5
  • 6. sencha generate This category contains code generators used to generate applications as well as add new classes to the application. Commands * app - Generates a starter application * controller - Generates a Controller for the current application * form - Generates a Form for the current application (Sencha Touch Specific) * model - Generates a Model for the current application * package - Generates a starter package * profile - Generates a Profile for the current application (Sencha Touch Specific) * theme - Generates a theme page for slice operations (Ext JS Specific) * view - Generates a View for the current application (Ext JS Specific) * workspace - Initializes a multi-app workspace 6
  • 7. Create new application with 4 views • sencha -sdk ~/aaExt/ext-6.5.2 generate app -modern AppModern ./AppModern • sencha generate view employee.EmployeeView • sencha generate view organization.OrganizationView • sencha generate view office.OfficeView • sencha generate view activity.ActivityView • sencha generate view viewport.ViewportView • sencha generate view login.LoginView • Add xtype to each: the name in all small letters ( ie: xtype: 'employeeview’,) 7
  • 8. Best Practice: Application Resources • Put all external resources in a resources/app folder - Separate folders by type - Images - Data - ETC. • The ‘sencha app build’ will copy all resources (in the resources folder) 8
  • 9. Best Practice: Universal Applications • If using both toolkits - app folder is for common code - classic folder is for classic toolkit - Modern folder is for modern toolkit • If using modern toolkit only - application.js has profiles section - Each entry is a file name in the app/profile folder - Different views can be defined in each profile file 9
  • 10. Best Practice: Add routing to an application Decision: need a login? If so… • Remove mainview property in app.js • sencha generate view viewport.ViewportView • Add to Application.js init: function () { Ext.Viewport.setController({type: 'viewport-viewportview'}); Ext.Viewport.setViewModel({type: 'viewport-viewportview'}); }, ViewportViewController is all about routing 10
  • 11. Best Practice: Add routing to an application Decision: need a login? If not… • Remove mainview property in app.js • Add Launch function to application.js • Do any pre-view work • Create initial view 11
  • 13. • cls === xtype • All scss in the sass folder in the same name as the class file • Give a reference to every component you want to refer to in the ViewController • *Put all references into properties of the ViewController in the init event • In app.cs you can do this: Ext.application({ name: 'AppCamp',extend: 'AppCamp.Application', requires: ['AppCamp.*'] }); makes code cleaner, detailed requires for the app not needed still need requires for framework classes any ‘unused’ app classes will get included Best Practices for Ext JS Applications
  • 14. Folder Structure App Model Store View View1 View1Model.cs View1Controller.cs View1View.cs Best Practices for Ext JS Applications For Large multi-function app Package Function1 Model Store View Function2
  • 15. • Use class name as xtype with small letters: xtype: ’userview’ • Use app.json for additional file includes, if needed • For class names, add the type as a suffix ( ie, GroupView.cs, , GroupModel.cs, GroupView.cs, SalesStore.cs) easier to know the purpose of the file just by reading the file name • Use consistent spacing/tabbing in a class (I prefer 1 tab per indent) • If a config/array has 1 item, put it on a single line example: store: { type: 'personnel' } • Create a splash screen Best Practices for Ext JS Applications
  • 16. • Organize common configs in each class to be in the same order • No code in the view; use the ViewController for all code • No css in the view, should be in the .scss file next to the view • Have an ‘init’ function in all ViewControllers that define all referenced variables • Use consistent naming pattern for ViewController event ( if reference is ‘reportcombo’ and event is ‘change’, the ViewController event is ‘onReportComboChange’) • Use the launch function in application.js to create root view with the viewport plugin instead of the mainView property in app.js Ext.create(’MyApp.view.main.Main',{ plugins: 'viewport' }); Best Practices for Ext JS Applications
  • 17. • Use ‘Sencha App Build Production’ to create production-ready application • Use Sencha Packages as approach for sharing common code/components • Use a static component for global variables and functions Best Practices for Ext JS Applications
  • 18. 18 Ext JS Stencils Sencha Architect UI Design IDE with Sencha Plugin Sencha Test Studio Sencha Inspector Workspace / App Continuous Integration Environment Bug Reporting from CI Best Practice: Use Sencha Tools Ext JS Code Unit Tests Code Fixes Sencha Themer Theme Fixes Theme Changes CI Reporting Ext JS Code Version Control Version Control Ext JS Framework