SlideShare una empresa de Scribd logo
1 de 48
Descargar para leer sin conexión
A Mobile App
                Development Toolkit
                Rebecca Murphey & Dan Imal
                Boston Front End Developer Meetup
                January 2012



Tuesday, January 24, 12
Rebecca Murphey
                          Lead JavaScript Developer
                          @rmurphey

                          Dan Imal
                          Senior User Experience Developer
                          @mrdanimal



Tuesday, January 24, 12
Tuesday, January 24, 12
linkage
                mulberry.toura.com
                bit.ly/toura-mulberry
                bit.ly/toura-mulberry-demos




Tuesday, January 24, 12
Tuesday, January 24, 12
Tuesday, January 24, 12
command line tools
                scaffold your app and
                generate skeleton
                 les for the pieces
                you’ll need
                application code
                harness a powerful
                CSS and JavaScript
                framework to develop
                rich interfaces
                app builder
                generates production-
                ready builds for
                Android, iOS (mobile
                web is on the way)


Tuesday, January 24, 12
Callback
               Cordova


Tuesday, January 24, 12
$ mulberry scaffold recipes




Tuesday, January 24, 12
Tuesday, January 24, 12
Tuesday, January 24, 12
$ mulberry generate




Tuesday, January 24, 12
dramatic pause.




Tuesday, January 24, 12
Tuesday, January 24, 12
create content with
                          yaml, markdown & html




Tuesday, January 24, 12
create functionality with javascript




Tuesday, January 24, 12
create styles with css & sass




Tuesday, January 24, 12
Tuesday, January 24, 12
$ mulberry serve




Tuesday, January 24, 12
ohai sane development tools.




Tuesday, January 24, 12
$ mulberry test




Tuesday, January 24, 12
Tuesday, January 24, 12
Tuesday, January 24, 12
$ mulberry deploy




Tuesday, January 24, 12
it’s just javascript.
                (ok, and some haml, yaml, & sass.)




Tuesday, January 24, 12
todos:
                            capabilities:
                            - name: PageTodos
                            screens:
                              - name: index
                                regions:
                                  - components:
                                     - custom.TodoForm
                                  - className: list
                                    scrollable: true
                                    components:
                                     - custom.TodoList
                                  - components:
                                     - custom.TodoTools




                          NB: You can define this with JavaScript, too,
                          using toura.pageDef(‘todos’, { ... }).




Tuesday, January 24, 12
$YOURAPP/javascript/routes.js

        mulberry.page('/todos', {
          name : 'Todos',
          pageDef : 'todos'
        }, true);

        mulberry.page('/completed', {
          name : 'Completed',
          pageDef : 'completed'
        });




                                        #/todos   #/completed

Tuesday, January 24, 12
$YOURAPP/javascript/components/TodoForm.js


           mulberry.component('TodoForm', {
             componentTemplate : dojo.cache('client.components', 'TodoForm/TodoForm.haml'),

               init : function() {
                 this.connect(this.domNode, 'submit', function(e) {
                   e.preventDefault();

                      var description = dojo.trim(this.descriptionInput.value),
                          item;

                      if (!description) { return; }

                      item = { description : description };
                      this.domNode.reset();
                      this.onAdd(item);
                    });
               },

             onAdd : function(item) { }
           });




Tuesday, January 24, 12
$YOURAPP/javascript/components/TodoForm/TodoForm.haml

                 %form.component.todo-form
                   %input{ placeholder : 'New todo', dojoAttachPoint : 'descriptionInput' }
                   %button{ dojoAttachPoint : 'saveButton' } Add




Tuesday, January 24, 12
$YOURAPP/javascript/stores/todos.js

                mulberry.store('todos', {
                  model : 'Todo',

                    finish : function(id) {
                       this.invoke(id, 'finish');
                    },

                  unfinish : function(id) {
                    this.invoke(id, 'unfinish');
                  }
                });




Tuesday, January 24, 12
$YOURAPP/javascript/models/Todo.js

                mulberry.model('Todo', {
                  complete : false,

                    finish : function() {
                       this.set('complete', true);
                    },

                  unfinish : function() {
                    this.set('complete', false);
                  }
                });




Tuesday, January 24, 12
@touradev @rmurphey @mrdanimal
                mulberry.toura.com
                bit.ly/toura-mulberry
                bit.ly/toura-mulberry-demos


Tuesday, January 24, 12
Tuesday, January 24, 12
routes manage high-level application state
                components receive and render data,
                and react to user input
                capabilities provide data to components,
                and broker communications between them
                page de nitions reusable groupings
                of components and capabilities
                stores persist data on the device, make that
                data query-able, and return model instances


Tuesday, January 24, 12
routes manage high-level application state




Tuesday, January 24, 12
$YOURAPP/javascript/routes.js

        mulberry.page('/todos', {
          name : 'Todos',
          pageDef : 'todos'
        }, true);

        mulberry.page('/completed', {
          name : 'Completed',
          pageDef : 'completed'
        });




                                        #/todos   #/completed

Tuesday, January 24, 12
stores persist data on the device, make that
                data query-able, and return model instances




Tuesday, January 24, 12
$YOURAPP/javascript/stores/todos.js

                      mulberry.store('todos', {
                        model : 'Todo',

                          finish : function(id) {
                             this.invoke(id, 'finish');
                          },

                        unfinish : function(id) {
                          this.invoke(id, 'unfinish');
                        }
                      });




Tuesday, January 24, 12
page de nitions reusable groupings
                of components and capabilities




Tuesday, January 24, 12
todos:
                            capabilities:
                            - name: PageTodos
                            screens:
                              - name: index
                                regions:
                                  - components:
                                     - custom.TodoForm
                                  - className: list
                                    scrollable: true
                                    components:
                                     - custom.TodoList
                                  - components:
                                     - custom.TodoTools




                          NB: You can define this with JavaScript, too,
                          using toura.pageDef(‘todos’, { ... }).




Tuesday, January 24, 12
components receive and render data,
                and react to user input




Tuesday, January 24, 12
$YOURAPP/javascript/components/TodoForm.js


           mulberry.component('TodoForm', {
             componentTemplate : dojo.cache('client.components', 'TodoForm/TodoForm.haml'),

               init : function() {
                 this.connect(this.domNode, 'submit', function(e) {
                   e.preventDefault();

                      var description = dojo.trim(this.descriptionInput.value),
                          item;

                      if (!description) { return; }

                      item = { description : description };
                      this.domNode.reset();
                      this.onAdd(item);
                    });
               },

             onAdd : function(item) { }
           });




Tuesday, January 24, 12
$YOURAPP/javascript/components/TodoForm/TodoForm.haml

                 %form.component.todo-form
                   %input{ placeholder : 'New todo', dojoAttachPoint : 'descriptionInput' }
                   %button{ dojoAttachPoint : 'saveButton' } Add




Tuesday, January 24, 12
$YOURAPP/javascript/components/TodoForm.js


           mulberry.component('TodoForm', {
             componentTemplate : dojo.cache('client.components', 'TodoForm/TodoForm.haml'),

               init : function() {
                 this.connect(this.domNode, 'submit', function(e) {
                   e.preventDefault();

                      var description = dojo.trim(this.descriptionInput.value),
                          item;

                      if (!description) { return; }

                      item = { description : description };
                      this.domNode.reset();
                      this.onAdd(item);
                    });
               },

             onAdd : function(item) { }
           });




Tuesday, January 24, 12
capabilities provide data to components,
                and broker communications between them




Tuesday, January 24, 12
mulberry.capability('PageTodos', {
            todos:
                                              requirements : {
              capabilities:
                                                 todoList : 'custom.TodoList',
              - name: PageTodos
                                                 todoForm : 'custom.TodoForm',
              screens:
                                                 todoTools : 'custom.TodoTools'
                - name: index
                                              },
                  regions:
                    - components:
                                              connects : [
                       - custom.TodoForm
                                                 [ 'todoForm', 'onAdd', '_add' ],
                    - className: list
                                                 [ 'todoList', 'onComplete', '_complete' ],
                      scrollable: true
                                                 [ 'todoList', 'onDelete', '_delete' ],
                      components:
                                                 [ 'todoTools', 'onCompleteAll', '_completeAll' ]
                       - custom.TodoList
                                              ],
                    - components:
                       - custom.TodoTools
                                              init : function() {
                                                 this.todos = client.stores.todos;
                                                 this._updateList();
                                              },

                                              _add : function(item) {
                                                 this.todos.add(item);
                                                 this._updateList();
                                              },

                                             _delete : function(id) {
                                                 this.todos.remove(id);
                                                 this._updateList();
                                              },


Tuesday, January 24, 12                       _complete : function(id) {
mulberry.capability('PageTodos', {
            todos:
                                              requirements : {
              capabilities:
                                                 todoList : 'custom.TodoList',
              - name: PageTodos
                                                 todoForm : 'custom.TodoForm',
              screens:
                                                 todoTools : 'custom.TodoTools'
                - name: index
                                              },
                  regions:
                    - components:
                                              connects : [
                       - custom.TodoForm
                                                 [ 'todoForm', 'onAdd', '_add' ],
                    - className: list
                                                 [ 'todoList', 'onComplete', '_complete' ],
                      scrollable: true
                                                 [ 'todoList', 'onDelete', '_delete' ],
                      components:
                                                 [ 'todoTools', 'onCompleteAll', '_completeAll' ]
                       - custom.TodoList
                                              ],
                    - components:
                       - custom.TodoTools
                                              init : function() {
                                                 this.todos = client.stores.todos;
                                                 this._updateList();
                                              },

                                              _add : function(item) {
                                                 this.todos.add(item);
                                                 this._updateList();
                                              },

                                             _delete : function(id) {
                                                 this.todos.remove(id);
                                                 this._updateList();
                                              },


Tuesday, January 24, 12                       _complete : function(id) {
mulberry.capability('PageTodos', {
            todos:
                                              requirements : {
              capabilities:
                                                 todoList : 'custom.TodoList',
              - name: PageTodos
                                                 todoForm : 'custom.TodoForm',
              screens:
                                                 todoTools : 'custom.TodoTools'
                - name: index
                                              },
                  regions:
                    - components:
                                              connects : [
                       - custom.TodoForm
                                                 [ 'todoForm', 'onAdd', '_add' ],
                    - className: list
                                                 [ 'todoList', 'onComplete', '_complete' ],
                      scrollable: true
                                                 [ 'todoList', 'onDelete', '_delete' ],
                      components:
                                                 [ 'todoTools', 'onCompleteAll', '_completeAll' ]
                       - custom.TodoList
                                              ],
                    - components:
                       - custom.TodoTools
                                              init : function() {
                                                 this.todos = client.stores.todos;
                                                 this._updateList();
                                              },

                                              _add : function(item) {
                                                 this.todos.add(item);
                                                 this._updateList();
                                              },

                                             _delete : function(id) {
                                                 this.todos.remove(id);
                                                 this._updateList();
                                              },


Tuesday, January 24, 12                       _complete : function(id) {

Más contenido relacionado

Destacado

Proyectos Tecnológicos
Proyectos TecnológicosProyectos Tecnológicos
Proyectos Tecnológicos
guestd0064fb
 
Tecnologia cuarto
Tecnologia cuartoTecnologia cuarto
Tecnologia cuarto
Leonel47
 
Influencia de la_tecnologia_en_la_sociedad
Influencia de la_tecnologia_en_la_sociedadInfluencia de la_tecnologia_en_la_sociedad
Influencia de la_tecnologia_en_la_sociedad
KagomeNekosawa
 
Proyecto Tecnologico Para 4° Y 5° De Primaria
Proyecto Tecnologico Para 4° Y 5° De PrimariaProyecto Tecnologico Para 4° Y 5° De Primaria
Proyecto Tecnologico Para 4° Y 5° De Primaria
guestc14d1b
 
Ejemplo de un proyecto de tecnología
Ejemplo de un proyecto de tecnologíaEjemplo de un proyecto de tecnología
Ejemplo de un proyecto de tecnología
Gabriel Diaz
 
Proyecto Reciclaje
Proyecto ReciclajeProyecto Reciclaje
Proyecto Reciclaje
aletopher94
 

Destacado (11)

Proyectos Tecnológicos
Proyectos TecnológicosProyectos Tecnológicos
Proyectos Tecnológicos
 
Tecnologia cuarto
Tecnologia cuartoTecnologia cuarto
Tecnologia cuarto
 
Influencia de la_tecnologia_en_la_sociedad
Influencia de la_tecnologia_en_la_sociedadInfluencia de la_tecnologia_en_la_sociedad
Influencia de la_tecnologia_en_la_sociedad
 
Introduction to Business Strategy Development & Strategy Execution
Introduction to Business Strategy Development & Strategy ExecutionIntroduction to Business Strategy Development & Strategy Execution
Introduction to Business Strategy Development & Strategy Execution
 
Proyecto Tecnologico Para 4° Y 5° De Primaria
Proyecto Tecnologico Para 4° Y 5° De PrimariaProyecto Tecnologico Para 4° Y 5° De Primaria
Proyecto Tecnologico Para 4° Y 5° De Primaria
 
Proyecto Tecnologico
Proyecto TecnologicoProyecto Tecnologico
Proyecto Tecnologico
 
Ejemplo de un proyecto de tecnología
Ejemplo de un proyecto de tecnologíaEjemplo de un proyecto de tecnología
Ejemplo de un proyecto de tecnología
 
Proyecto de reciclaje 2014
Proyecto de reciclaje 2014Proyecto de reciclaje 2014
Proyecto de reciclaje 2014
 
Secuencia didáctica Tecnología-herramientas manuales 1º grado
Secuencia didáctica Tecnología-herramientas manuales 1º gradoSecuencia didáctica Tecnología-herramientas manuales 1º grado
Secuencia didáctica Tecnología-herramientas manuales 1º grado
 
Proyecto Reciclaje
Proyecto ReciclajeProyecto Reciclaje
Proyecto Reciclaje
 
PROYECTO RECICLAR PARA CREAR ARTE
PROYECTO RECICLAR PARA CREAR ARTEPROYECTO RECICLAR PARA CREAR ARTE
PROYECTO RECICLAR PARA CREAR ARTE
 

Similar a Getting Started with Mulberry

Web applications with Catalyst
Web applications with CatalystWeb applications with Catalyst
Web applications with Catalyst
svilen.ivanov
 

Similar a Getting Started with Mulberry (20)

jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
 
JQuery In Drupal
JQuery In DrupalJQuery In Drupal
JQuery In Drupal
 
JavaScript in Drupal 7: What developers need to know
JavaScript in Drupal 7: What developers need to knowJavaScript in Drupal 7: What developers need to know
JavaScript in Drupal 7: What developers need to know
 
JavaScript in Drupal 7: What developers need to know
JavaScript in Drupal 7: What developers need to knowJavaScript in Drupal 7: What developers need to know
JavaScript in Drupal 7: What developers need to know
 
Kharkivpy#3: Javascript and Python backend
Kharkivpy#3: Javascript and Python backendKharkivpy#3: Javascript and Python backend
Kharkivpy#3: Javascript and Python backend
 
JavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQueryJavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQuery
 
Everything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the WebEverything is Awesome - Cutting the Corners off the Web
Everything is Awesome - Cutting the Corners off the Web
 
Mobile Day - React Native
Mobile Day - React NativeMobile Day - React Native
Mobile Day - React Native
 
Web applications with Catalyst
Web applications with CatalystWeb applications with Catalyst
Web applications with Catalyst
 
Drupal & javascript
Drupal & javascriptDrupal & javascript
Drupal & javascript
 
WebGL and three.js
WebGL and three.jsWebGL and three.js
WebGL and three.js
 
Rails Model Basics
Rails Model BasicsRails Model Basics
Rails Model Basics
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript Framework
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
 
RubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - KeynoteRubyEnRails2007 - Dr Nic Williams - Keynote
RubyEnRails2007 - Dr Nic Williams - Keynote
 
Beyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance JavascriptBeyond DOMReady: Ultra High-Performance Javascript
Beyond DOMReady: Ultra High-Performance Javascript
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
 
Introduction To Ruby On Rails
Introduction To Ruby On RailsIntroduction To Ruby On Rails
Introduction To Ruby On Rails
 
Drupal Javascript for developers
Drupal Javascript for developersDrupal Javascript for developers
Drupal Javascript for developers
 

Más de Rebecca Murphey

Lessons from-a-rewrite-gotham
Lessons from-a-rewrite-gothamLessons from-a-rewrite-gotham
Lessons from-a-rewrite-gotham
Rebecca Murphey
 
Cleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQueryCleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQuery
Rebecca Murphey
 
Delivering a Responsive UI
Delivering a Responsive UIDelivering a Responsive UI
Delivering a Responsive UI
Rebecca Murphey
 

Más de Rebecca Murphey (13)

Beyond the DOM: Sane Structure for JS Apps
Beyond the DOM: Sane Structure for JS AppsBeyond the DOM: Sane Structure for JS Apps
Beyond the DOM: Sane Structure for JS Apps
 
BVJS
BVJSBVJS
BVJS
 
Introducing Mulberry
Introducing MulberryIntroducing Mulberry
Introducing Mulberry
 
DojoConf: Building Large Apps
DojoConf: Building Large AppsDojoConf: Building Large Apps
DojoConf: Building Large Apps
 
Lessons from-a-rewrite-gotham
Lessons from-a-rewrite-gothamLessons from-a-rewrite-gotham
Lessons from-a-rewrite-gotham
 
Lessons from a Rewrite
Lessons from a RewriteLessons from a Rewrite
Lessons from a Rewrite
 
Modern JavaScript
Modern JavaScriptModern JavaScript
Modern JavaScript
 
Cleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQueryCleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQuery
 
Functionality Focused Code Organization
Functionality Focused Code OrganizationFunctionality Focused Code Organization
Functionality Focused Code Organization
 
The jQuery Divide
The jQuery DivideThe jQuery Divide
The jQuery Divide
 
Delivering a Responsive UI
Delivering a Responsive UIDelivering a Responsive UI
Delivering a Responsive UI
 
Dojo Confessions
Dojo ConfessionsDojo Confessions
Dojo Confessions
 
Jquery Fundamentals
Jquery FundamentalsJquery Fundamentals
Jquery Fundamentals
 

Último

+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@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
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
 
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
 

Último (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
+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...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

Getting Started with Mulberry

  • 1. A Mobile App Development Toolkit Rebecca Murphey & Dan Imal Boston Front End Developer Meetup January 2012 Tuesday, January 24, 12
  • 2. Rebecca Murphey Lead JavaScript Developer @rmurphey Dan Imal Senior User Experience Developer @mrdanimal Tuesday, January 24, 12
  • 4. linkage mulberry.toura.com bit.ly/toura-mulberry bit.ly/toura-mulberry-demos Tuesday, January 24, 12
  • 7. command line tools scaffold your app and generate skeleton les for the pieces you’ll need application code harness a powerful CSS and JavaScript framework to develop rich interfaces app builder generates production- ready builds for Android, iOS (mobile web is on the way) Tuesday, January 24, 12
  • 8. Callback Cordova Tuesday, January 24, 12
  • 9. $ mulberry scaffold recipes Tuesday, January 24, 12
  • 15. create content with yaml, markdown & html Tuesday, January 24, 12
  • 16. create functionality with javascript Tuesday, January 24, 12
  • 17. create styles with css & sass Tuesday, January 24, 12
  • 19. $ mulberry serve Tuesday, January 24, 12
  • 20. ohai sane development tools. Tuesday, January 24, 12
  • 21. $ mulberry test Tuesday, January 24, 12
  • 24. $ mulberry deploy Tuesday, January 24, 12
  • 25. it’s just javascript. (ok, and some haml, yaml, & sass.) Tuesday, January 24, 12
  • 26. todos: capabilities: - name: PageTodos screens: - name: index regions: - components: - custom.TodoForm - className: list scrollable: true components: - custom.TodoList - components: - custom.TodoTools NB: You can define this with JavaScript, too, using toura.pageDef(‘todos’, { ... }). Tuesday, January 24, 12
  • 27. $YOURAPP/javascript/routes.js mulberry.page('/todos', { name : 'Todos', pageDef : 'todos' }, true); mulberry.page('/completed', { name : 'Completed', pageDef : 'completed' }); #/todos #/completed Tuesday, January 24, 12
  • 28. $YOURAPP/javascript/components/TodoForm.js mulberry.component('TodoForm', { componentTemplate : dojo.cache('client.components', 'TodoForm/TodoForm.haml'), init : function() { this.connect(this.domNode, 'submit', function(e) { e.preventDefault(); var description = dojo.trim(this.descriptionInput.value), item; if (!description) { return; } item = { description : description }; this.domNode.reset(); this.onAdd(item); }); }, onAdd : function(item) { } }); Tuesday, January 24, 12
  • 29. $YOURAPP/javascript/components/TodoForm/TodoForm.haml %form.component.todo-form %input{ placeholder : 'New todo', dojoAttachPoint : 'descriptionInput' } %button{ dojoAttachPoint : 'saveButton' } Add Tuesday, January 24, 12
  • 30. $YOURAPP/javascript/stores/todos.js mulberry.store('todos', { model : 'Todo', finish : function(id) { this.invoke(id, 'finish'); }, unfinish : function(id) { this.invoke(id, 'unfinish'); } }); Tuesday, January 24, 12
  • 31. $YOURAPP/javascript/models/Todo.js mulberry.model('Todo', { complete : false, finish : function() { this.set('complete', true); }, unfinish : function() { this.set('complete', false); } }); Tuesday, January 24, 12
  • 32. @touradev @rmurphey @mrdanimal mulberry.toura.com bit.ly/toura-mulberry bit.ly/toura-mulberry-demos Tuesday, January 24, 12
  • 34. routes manage high-level application state components receive and render data, and react to user input capabilities provide data to components, and broker communications between them page de nitions reusable groupings of components and capabilities stores persist data on the device, make that data query-able, and return model instances Tuesday, January 24, 12
  • 35. routes manage high-level application state Tuesday, January 24, 12
  • 36. $YOURAPP/javascript/routes.js mulberry.page('/todos', { name : 'Todos', pageDef : 'todos' }, true); mulberry.page('/completed', { name : 'Completed', pageDef : 'completed' }); #/todos #/completed Tuesday, January 24, 12
  • 37. stores persist data on the device, make that data query-able, and return model instances Tuesday, January 24, 12
  • 38. $YOURAPP/javascript/stores/todos.js mulberry.store('todos', { model : 'Todo', finish : function(id) { this.invoke(id, 'finish'); }, unfinish : function(id) { this.invoke(id, 'unfinish'); } }); Tuesday, January 24, 12
  • 39. page de nitions reusable groupings of components and capabilities Tuesday, January 24, 12
  • 40. todos: capabilities: - name: PageTodos screens: - name: index regions: - components: - custom.TodoForm - className: list scrollable: true components: - custom.TodoList - components: - custom.TodoTools NB: You can define this with JavaScript, too, using toura.pageDef(‘todos’, { ... }). Tuesday, January 24, 12
  • 41. components receive and render data, and react to user input Tuesday, January 24, 12
  • 42. $YOURAPP/javascript/components/TodoForm.js mulberry.component('TodoForm', { componentTemplate : dojo.cache('client.components', 'TodoForm/TodoForm.haml'), init : function() { this.connect(this.domNode, 'submit', function(e) { e.preventDefault(); var description = dojo.trim(this.descriptionInput.value), item; if (!description) { return; } item = { description : description }; this.domNode.reset(); this.onAdd(item); }); }, onAdd : function(item) { } }); Tuesday, January 24, 12
  • 43. $YOURAPP/javascript/components/TodoForm/TodoForm.haml %form.component.todo-form %input{ placeholder : 'New todo', dojoAttachPoint : 'descriptionInput' } %button{ dojoAttachPoint : 'saveButton' } Add Tuesday, January 24, 12
  • 44. $YOURAPP/javascript/components/TodoForm.js mulberry.component('TodoForm', { componentTemplate : dojo.cache('client.components', 'TodoForm/TodoForm.haml'), init : function() { this.connect(this.domNode, 'submit', function(e) { e.preventDefault(); var description = dojo.trim(this.descriptionInput.value), item; if (!description) { return; } item = { description : description }; this.domNode.reset(); this.onAdd(item); }); }, onAdd : function(item) { } }); Tuesday, January 24, 12
  • 45. capabilities provide data to components, and broker communications between them Tuesday, January 24, 12
  • 46. mulberry.capability('PageTodos', { todos: requirements : { capabilities: todoList : 'custom.TodoList', - name: PageTodos todoForm : 'custom.TodoForm', screens: todoTools : 'custom.TodoTools' - name: index }, regions: - components: connects : [ - custom.TodoForm [ 'todoForm', 'onAdd', '_add' ], - className: list [ 'todoList', 'onComplete', '_complete' ], scrollable: true [ 'todoList', 'onDelete', '_delete' ], components: [ 'todoTools', 'onCompleteAll', '_completeAll' ] - custom.TodoList ], - components: - custom.TodoTools init : function() { this.todos = client.stores.todos; this._updateList(); }, _add : function(item) { this.todos.add(item); this._updateList(); }, _delete : function(id) { this.todos.remove(id); this._updateList(); }, Tuesday, January 24, 12 _complete : function(id) {
  • 47. mulberry.capability('PageTodos', { todos: requirements : { capabilities: todoList : 'custom.TodoList', - name: PageTodos todoForm : 'custom.TodoForm', screens: todoTools : 'custom.TodoTools' - name: index }, regions: - components: connects : [ - custom.TodoForm [ 'todoForm', 'onAdd', '_add' ], - className: list [ 'todoList', 'onComplete', '_complete' ], scrollable: true [ 'todoList', 'onDelete', '_delete' ], components: [ 'todoTools', 'onCompleteAll', '_completeAll' ] - custom.TodoList ], - components: - custom.TodoTools init : function() { this.todos = client.stores.todos; this._updateList(); }, _add : function(item) { this.todos.add(item); this._updateList(); }, _delete : function(id) { this.todos.remove(id); this._updateList(); }, Tuesday, January 24, 12 _complete : function(id) {
  • 48. mulberry.capability('PageTodos', { todos: requirements : { capabilities: todoList : 'custom.TodoList', - name: PageTodos todoForm : 'custom.TodoForm', screens: todoTools : 'custom.TodoTools' - name: index }, regions: - components: connects : [ - custom.TodoForm [ 'todoForm', 'onAdd', '_add' ], - className: list [ 'todoList', 'onComplete', '_complete' ], scrollable: true [ 'todoList', 'onDelete', '_delete' ], components: [ 'todoTools', 'onCompleteAll', '_completeAll' ] - custom.TodoList ], - components: - custom.TodoTools init : function() { this.todos = client.stores.todos; this._updateList(); }, _add : function(item) { this.todos.add(item); this._updateList(); }, _delete : function(id) { this.todos.remove(id); this._updateList(); }, Tuesday, January 24, 12 _complete : function(id) {