SlideShare a Scribd company logo
Patterns andbehaviors
 Optimizations for markup and JavaScript
           on top of patterns.
Content

•   Simple pattern
•   Pattern with logic
•   Pattern with behavior
•   Advantages / Disadvantages




29.06.2012      Tobias Krogh | XING AG | Patters and behaviors   2
Tobias Krogh

•   Frontend Engineer (role of an architect)
•   27 years old
•   XING AG for two years and a quarter
•   jQuery is my favorite library :-)
•   NO twitter account to be followed
•   xing.to/bias
•   stackoverflow.com/users/1342159

29.06.2012       Tobias Krogh | XING AG | Patters and behaviors   3
HTML
                      (simple pattern)
HTML
<divclass="my-pattern-class">
<h4>Wow, I am a headline</h4>
<a href="/form">showtheform</a>
</div>

CSS
.my-pattern-class {
padding: 10px;
}




29.06.2012             Tobias Krogh | XING AG | Patters and behaviors   4
HTML / JS
                   (pattern with logic)
HTML
<divid="foobar" class="my-pattern-class">
<h4>Wow, I am a headline</h4>
<a href="/form">showtheform</a>
</div>
<script>
 // assuming an existingfunction "showLightbox"
 $("#foobara").click(showLightbox);
</script>




29.06.2012              Tobias Krogh | XING AG | Patters and behaviors   5
HTML / JS
               (pattern with behavior)
HTML
<divclass="my-pattern-class">
<h4>Wow, I am a headline</h4>
<a data-module="lightbox"href="/form">showtheform</a>
</div>

JS File
Behaviors.add({
 '[data-module="lightbox"]:click': showLightbox
});
// setbehaviors on DOM ready
$(Behaviors.update);

29.06.2012              Tobias Krogh | XING AG | Patters and behaviors   6
Advantages
             Whatspeaksforusingbehaviors?
•   Save blocking inline script
•   Define / transportthecodeonlyonce
•   JavaScript filesarecached
•   Maintainabilityisimproved
•   Update easilypossible




29.06.2012          Tobias Krogh | XING AG | Patters and behaviors   7
Disadvantages
             Whatspeaksagainstbehaviors?
• Additional markup on elements
• Main disadvantage:




29.06.2012          Tobias Krogh | XING AG | Patters and behaviors   8
Disadvantage: Availability
                   The problem
Bigger JS logicmeansmoretransportevenif not needed:
Behaviors.add({
 "[data-module="lightbox"]:click": function() {
    // e.g. 100 lines and more…
 }
});

• Nofittingmarkupmeans NO need




29.06.2012             Tobias Krogh | XING AG | Patters and behaviors   9
Conclusion

•   Use JS behaviors
•   Most practicalforspreadsimilarscripts
•   Design and interaction will besimilar
•   Document to makeotherdevelopers happy :-)

• Keepfilesize in mind (use AMD) ;-)



29.06.2012      Tobias Krogh | XING AG | Patters and behaviors   10

More Related Content

Viewers also liked

Dewey
DeweyDewey
Dewey
npa58
 
Thesis Presentation
Thesis PresentationThesis Presentation
Thesis Presentation
Keighley Reisenauer
 
Information Literacy Week 10: Evaluation
Information Literacy Week 10: EvaluationInformation Literacy Week 10: Evaluation
Information Literacy Week 10: Evaluation
Rebecca Johnson
 
ACTUALIZACIÓN DEL PLAN DE GESTIÓN INTEGRAL DE RESIDUOS SÓLIDOS DEL MUNICIPIO ...
ACTUALIZACIÓN DEL PLAN DE GESTIÓN INTEGRAL DE RESIDUOS SÓLIDOS DEL MUNICIPIO ...ACTUALIZACIÓN DEL PLAN DE GESTIÓN INTEGRAL DE RESIDUOS SÓLIDOS DEL MUNICIPIO ...
ACTUALIZACIÓN DEL PLAN DE GESTIÓN INTEGRAL DE RESIDUOS SÓLIDOS DEL MUNICIPIO ...
websalazar
 
42 - IDNOG03 - LT - Akhmad Zaimi - Ansible Ease your config job
42 - IDNOG03  - LT - Akhmad Zaimi - Ansible Ease your config job42 - IDNOG03  - LT - Akhmad Zaimi - Ansible Ease your config job
42 - IDNOG03 - LT - Akhmad Zaimi - Ansible Ease your config job
Indonesia Network Operators Group
 
Sckipio G.fast Presentation at TNO Ultrafast Broadband 2015
Sckipio G.fast Presentation at TNO Ultrafast Broadband 2015Sckipio G.fast Presentation at TNO Ultrafast Broadband 2015
Sckipio G.fast Presentation at TNO Ultrafast Broadband 2015
Sckipio
 
HOME COLLECTIONS
HOME COLLECTIONSHOME COLLECTIONS
HOME COLLECTIONS
Bharath babu
 

Viewers also liked (7)

Dewey
DeweyDewey
Dewey
 
Thesis Presentation
Thesis PresentationThesis Presentation
Thesis Presentation
 
Information Literacy Week 10: Evaluation
Information Literacy Week 10: EvaluationInformation Literacy Week 10: Evaluation
Information Literacy Week 10: Evaluation
 
ACTUALIZACIÓN DEL PLAN DE GESTIÓN INTEGRAL DE RESIDUOS SÓLIDOS DEL MUNICIPIO ...
ACTUALIZACIÓN DEL PLAN DE GESTIÓN INTEGRAL DE RESIDUOS SÓLIDOS DEL MUNICIPIO ...ACTUALIZACIÓN DEL PLAN DE GESTIÓN INTEGRAL DE RESIDUOS SÓLIDOS DEL MUNICIPIO ...
ACTUALIZACIÓN DEL PLAN DE GESTIÓN INTEGRAL DE RESIDUOS SÓLIDOS DEL MUNICIPIO ...
 
42 - IDNOG03 - LT - Akhmad Zaimi - Ansible Ease your config job
42 - IDNOG03  - LT - Akhmad Zaimi - Ansible Ease your config job42 - IDNOG03  - LT - Akhmad Zaimi - Ansible Ease your config job
42 - IDNOG03 - LT - Akhmad Zaimi - Ansible Ease your config job
 
Sckipio G.fast Presentation at TNO Ultrafast Broadband 2015
Sckipio G.fast Presentation at TNO Ultrafast Broadband 2015Sckipio G.fast Presentation at TNO Ultrafast Broadband 2015
Sckipio G.fast Presentation at TNO Ultrafast Broadband 2015
 
HOME COLLECTIONS
HOME COLLECTIONSHOME COLLECTIONS
HOME COLLECTIONS
 

Similar to Pattern behaviors

20150211 seo in drupal presentation
20150211 seo in drupal presentation20150211 seo in drupal presentation
20150211 seo in drupal presentation
Dagmar Muth
 
Lab#2 overview of html
Lab#2 overview of htmlLab#2 overview of html
Lab#2 overview of html
Yaowaluck Promdee
 
[PSU Web 2011] HTML5 Design
[PSU Web 2011] HTML5 Design[PSU Web 2011] HTML5 Design
[PSU Web 2011] HTML5 Design
Christopher Schmitt
 
Html,CSS & UI/UX design
Html,CSS & UI/UX designHtml,CSS & UI/UX design
Html,CSS & UI/UX design
Karthikeyan Dhanasekaran CUA
 
Html5で変わるいろんなこと
Html5で変わるいろんなことHtml5で変わるいろんなこと
Html5で変わるいろんなこと
Masakazu Muraoka
 
HTML Semantic Tags
HTML Semantic TagsHTML Semantic Tags
HTML Semantic Tags
Bruce Kyle
 
HTML5 Essential Training
HTML5 Essential TrainingHTML5 Essential Training
HTML5 Essential Training
Kaloyan Kosev
 
[edUi] HTML5 Workshop
[edUi] HTML5 Workshop[edUi] HTML5 Workshop
[edUi] HTML5 Workshop
Christopher Schmitt
 
Unic - frontend development-in-complex-projects
Unic - frontend development-in-complex-projectsUnic - frontend development-in-complex-projects
Unic - frontend development-in-complex-projects
Unic
 
Writing an extensible web testing framework ready for the cloud slide share
Writing an extensible web testing framework ready for the cloud   slide shareWriting an extensible web testing framework ready for the cloud   slide share
Writing an extensible web testing framework ready for the cloud slide share
Mike Ensor
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven development
Gil Fink
 
Take Your Markup to Eleven
Take Your Markup to ElevenTake Your Markup to Eleven
Take Your Markup to Eleven
Emily Lewis
 
Link your Way to Successful Content Management with MadCap Flare
Link your Way to Successful Content Management with MadCap FlareLink your Way to Successful Content Management with MadCap Flare
Link your Way to Successful Content Management with MadCap Flare
Denise Kadilak
 
Html week8 2019 2020 for g10 by eng.osama ghandour
Html week8 2019 2020 for g10 by eng.osama ghandourHtml week8 2019 2020 for g10 by eng.osama ghandour
Html week8 2019 2020 for g10 by eng.osama ghandour
Osama Ghandour Geris
 
SharePoint & jQuery Guide - SPSTC 5/18/2013
SharePoint & jQuery Guide - SPSTC 5/18/2013 SharePoint & jQuery Guide - SPSTC 5/18/2013
SharePoint & jQuery Guide - SPSTC 5/18/2013
Mark Rackley
 
How to Not Let Team Authoring Drive You Crazy - MadWorld 2013, Scott DeLoach,...
How to Not Let Team Authoring Drive You Crazy - MadWorld 2013, Scott DeLoach,...How to Not Let Team Authoring Drive You Crazy - MadWorld 2013, Scott DeLoach,...
How to Not Let Team Authoring Drive You Crazy - MadWorld 2013, Scott DeLoach,...
Scott DeLoach
 
HTML5ではないサイトを HTML5へ - Change HTML5 from Not HTML5.
HTML5ではないサイトを HTML5へ - Change HTML5 from Not HTML5.HTML5ではないサイトを HTML5へ - Change HTML5 from Not HTML5.
HTML5ではないサイトを HTML5へ - Change HTML5 from Not HTML5.
Sadaaki HIRAI
 
[heweb11] HTML5 Makeover
[heweb11] HTML5 Makeover[heweb11] HTML5 Makeover
[heweb11] HTML5 Makeover
Christopher Schmitt
 
Introduction to Web Components & Polymer Workshop - U of I WebCon
Introduction to Web Components & Polymer Workshop - U of I WebConIntroduction to Web Components & Polymer Workshop - U of I WebCon
Introduction to Web Components & Polymer Workshop - U of I WebCon
John Riviello
 
[O'Reilly] HTML5 Design
[O'Reilly] HTML5 Design[O'Reilly] HTML5 Design
[O'Reilly] HTML5 Design
Christopher Schmitt
 

Similar to Pattern behaviors (20)

20150211 seo in drupal presentation
20150211 seo in drupal presentation20150211 seo in drupal presentation
20150211 seo in drupal presentation
 
Lab#2 overview of html
Lab#2 overview of htmlLab#2 overview of html
Lab#2 overview of html
 
[PSU Web 2011] HTML5 Design
[PSU Web 2011] HTML5 Design[PSU Web 2011] HTML5 Design
[PSU Web 2011] HTML5 Design
 
Html,CSS & UI/UX design
Html,CSS & UI/UX designHtml,CSS & UI/UX design
Html,CSS & UI/UX design
 
Html5で変わるいろんなこと
Html5で変わるいろんなことHtml5で変わるいろんなこと
Html5で変わるいろんなこと
 
HTML Semantic Tags
HTML Semantic TagsHTML Semantic Tags
HTML Semantic Tags
 
HTML5 Essential Training
HTML5 Essential TrainingHTML5 Essential Training
HTML5 Essential Training
 
[edUi] HTML5 Workshop
[edUi] HTML5 Workshop[edUi] HTML5 Workshop
[edUi] HTML5 Workshop
 
Unic - frontend development-in-complex-projects
Unic - frontend development-in-complex-projectsUnic - frontend development-in-complex-projects
Unic - frontend development-in-complex-projects
 
Writing an extensible web testing framework ready for the cloud slide share
Writing an extensible web testing framework ready for the cloud   slide shareWriting an extensible web testing framework ready for the cloud   slide share
Writing an extensible web testing framework ready for the cloud slide share
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven development
 
Take Your Markup to Eleven
Take Your Markup to ElevenTake Your Markup to Eleven
Take Your Markup to Eleven
 
Link your Way to Successful Content Management with MadCap Flare
Link your Way to Successful Content Management with MadCap FlareLink your Way to Successful Content Management with MadCap Flare
Link your Way to Successful Content Management with MadCap Flare
 
Html week8 2019 2020 for g10 by eng.osama ghandour
Html week8 2019 2020 for g10 by eng.osama ghandourHtml week8 2019 2020 for g10 by eng.osama ghandour
Html week8 2019 2020 for g10 by eng.osama ghandour
 
SharePoint & jQuery Guide - SPSTC 5/18/2013
SharePoint & jQuery Guide - SPSTC 5/18/2013 SharePoint & jQuery Guide - SPSTC 5/18/2013
SharePoint & jQuery Guide - SPSTC 5/18/2013
 
How to Not Let Team Authoring Drive You Crazy - MadWorld 2013, Scott DeLoach,...
How to Not Let Team Authoring Drive You Crazy - MadWorld 2013, Scott DeLoach,...How to Not Let Team Authoring Drive You Crazy - MadWorld 2013, Scott DeLoach,...
How to Not Let Team Authoring Drive You Crazy - MadWorld 2013, Scott DeLoach,...
 
HTML5ではないサイトを HTML5へ - Change HTML5 from Not HTML5.
HTML5ではないサイトを HTML5へ - Change HTML5 from Not HTML5.HTML5ではないサイトを HTML5へ - Change HTML5 from Not HTML5.
HTML5ではないサイトを HTML5へ - Change HTML5 from Not HTML5.
 
[heweb11] HTML5 Makeover
[heweb11] HTML5 Makeover[heweb11] HTML5 Makeover
[heweb11] HTML5 Makeover
 
Introduction to Web Components & Polymer Workshop - U of I WebCon
Introduction to Web Components & Polymer Workshop - U of I WebConIntroduction to Web Components & Polymer Workshop - U of I WebCon
Introduction to Web Components & Polymer Workshop - U of I WebCon
 
[O'Reilly] HTML5 Design
[O'Reilly] HTML5 Design[O'Reilly] HTML5 Design
[O'Reilly] HTML5 Design
 

Recently uploaded

Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 

Recently uploaded (20)

Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 

Pattern behaviors

  • 1. Patterns andbehaviors Optimizations for markup and JavaScript on top of patterns.
  • 2. Content • Simple pattern • Pattern with logic • Pattern with behavior • Advantages / Disadvantages 29.06.2012 Tobias Krogh | XING AG | Patters and behaviors 2
  • 3. Tobias Krogh • Frontend Engineer (role of an architect) • 27 years old • XING AG for two years and a quarter • jQuery is my favorite library :-) • NO twitter account to be followed • xing.to/bias • stackoverflow.com/users/1342159 29.06.2012 Tobias Krogh | XING AG | Patters and behaviors 3
  • 4. HTML (simple pattern) HTML <divclass="my-pattern-class"> <h4>Wow, I am a headline</h4> <a href="/form">showtheform</a> </div> CSS .my-pattern-class { padding: 10px; } 29.06.2012 Tobias Krogh | XING AG | Patters and behaviors 4
  • 5. HTML / JS (pattern with logic) HTML <divid="foobar" class="my-pattern-class"> <h4>Wow, I am a headline</h4> <a href="/form">showtheform</a> </div> <script> // assuming an existingfunction "showLightbox" $("#foobara").click(showLightbox); </script> 29.06.2012 Tobias Krogh | XING AG | Patters and behaviors 5
  • 6. HTML / JS (pattern with behavior) HTML <divclass="my-pattern-class"> <h4>Wow, I am a headline</h4> <a data-module="lightbox"href="/form">showtheform</a> </div> JS File Behaviors.add({ '[data-module="lightbox"]:click': showLightbox }); // setbehaviors on DOM ready $(Behaviors.update); 29.06.2012 Tobias Krogh | XING AG | Patters and behaviors 6
  • 7. Advantages Whatspeaksforusingbehaviors? • Save blocking inline script • Define / transportthecodeonlyonce • JavaScript filesarecached • Maintainabilityisimproved • Update easilypossible 29.06.2012 Tobias Krogh | XING AG | Patters and behaviors 7
  • 8. Disadvantages Whatspeaksagainstbehaviors? • Additional markup on elements • Main disadvantage: 29.06.2012 Tobias Krogh | XING AG | Patters and behaviors 8
  • 9. Disadvantage: Availability The problem Bigger JS logicmeansmoretransportevenif not needed: Behaviors.add({ "[data-module="lightbox"]:click": function() { // e.g. 100 lines and more… } }); • Nofittingmarkupmeans NO need 29.06.2012 Tobias Krogh | XING AG | Patters and behaviors 9
  • 10. Conclusion • Use JS behaviors • Most practicalforspreadsimilarscripts • Design and interaction will besimilar • Document to makeotherdevelopers happy :-) • Keepfilesize in mind (use AMD) ;-) 29.06.2012 Tobias Krogh | XING AG | Patters and behaviors 10