SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
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


 

Contenu connexe

Similaire à 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
 

Similaire à 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
 

Dernier

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
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)Zilliz
 
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 FMESafe Software
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
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 WoodJuan lago vázquez
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewDianaGray10
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
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 FMESafe Software
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceIES VE
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaWSO2
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهMohamed Sweelam
 
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 2024Victor Rentea
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 

Dernier (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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)
 
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
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
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
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
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
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهله
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 

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