Nov 09

Notes on The Big View Engine Comparison

internet, opensource, programming, spark, tech 1 Comment »

There was another very interesing comparison of several view engines recently. Some of the Spark syntax isn’t exactly how I would have done things, so I thought I would respond with some of those notes. I was going to add a comment, but wanted to be able to preview code samples.

So here are some thoughts.
Read the rest of this entry »

Mar 02

Spark bits for MVC 2 RC2

mvc, programming, spark, tech 7 Comments »

Title kind of says it all. Spark v1.1 RC1 for MVC 2 RC2.

Thanks to folks who helped getting issues like this sorted out and Ben Scheirman, @subdigital, who sent a pull request on this issue. A while ago Erik Polerecky, @detroitpro, also provided a blog post with some bits you could download that contained those changes.

I asked him afterward if he would be interested in helping update the releases on Codeplex and he kindly agreed, in fact the new bits on codeplex and release notes were put together by Erik, so be sure to thank him for that. Hopefully this is just the first step in getting that larger support base I’ve been angling for. :)

As always – this is a lead up to sticking a fork in some 1.1 bits. If you find anything flaky please email the group or report an issue.

So… Main changes for MVC 2:

  • Updated the MVC binaries
  • Changed use of view context and updated output-capturing
  • Fixed implicit support for areas to be MVC 2 compatible (“area” is in data tokens, not route values)
  • Avoids autoencoding html helper and macro values

The last bit is interesting. In theory you should be able to turn on autoencoding and use ${expr} for all of your output instead of switching to !{expr} for things you know return html. It should “just work” in terms of html encoding data but not markup from things like ${Html.ActionLink(“hello”)}.

Nov 14

Spark in the Field – Fancy Dress Outfitters

internet, programming, spark, tech No Comments »

spacer This post is really far overdue – I’ve been pretty busy. This site has been live for quite a while, over a month now at least? The first I heard of this site was when Howard van Rooijen sent a message to the Spark dev group.

In the thread Howard says, among other things:

For those who are interested – here’s a little more info:

- We ran the project using Scrum and delivered in 20 weeks: 10 x 2 week iterations
- It’s based on the S#arp Architecture framework, which we extended to support Spark and ViewModels
- Integrated other OSS projects into the solution the one most relevant to Spark being N2CMS
- Solution performs very well: 1000 concurrent users per web server, generating around 180 pages per second across 2x single quad core 64bit servers.
- The site has a YSlow B Grading.

Very nice. His associate James Broome also has a post talking about their project as it relates to Asp.Net MVC – Separation of concerns amongst team members. You’ve gotta love hearing real-world examples of where UI-centric concerns and coding-centric concerns can work together in the same space at top speed without stumbling over each other’s focus.

Sep 24

Herding Code podcast about Spark

geek, opensource, podcast, spark, tech 2 Comments »

spacer The Herding Code 60: Spark View Engine with Louis DeJardin podcast just went up. Really fun group of guys. Interesting process they use to record also and seemed to work really well. I can just never get used to the sound of my own voice.

Jul 28

Spark output caching

aspnetmvc, caching, internet, programming, spark 14 Comments »

spacer Just finished writing the documentation for the most recent feature added to Spark. It provides output caching for sections of a template that could be costly in terms of rendering or data acquisition.

Part of this comes back to Phil’s blog post about Donut Hole Caching in ASP.NET MVC. Especially below where he writes, as he’s thinking out loud, “This would have to work in tandem with some means to specify that the bit of view data intended for the partial view is only recreated when the output cache is expired for that partial view, so we don’t incur the cost of creating it on every request.”

I have to admit I’m not necessarily a huge fan of the built-in ASP.NET page caching directives… Also didn’t particularly care for the forced alignment of partial-boundaries and cache-boundaries. I would hate to have a larger number of smaller files on disk simply because that’s the breakdown at which I wanted to cache the individual parts. In an ideal world I would like to be able to quickly and easily mark an expensive bit as cacheable, and provide the caching details that relate specifically to that bit, and be done with it.
Read the rest of this entry »

Jun 24

Spark v1.0 and presentation for MPLS ALT.NET

alt.net, aspnetmvc, presentation, programming, spark 10 Comments »

The first news is that the Spark v1.0 bits are now officially released and are the default download at CodePlex. It re-opens the gates to more substantial changes that have been postponed for the release milestone.

spacer Coinciding with the release I did a presentation of Spark on the 18th for the Minneapolis ALT.NET group organized by Freemind.

I had mentioned I was preparing for this and someone on Twitter asked if it would be recorded, so I arranged for a camcorder to be present.

Downloadable materials:
PowerPoint slides
All files and projects
New Downloadable version at 1024×768, 982.21MB

spacer spacer

spacer spacer

spacer spacer

spacer spacer

There were some lessons learned. One is that CamStudio will record as long as you like, then fail when it’s compressing and interleaving audio if the result is larger than 4GB.

Fortunately, out of a deep-seated (and apparently justified) distrust of technology there was also a camcorder on a tripod. An Avisynth filter named Reform provided some fairly acceptable results reconstructing a 4:3 aspect ratio of the screen.

There is an additional 30 minutes of audio captured by CamStudio after the tape ran out. I’m thinking of recapturing a video to go with that.

May 27

Starting with Spark in ten minutes

dimecast, internet, programming, spark No Comments »

Earlier today Donn Felker blogged about his new DimeCast episode:

# 113 – Saying Hello to the Spark View Engine

In this episode we are going to start a series where we take an indepth look at the Spark View Engine.

Spark is a view engine for Asp.Net Mvc and Castle Project MonoRail frameworks. The idea is to allow the html to dominate the flow and the code to fit seamlessly.

Very cool. Can’t wait to see it on a pc with audio.

It also reminds me I need to revamp the front page of the project site. I’d like for it to start with something like a quick article about creating a spark app instead of a bunch of random links.

May 22

Spark Macro for Uploadify, Take One-B

aspnetmvc, programming, spark 10 Comments »

Matt recently wrote in ASP.NET MVC HtmlHelper for Uploadify, Take One about a fairly common problem in the shades of gray where html and code concerns overlap. It’s a game of trying to get the least of both evils mixed in with the other.

Matt makes a particularly insightful remark in a comment, “what I dislike is how the balance of language in the helpers tends to shift from C# to JavaScript or HTML.”

I’d agree with that. On the one hand you’re trying to avoid excessive code in your template, but in doing so you’re dragging markup into your code. It’s actually a great example of a primary use-case for a macro in the Spark language, which lets you declare a helper method in the template language.

Here is the HtmlHelper extension exactly as it appeared on Matt’s post:

/// <summary>
/// Renders JavaScript to turn the specified file input control into an
/// Uploadify upload control.
/// </summary>
/// <param name="helper"></param>
/// <param name="name"></param>
/// <param name="options"></param>
/// <returns></returns>
public static string Uploadify(this HtmlHelper helper, string name, UploadifyOptions options)
{
    string scriptPath = helper.ResolveUrl("~/Content/jqueryPlugins/uploadify/");

    StringBuilder sb = new StringBuilder();
    //Include the JS file.
    sb.Append(helper.ScriptInclude("~/Content/jqueryPlugins/uploadify/jquery.uploadify.js"));
    sb.Append(helper.ScriptInclude("~/Content/jqueryPlugins/uploadify/jquery.uploadify.init.js"));

    //Dump the script to initialze Uploadify
    sb.AppendLine("<script type=\"text/javascript\">");
    sb.AppendLine("$(document).ready(function() {");
    sb.AppendFormat("initUploadify($('#{0}'),'{1}','{2}','{3}','{4}','{5}',{6},{7});",
                    name, options.UploadUrl,
                    scriptPath, options.FileExtensions,
                    options.FileDescription, options.AuthenticationToken,
                    options.ErrorFunction ?? "null",
                    options.CompleteFunction ?? "null");
    sb.AppendLine();
    sb.AppendLine("});");
    sb.AppendLine("</script");

    return sb.ToString();
}

And here’s the same helper implemented as a macro:

<macro name="Uploadify" name="string" options="UploadifyOptions">

  <var scriptPath="Html.ResolveUrl('~/Content/jqueryPlugins/uploadify/')"/>

  !{Html.ScriptInclude("~/Content/jqueryPlugins/uploadify/jquery.uploadify.js")}
  !{Html.ScriptInclude("~/Content/jqueryPlugins/uploadify/jquery.uploadify.init.js")}

  <script type="text/javascript">
    $(document).ready(function() {
      initUploadify($('#!{name}'), '!{options.UploadUrl}',
        '!{scriptPath}', '!{options.FileExtensions}',
        '!{options.FileDescription}', '!{options.AuthenticationToken}',
        !{options.ErrorFunction ?? "null"},
        !{options.CompleteFunction ?? "null"});
    });
  </script>

</macro>

The usage of the helper remains nearly identical. It’s a method on the view now instead of an Html extension method… So:

<%= Html.Uploadify("fileInput", new UploadifyOptions { ... }) %>

becomes:

<%= Uploadify("fileInput", new UploadifyOptions { ... }) %>

or rather:

!{Uploadify("fileInput", new UploadifyOptions { ... })}

May 16

Spark in the field – MarketWatch 5.0

internet, marketwatch, spark 2 Comments »

spacer The MarketWatch site has recently recently been the target of a massive renovation project. A highlight of some new features from an editorial perspective can be found at the Site tour, but I wanted to take some time to talk about it from a technology point of view.

The initial work for engineering began some time last year, approximately December, we began to create systems known to be necessary for the functionality that would be eventually required. The middle of the first quarter saw the completion of the joint efforts of the design agency and business stakeholders in the form of new IA/UX and design. With an ultimate target date of May 12th I’m sure you can appreciate the fact a huge number of things about the implementation needed to go very well.

Many people on several teams were involved in it’s creation. I can’t possibly name everyone involved but I wanted to recognize a few people who acted in a technical leadership capacity.
Read the rest of this entry »

May 06

Recipe for Spark build/dev machine on Virtual PC

build, spark, virtual pc, visual studio 1 Comment »

I had a Virtual PC instance die recently. Oddest thing – it wouldn’t accept network traffic anymore. If it wasn’t virtual I’d have assumed it was a hardware problem.

I need to create an RC2 build of Spark, so I need to recreate a suitable platform. To kill two birds with one stone I thought I would keep track of the software I installed to be able to run the Spark distribution build.
Read the rest of this entry »

Previous Entries
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.