ASP.NET MVC 3 Thoughts

17. August 2010

I've been playing with ASP.NET MVC 3 some days now and I have some thoughts about it. First of all, it looks cool, using the Razor syntax in views is already a step in the good direction. But, why on earth do we need Dependency Injection in an MVC framework? DI is cool in enterprise wide applications that need flexible interfaces and thorough testing, but use it in MVC? I think we forget the essence of what a MVC framework should do: display information. No calculations, no fancy techy obscure coding, no, just fetch the data for your view model, do some simple logic for display and input handling and create views for that. Want calculations? -> Use services. Want heavy techy stuff? -> Use services. That is the reason we came up with SOA no?

 

I my opinion a website should have a very small footprint in your business process. It should be easily maintainable and very transparent to non developers like content managers, designers and marketeers. You could say that a good website should have at least some kind of CMS right? Maybe that is true, but still, transparency is the key to success. It helps you tune you site once it slows down, scale your site if it grows, ...

 

If you start using DI you don't know where it ends. MVC is not only a cool framework because you have control over how you would like your views to look, it also offers you a very testable base that allows you to test controllers and views in a simple transparent way.

 

The same goes for the new Razor syntax which is nice and well thought, we all work qwerty right, where the @ is better reachable then our worshipped %. But that is another story. Let’s take a small example of some old MVC code and the new Razor syntax

 

ASP.NET MVC syntax

   1: <ul>
   2:     <%
   1:  foreach(var p in Model.Products) { 
%>
   3:         <li><%
   1: = p.Name 
%> ($<%
   1: = p.Price 
%>)</li>
   4:     <%
   1:  } 
%>
   5: </ul>

Razor syntax

   1: <ul>  
   2:     @foreach(var p in Model.Products) {  
   3:      <li>@p.Name ($@p.Price)</li>  
   4:     }  
   5: </ul> 

 

In both cases if we open these files in an editor that is not Visual Studio, we end up with some nasty code in our design that isn’t supposed to be there. Why not surround all logic tags by <!---->, yes, the HTML comment tags.

 

Suggestion

   1: <ul>  
   2:     <!--@foreach(var p in Model.Products) {-->
   3:     <li>@p.Name ($@p.Price)</li>  
   4:     <!--}-->
   5: </ul> 

 

It solves some issues with our designers I think.

 

Maybe I will be back with some more thoughts about it. My credo still remains the same keep it simple ;)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Featured, Development

Zemmeke.be launch

16. June 2010

Well, you'll figure it out once you get there. We just launched http://www.zemmeke.be

So feel free to visit our brand new one pager ... ;)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Actua, Featured ,

What's in a name ...

19. May 2009

kijker Once upon a time there was a young boy that was looking for a virtual outlet on the web. Together with a few colleagues they all started their own websites. But! Wait a second, it all stands with a good name right? Right! So of we went, searching for good names for our sites. And there it was, out of the blue, as a flash of lightning: B-Virtual! Why? Since the web is a virtual place on a cloud of its own and my name starts with a B there it was => B-Virtual. So, years past by, visitors enjoyed this website, postings were done under the name B-Virtual and all went well. I've been active on the web for about 14 years now, I've seen domains come and go, technologies rise and fall, experienced venture capital at its best thanks to HyperTrust and met many interesting people.

 

But here comes the interesting part of the story. A few months ago I was contacted by someone asking me if I was interested in selling my b-virtual.com domain. My first reaction was no, why should I, it's almost my second name. But they kept asking and I went thinking. Since I live in Belgium and I own both .com, .eu and .be domains I started thinking that I could miss the .com if the price was right. Ok, I here you thinking, here we go, he's going to take advantage of the situation. Not really actually, I made some calculations and found a reasonably low price including fees for new logo designs, email campaigns, branding, ... but the price was seen as to high. No problem for me, I'm not really looking to sell it anyway.

 

Since I'm into the web, I went looking for more information about the company wanting to buy my domain. I came up with B-Virtual, a Belgian, yes Belgian as in Belgium, company. So do the math with me, a Belgian company wanting my name for their company? It seems as if the people at A-Server weren't really in a creative mood. They just took my name. Maybe it's good marketing, take a name that has a good SEO rating a piggyback on it. Don't get me wrong, I'm not against their products, cloud services are the future for some virtual needs. It's just that they were to lazy to search for a fresh and creative name for their brand.

 

To proof that I'm in favor of them, I'll even advertise their website, since I'm still, at the time of writing, higher ranked in Google ;)

Here we go:

B-Virtual delivers ground breaking cloud storage solutions

I wish you all great success in your business since I'm also a through believer in virtual storage solutions.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Featured, Varia