One DevDay at Microsoft Greece

From time to time Microsoft gives you the opportunity to learn more about their products. Today I attended to one “DevDay” called “Unleash the Power of Microsoft .ΝΕΤ 3.5” (link). A set of brief presentations to the new key features in the .NET Framework 3.5.

I was lucky and there was not much traffic in the way to Microsoft premises. Also the bus featured a more or less accurate system to announce the name of the next stop. I got off when the voice named my stop and Microsoft building was there, waiting for me with warm coffee, croissants and christmas sweets. They now how to take care of the ones who will extend their empire (we, developers).

The programme was the following:

WCF Framework

Working more or less as expected from the first day, this framework let’s you communicate with almost any kind of “service protocol”. And also provide services using the same list of protocols. Simple, easy and based on the well known SOAP (hey! WCF it’s not a new protocol. It’s a framework for many protocols).

Workflow Foundation

This is new in Microsoft. People in the Java world know more about BPEL and workflows. For Microsoft this is their first gig and they provide a do it yourself workflow.

This can be good because is so simple that you can implement it even in a console application. But it can be bad because you need to develop almost every detail. If you’re used to something like Websphere, this is not for you.

I like that is lightweight. So perhaps, and with some basic code, you can implement a workflow service for your needs.

WPF Architecture

This wasn’t a “Look a cube rotating with buttons floating! and this is your user interface”. Windows Forms applications were lacking from architecture. Many people were doing bussiness logic directly in the function executed when you click a button. Fast, easy but 2% scalable, 1% testable and 0% adaptable 1 year later.

Microsoft has created an improved copy of the web 2.0 (Where the html is not only for the content, but for the user interface). Its the View, Model, ViewModel pattern (link).

  1. Where you used a designer and photoshop, now you use the designer with illustrator.
  2. Where you used the services of some company/guy to put that design in HTML/CSS. Now you put a guy in Microsoft Expression Blend creating XAML for WPF.
  3. Where you had a developer creating the template, now you create a ViewModel.
  4. Where you had a developer creating the functionality of the application, you have the same guy doing the same and preparing “commands” to be executed by the WPF application.

As far as the guy speaking said, it seems that developers were complaining because they couldn’t do the same mistakes as they were doing before. Also he stated that you cannot test a Win Forms application. However if you divide the code in the right parts i believe is feasible and also the correct way to do it.

ASP.NET The horror begins

Not everything can be perfect, and this presentation followed this rule. It was based on 3 Demos: WCF JSON services, another based on linq using SQL and the ADO Entity framework and the last about a Dynamic Data application.

I’ll leave here some pearls/jewels: (I believe the guy was quite nervous)

  • “Without the ASP.NET AJAX framework we would have to code the AJAX calls by hand”. This guy doesn’t know jQuery, Dojo or Prototype (for example).
  • “A tool than can help you to see what’s happening is Fiddler“. Fiddler is a really good tool. But it makes more sense to me Firefox + Firebug instead of Visual studio to debug javascript, IE to view the page and Fiddler to see the HTTP traffic.
  • “We will see this on the console” (Of a web application). Web applications don’t have console. 5 minutes looking for the console.
  • He made a databind  in the Page_Load of a huge amount of data. This means to mark the data as dirty and force the inclusion on the VIEWSTATE. So he was pushing and encoding half customer list into the HTML produced.
  • “With LINQ to SQL you can only use MS SQL Server”. He should use Google more and visit this link.
  • “You cannot put stored procedures in LINQ to SQL”. Latter he did that on an example and stated that “You cannot put database functions in LINQ to SQL”. I do use SQL functions through LINQ in my daily job. So I guess I should be using something from another planet.
  • He got lost trying to show how to insert or delete on LINQ. I told him where to find what he was looking for, but my comment was futile.

Summary

I guess I learned some useful things about .NET in this small seminar. So if you have the time and you’re interested in Microsoft products, DevDays are worth to attend.

Tags:, , , , »
No comment »

A day with C# and jQuery

jQuery Write Less, Do More

Days ago I tried  ASP.NET AJAX for an autocomplete text field in a form. The results were automatic, in no time you could have the most common and famous features you see in your favourite sites. But after dragging and dropping some controls here and there, and also adding a bunch of .dll’s to the project, a question appeared: what if I want a small modification?

Well, the answer wasn’t clear for me. Perhaps because my experience with ASP.NET is not so big enough to make some changes to a library that packs functionality in other language. Some times I want the things straightforward: from A to B.

So today I decided to reimplement the system using a javascript framework/library. I took a look to some of the libraries available on the net. I did a fast preview of these little amazing libraries and I liked them all. For my tests I chose jQuery.

Results: In one day not only was able to reproduce what I did with ASP.NET AJAX. I personalized the interface adding the functionality I wanted: calendars, creating new sections on the fly. And all this without a call to a piece of server code (except for the autocomplete part).

Before this change, even the javascript code was served using an aspx file server. For god shake! they’re static files! Do you really need to execute an aspx to serve a static file? Now I was able to setup the interface using XHTML, CSS and javascript.

But don’t think that .NET is the bad boy. I like a lot the “webservice” implementation it has. It can output JSON to feed your hungry AJAX/AJAJ applications. With a good web client for fast and quick tests.

Some other links I found interesting:

Tags:, , , , , »
No comment »