Skip to main content Skip to footer

ComponentOne at GIDS conference

The ComponentOne team was at the GIDS conference recently, where I gave a talk and demo about features of upcoming ASPNET5 and MVC6. It was a great opportunity to interact with developer community and hear their ideas and views about technology trends. In general, there was excitement about the path Microsoft has taken by making the ASPNET5 project open source and the improvements that it has done to the platform.

Cross Platform

ASPNET 5 is a cross-platform technology to create web applications, and the good news is that now you can develop an ASP.NET application on Windows, Mac and Linux using the new core CLR. The in memory compilation feature augmented by the Roslyn compiler is a real game changer. Now you do not have to go through the lengthy build process, just make changes to the code file, save and hit refresh in the browser, and the code change is automatically applied.

MVC6

This has generated great enthusiasm among developers and the JSON based project structure is also a nice move. Apart from the new project structure you have first class support for DI with a basic container built in, now you can access services at all stages of the new Http pipeline be it StartUp, controller or views. ASPNET5 has also streamlined common API's for WebAPI and MVC, for example both use controller from the same base class. The integration of client side tools like bower and grunt has allowed Visual Studio 2015 to offer rich client side development experience.

Web Directives

Another feature that created quite a wave is TagHelpers. Historically we've used HtmlHelpers within a Razor View, so when you wanted a Label or a TextBox you'd do this.

@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
    @Html.LabelFor(m => m.UserName, new { @class = "col-md-2 control-label" })
    <div class="col-md-10">
        @Html.TextBoxFor(m => m.UserName, new { @class = "form-control" })
        @Html.ValidationMessageFor(m => m.UserName, "", new { @class = "text-danger" })
    </div>
</div>

There you have some HTML, then we start some C# with @ and then switch out. It's inline C#, calling a function that will return HTML. Here's the same thing, using a TagHelper.

<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
    <label asp-for="UserName" class="col-md-2 control-label"></label>
    <div class="col-md-10">
        <input asp-for="UserName" class="form-control" />
        <span asp-validation-for="UserName" class="text-danger"></span>
    </div>
</div>

In this case, "asp-for" and "asp-validation" are not HTML5 attributes, but rather ones that ASP.NET is looking for.This is very clean, imagine how easy it would be for a designer to understand such code. To summarize, these are great features which would make development much more fun. If we had to pick big bang features of ASPNET5 then they would be:

  • ASP.NET MVC and Web API have been merged into a single programming model.
  • New JSON based project structure.
  • No need to recompile for every change. Just save and refresh the browser. Compilation done with the new Roslyn real-time compiler.
  • Dependency injection out of the box.
  • Side by side deployment of the runtime and framework with your application.
  • Open Source via the .NET Foundation and is taking public contributions.
  • Also runs on Mono, and on both Mac and Linux.
  • Everything is packaged with NuGet, including the .NET runtime itself.

And here is the big one that was recently announced during the BUILD conference, "Visual Studio Code", a code editor which allows you to write and debug code and also supports IntelliSense. This code editor is available for Windows, Mac, Linux environment. To know more about ASPNET5 please refer Scott's blog post. If you haven't yet checked out our new ASP.NET MVC Edition then click here to know about these lightweight and fast controls. ComponentOne is committed to support ASPNET5. In the next releases you will find ASPNET5 compatible MVC controls which will support latest features. Stay tuned.

MESCIUS inc.

comments powered by Disqus