SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
Ignite your ASP.NET MVC
Applications with Spark View
           Engine
         t: @curtis_mitchell
    e: curtismitchell@gmail.com
What is Spark View Engine?

A view engine for ASP.NET MVC and Castle MonoRail that gives
you the full capabilities of C# (and other languages) within
your views via an HTML-friendly syntax
Why Spark?
Spark turns this...
...into this!
Who is this presentation for?
Who is this presentation for?

Web Developers...

   ...that use MVC, but want to switch view engines
Who is this presentation for?

Web Developers...

   ...that use MVC, but want to switch view engines
   ...that know about Spark, but have been apprehensive
   about using it
Who is this presentation for?

Web Developers...

   ...that use MVC, but want to switch view engines
   ...that know about Spark, but have been apprehensive
   about using it
   ...that use other view engines like nHaml or nVelocity, but
   want to learn more about Spark
Who is this presentation for?

Web Developers...

   ...that use MVC, but want to switch view engines
   ...that know about Spark, but have been apprehensive
   about using it
   ...that use other view engines like nHaml or nVelocity, but
   want to learn more about Spark
   ...that just haven't had the time to sit down and learn
   Spark
...until now!
Agenda

1.   History of Spark
2.   Getting Started
3.   Concepts and Syntax
4.   More Concepts
5.   Gotchas
6.   References
7.   Wrap-up
Introducing Spark - History




  http://haacked.com/archive/2008/05/03/code-based-repeater-for-asp.net-mvc.
  aspx#67579
Getting Started With Spark
Getting Started

  Create/Open an MVC project
  Reference Spark.dll and Spark.Mvc.dll
  Configure the view engine
  Start using it!
Concepts and Syntax
Concepts and Syntax

Layouts
   LayoutsApplication.Spark
   SharedApplication.Spark
   View() method
   <use master="layout" /> 
 
 
 
 
 
 * The above methods are in order from weakest to the strongest.  In other words, <use
master="layout" /> takes precedence over having an Application.Spark file in the Layouts
folder.
Concepts and Syntax

Named Content
   <use content="" /> (in layout)
  <content name=""></content>, <content:name></content:
  name> (in view)
Concepts and Syntax

Partials
   <use file="" />
   <Partial someVar="" />
Concepts and Syntax

 Variables
    <var [var name]="[value]" type="[type]" /> or def
    <global [var name]="[value]" type="[type]" />
    <set [var name]="[value]" />
 ViewData 
    <viewdata key="type" />
Concepts and Syntax

_global.Spark
   Special partial that gets auto-included in a Spark file if it
   is in the layout folder or the root folder of the view
   Great place to put <using> statements, global variables, or
   other elements that do not immediately write to the
   output buffer
Concepts and Syntax

Control-of-flow statements
   <test> statement, <if><else>
   <for>
   Attributes on html elements
More Concepts
More Concepts

Inline C#
    Use # to delimit any plain ol' C# code
More Concepts

Macros
      Methods that can return strings for output
 
 
 
                                           . . .
(Not on the agenda)

These items are beyond this introductory presentation, but
Spark supports them:
   Caching of views (partial caching included)
   Pre-compilation of view classes (testing, performance)
   Descriptor Filters for differentiating views based on things
   like area, theme, or culture
Gotchas

1. Intellisense not working for some types like Html (helpers)
       The background compiler for Spark isn't finding the
       assemblies
       Copy the assemblies local to resolve
2. R#'s intellisense doesn't work with Spark.  
       If using R# and Spark, change R#'s intellisense setting to
       use Visual Studio's
       Don't use the <namespaces> section in the web.config
       file.  Use the <using> syntax in the _global.Spark file
       instead.
References and Links

1.   http://www.sparkviewengine.com
2.   http://www.whereslou.com
3.   http://www.github.com/loudej/spark
4.   http://www.dimecasts.net
Holla@me

    Thank you for your time and attention!
 
 
            Curtis Mitchell
            t: @curtis_mitchell
            e: curtismitchell@gmail.com
            b: http://www.curtismitchell.com
             
            http://speakerrate.com/talks/1524


 

Más contenido relacionado

Similar a Spark View Engine (Richmond)

Aspect-oriented programming in Perl
Aspect-oriented programming in PerlAspect-oriented programming in Perl
Aspect-oriented programming in Perlmegakott
 
Lightning web components
Lightning web components Lightning web components
Lightning web components Cloud Analogy
 
Kubernetes and Local Dvelopment
Kubernetes and Local DvelopmentKubernetes and Local Dvelopment
Kubernetes and Local DvelopmentJeffrey Sica
 
.NET Core, ASP.NET Core Course, Session 18
 .NET Core, ASP.NET Core Course, Session 18 .NET Core, ASP.NET Core Course, Session 18
.NET Core, ASP.NET Core Course, Session 18aminmesbahi
 
Introduction to Apache Spark Developer Training
Introduction to Apache Spark Developer TrainingIntroduction to Apache Spark Developer Training
Introduction to Apache Spark Developer TrainingCloudera, Inc.
 
Learning spark ch07 - Running on a Cluster
Learning spark ch07 - Running on a ClusterLearning spark ch07 - Running on a Cluster
Learning spark ch07 - Running on a Clusterphanleson
 
Apexand visualforcearchitecture
Apexand visualforcearchitectureApexand visualforcearchitecture
Apexand visualforcearchitectureCMR WORLD TECH
 
Rg apexand visualforcearchitecture
Rg apexand visualforcearchitectureRg apexand visualforcearchitecture
Rg apexand visualforcearchitectureCMR WORLD TECH
 
Bhadale Group of Companies - digital projects
Bhadale Group of Companies - digital projectsBhadale Group of Companies - digital projects
Bhadale Group of Companies - digital projectsVijayananda Mohire
 
Lessons Learned: Scala and its Ecosystem
Lessons Learned: Scala and its EcosystemLessons Learned: Scala and its Ecosystem
Lessons Learned: Scala and its EcosystemPetr Hošek
 
DiUS Computing Lca Rails Final
DiUS  Computing Lca Rails FinalDiUS  Computing Lca Rails Final
DiUS Computing Lca Rails FinalRobert Postill
 
Content Management That Won't Rot Your Brain
Content Management That Won't Rot Your BrainContent Management That Won't Rot Your Brain
Content Management That Won't Rot Your BrainSean Cribbs
 
Introduction to Spark ML
Introduction to Spark MLIntroduction to Spark ML
Introduction to Spark MLHolden Karau
 
Ruby On Rails Tutorial
Ruby On Rails TutorialRuby On Rails Tutorial
Ruby On Rails Tutorialsunniboy
 
React & Redux JS
React & Redux JS React & Redux JS
React & Redux JS Hamed Farag
 
Monitor Apache Spark 3 on Kubernetes using Metrics and Plugins
Monitor Apache Spark 3 on Kubernetes using Metrics and PluginsMonitor Apache Spark 3 on Kubernetes using Metrics and Plugins
Monitor Apache Spark 3 on Kubernetes using Metrics and PluginsDatabricks
 
Developing a Struts & Tiles application using WebSphere Studio
Developing a Struts & Tiles application using WebSphere StudioDeveloping a Struts & Tiles application using WebSphere Studio
Developing a Struts & Tiles application using WebSphere Studioelliando dias
 

Similar a Spark View Engine (Richmond) (20)

Aspect-oriented programming in Perl
Aspect-oriented programming in PerlAspect-oriented programming in Perl
Aspect-oriented programming in Perl
 
Lightning web components
Lightning web components Lightning web components
Lightning web components
 
Kubernetes and Local Dvelopment
Kubernetes and Local DvelopmentKubernetes and Local Dvelopment
Kubernetes and Local Dvelopment
 
.NET Core, ASP.NET Core Course, Session 18
 .NET Core, ASP.NET Core Course, Session 18 .NET Core, ASP.NET Core Course, Session 18
.NET Core, ASP.NET Core Course, Session 18
 
Spark tutorial
Spark tutorialSpark tutorial
Spark tutorial
 
Introduction to Apache Spark Developer Training
Introduction to Apache Spark Developer TrainingIntroduction to Apache Spark Developer Training
Introduction to Apache Spark Developer Training
 
Learning spark ch07 - Running on a Cluster
Learning spark ch07 - Running on a ClusterLearning spark ch07 - Running on a Cluster
Learning spark ch07 - Running on a Cluster
 
Apexand visualforcearchitecture
Apexand visualforcearchitectureApexand visualforcearchitecture
Apexand visualforcearchitecture
 
Rg apexand visualforcearchitecture
Rg apexand visualforcearchitectureRg apexand visualforcearchitecture
Rg apexand visualforcearchitecture
 
Bhadale Group of Companies - digital projects
Bhadale Group of Companies - digital projectsBhadale Group of Companies - digital projects
Bhadale Group of Companies - digital projects
 
Lessons Learned: Scala and its Ecosystem
Lessons Learned: Scala and its EcosystemLessons Learned: Scala and its Ecosystem
Lessons Learned: Scala and its Ecosystem
 
DiUS Computing Lca Rails Final
DiUS  Computing Lca Rails FinalDiUS  Computing Lca Rails Final
DiUS Computing Lca Rails Final
 
Content Management That Won't Rot Your Brain
Content Management That Won't Rot Your BrainContent Management That Won't Rot Your Brain
Content Management That Won't Rot Your Brain
 
Introduction to Spark ML
Introduction to Spark MLIntroduction to Spark ML
Introduction to Spark ML
 
Ibm
IbmIbm
Ibm
 
Mvc
MvcMvc
Mvc
 
Ruby On Rails Tutorial
Ruby On Rails TutorialRuby On Rails Tutorial
Ruby On Rails Tutorial
 
React & Redux JS
React & Redux JS React & Redux JS
React & Redux JS
 
Monitor Apache Spark 3 on Kubernetes using Metrics and Plugins
Monitor Apache Spark 3 on Kubernetes using Metrics and PluginsMonitor Apache Spark 3 on Kubernetes using Metrics and Plugins
Monitor Apache Spark 3 on Kubernetes using Metrics and Plugins
 
Developing a Struts & Tiles application using WebSphere Studio
Developing a Struts & Tiles application using WebSphere StudioDeveloping a Struts & Tiles application using WebSphere Studio
Developing a Struts & Tiles application using WebSphere Studio
 

Último

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
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.pdfsudhanshuwaghmare1
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 

Último (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

Spark View Engine (Richmond)

  • 1. Ignite your ASP.NET MVC Applications with Spark View Engine t: @curtis_mitchell e: curtismitchell@gmail.com
  • 2. What is Spark View Engine? A view engine for ASP.NET MVC and Castle MonoRail that gives you the full capabilities of C# (and other languages) within your views via an HTML-friendly syntax
  • 6. Who is this presentation for?
  • 7. Who is this presentation for? Web Developers... ...that use MVC, but want to switch view engines
  • 8. Who is this presentation for? Web Developers... ...that use MVC, but want to switch view engines ...that know about Spark, but have been apprehensive about using it
  • 9. Who is this presentation for? Web Developers... ...that use MVC, but want to switch view engines ...that know about Spark, but have been apprehensive about using it ...that use other view engines like nHaml or nVelocity, but want to learn more about Spark
  • 10. Who is this presentation for? Web Developers... ...that use MVC, but want to switch view engines ...that know about Spark, but have been apprehensive about using it ...that use other view engines like nHaml or nVelocity, but want to learn more about Spark ...that just haven't had the time to sit down and learn Spark
  • 12. Agenda 1. History of Spark 2. Getting Started 3. Concepts and Syntax 4. More Concepts 5. Gotchas 6. References 7. Wrap-up
  • 13. Introducing Spark - History http://haacked.com/archive/2008/05/03/code-based-repeater-for-asp.net-mvc. aspx#67579
  • 15. Getting Started Create/Open an MVC project Reference Spark.dll and Spark.Mvc.dll Configure the view engine Start using it!
  • 17. Concepts and Syntax Layouts LayoutsApplication.Spark SharedApplication.Spark View() method <use master="layout" />             * The above methods are in order from weakest to the strongest.  In other words, <use master="layout" /> takes precedence over having an Application.Spark file in the Layouts folder.
  • 18. Concepts and Syntax Named Content  <use content="" /> (in layout) <content name=""></content>, <content:name></content: name> (in view)
  • 19. Concepts and Syntax Partials <use file="" /> <Partial someVar="" />
  • 20. Concepts and Syntax Variables <var [var name]="[value]" type="[type]" /> or def <global [var name]="[value]" type="[type]" /> <set [var name]="[value]" /> ViewData  <viewdata key="type" />
  • 21. Concepts and Syntax _global.Spark Special partial that gets auto-included in a Spark file if it is in the layout folder or the root folder of the view Great place to put <using> statements, global variables, or other elements that do not immediately write to the output buffer
  • 22. Concepts and Syntax Control-of-flow statements <test> statement, <if><else> <for> Attributes on html elements
  • 24. More Concepts Inline C# Use # to delimit any plain ol' C# code
  • 25. More Concepts Macros  Methods that can return strings for output                                                  . . .
  • 26. (Not on the agenda) These items are beyond this introductory presentation, but Spark supports them: Caching of views (partial caching included) Pre-compilation of view classes (testing, performance) Descriptor Filters for differentiating views based on things like area, theme, or culture
  • 27. Gotchas 1. Intellisense not working for some types like Html (helpers) The background compiler for Spark isn't finding the assemblies Copy the assemblies local to resolve 2. R#'s intellisense doesn't work with Spark.   If using R# and Spark, change R#'s intellisense setting to use Visual Studio's Don't use the <namespaces> section in the web.config file.  Use the <using> syntax in the _global.Spark file instead.
  • 28. References and Links 1. http://www.sparkviewengine.com 2. http://www.whereslou.com 3. http://www.github.com/loudej/spark 4. http://www.dimecasts.net
  • 29. Holla@me Thank you for your time and attention!     Curtis Mitchell t: @curtis_mitchell e: curtismitchell@gmail.com b: http://www.curtismitchell.com   http://speakerrate.com/talks/1524