Compsoft Flexible Specialists

Compsoft plc

Compsoft Weblog Compsoft Website News Archive Privacy Policy Contact Us  

Monday, January 11, 2010

ASP.NET 4.0 now 50% more SEO friendly

Okay, so I made that statistic up, but this post will cover some of the extra SEO related goodness Microsoft is including in the .NET framework.

I previously mentioned the Microsoft SEO Toolkit which helps find SEO issues with your site here.

Why is Microsoft including SEO features anyway?

For public facing web sites and web applications, visitors are the lifeblood that keeps their businesses flowing. Every visitor is a potential customer, and who doesn't love customers?

For most web sites, a high proportion of new traffic comes from search engines, so improving the relevancy of your site will lead to higher rankings in search results. This in turn leads to greater visibility and higher traffic.

SEO can be the difference between success and failure, and that importance is reflected in the changes made in ASP.NET 4.0.

So what's new?

1. Page.Keywords and Page.Description.

The Keywords and Description meta tags have traditionally been the first place to optimise your pages, in keywords you can offer a list of words relevant to the current page. Description is used as a short description of the page, search engines often show this as part of the listing in the results, so it's very important.

Whereas before you had to manually inject keywords and description into a page, you can now manipulate these directly via the Page class.

2. Permanent Redirects

Renaming links and removing old content that have previously been indexed can lead to an accumulation of stale links. Nothing turns visitors off like a big error page when they click one of your broken links.

One way to handle these broken URLs is to do a Response.Redirect to a working URL, this means the visitor gets a page which is good, but results in the search engine believing the link is still fine, which it isn't. The best way to deal with this is to use a permanent redirect so search engines know the page has permanently moved, this means it will index the new URL and remove any dead links.

.NET 4.0 introduces a nicer way with:

 1: Response.RedirectPermanent"("PathOfWin.aspx")

You can do this manually by returning the 301 status code yourself, but this is certainly a win for speed.

It also introduces the MVC method of:

 1: Response.RedirectToRoutePermanent("SomeRoute");

I'm sure there'll be lots more info on .NET 4.0 improvements to come in future posts.

Labels: , , ,

Tuesday, November 11, 2008

Richard Thomason: TechEd 2008 Day 2

3 Oslo, Dublin and WF4 - David Chappell

Not the ex-Compsoft employee David Chappell, instead a rather annoying "gee dub-f" Seattle microsoftie.

This session promised a rewrite of the Workflow foundation. I went to a couple of sessions on WF3 last year and Tim investigated it for Hippo, and both of us found it to be inadequate. The hope is that the new version may be more up to scratch.

As it turns out, there has been a lot of work done. The workflow engine got a rewrite and is "much faster". They added a Flowchart model in addition to the Sequential and StateMachine ones. To help people who are afraid to write their own host process (?) sic, Dublin provides something like a service host for WF activities, including start/stop/restart and persistence. WF is the sort of thing you would use with SharePoint to implement simple activities beyond the scope of form-filling. Comparisons with Biztalk are probably not useful. Biztalk is not free.

Latterly, David spoke about Oslo, which is a general purpose modelling platform; here's an url for you to look at:

http://www.microsoft.com/soa/products/oslo.aspx.

Unfortunately, my BLX detector was activated during this part of the talk, and when he started talking about modelling schema languages and first releases, it triggered the "bail out now before the Tourette's kicks in" alarm.


4 Developing data centric web applications - Jonathan Carter

This session demonstrated substituting DynamicData controls for normally bound ones using templates to reduce the amount of code in asp forms. I can't resist saying that these are features that have been in Equinox since version 1 :) but enough of that since we didn't do forms in the web server, yet. There is a large amount of work to set up the template and refer to it in the form, however it is work that needs doing only once, and is extensible with user-defined types and so on. This does look good, especially for new, more substantial applications, but it still gives me the "whole load of legwork" feeling, and I don't see the point of reverse engineering it into existing apps. Maybe my expectations are too high.

5 Developing accessible web apps with Silverlight- Sean Hayes

Well it was either this or Windows for Washing Machines. I was concerned to see that the "with Silverlight" part of the title was missing from the title slide, but I thought I'd stick it out to see what I could learn. Sean rehearsed the well-known accessibility feaures in standard HTML - alt text and so forth, then went on to describe ARIA, which extends accessibility features in the latest browsers now, and will be part of HTML 5. It provides assistance in more complex controls such as drop-down lists and slider controls, etc, as well as a "live region" feature that allows assistive technology to handle dynamically updating areas of the screen.

Silverlight 2.0 is fully enabled for accessibility, and in this repect is unlike most modern browser-based implementations. Audio have have transcripts, and video can have captions or subtitles, as well or instead of transacripts. Finally you can use descriptions, which can pause the video if necessary. PC media allows for sign language translation more easily, since unlike TV it can be switched off and on.

6 LINQ and C# - Luke Hoban

This session is a warm-up for tomorrow's dead exciting LINQ to Anything talk, to remind me of the deep details of LINQ in C#.

LINQ works with both objects (via an enumerator interface) and via SQL (via a query interface). It's the same deal for both, and only varies in the provider and the references, eg Customer object versus db.Customer data provider, and so on. Luke showed a simple example querying customers:

var query = from c in LoadCustomers() where c.city == "London" select c;
var query = LoadCustomers().where(c => c.city == "London");

He demonstrated the .Net Reflector tool which shows details of generated code. CachedAnonymousDelegates turn lambdas into references to private static methods. If static methods start with "this", it defines an extension method that can be used with dot notation. He then overrode the Where method ("yield return" adds item into the output collection) on IEnumerable, which only executes as much as it needs to get to the next element, then returns that.

He then showed a SQL version demonstrating expression trees, which showed how out of memory execution works. Lambda expressions can also be turned into expression trees:

Expression<Func<Customer, bool>> MyExpr = c => c.City == "London";

IQueryable is equivalent to IEnumerable for out of memory types. It contains a pointer to an expression tree, and a Provider which can executes the query. The Provider needs to traverse the expression tree and provide results for resolvable items.

7 Using multicore resources with the concurrency runtime - Joe Duffy

Anything that makes it easier to do multi-thread programming is worth checking out. This was a brain melting discussion of how Windows native and the CLR do thread pooling and task allocation. There are two separate systems which mirror each other. The Concurrency runtime will ship with VS 2010.

The CTO of Intel said last February that he believes we'll have 80 cores in our pc's within the next decade. Secondly although Moore's law is not broken for numbers of transistors available, the fact is that the increase is not going to lead to an increase in speed as it has done in the past, so therefore in order to speed things up we will need to be looking at more concurrency.

The main technique of interest Joe discussed was task stealing, which gives much better performance in highly parallelised processes where threads create tasks recursively. The way it works is that threads can push and pop tasks on their local FIFO queue without locking (except the first one), and if other threads run out of work, rather than wait idly they can lock and pop other queues on a LIFO basis, thus maximising throughput.

Labels: , , , , , , , , , , , , , , ,

Tristan Smith: Tech Ed 2008 Day 2

Introduction to the Entity Framework

I really felt for the speaker here, a quirky, excitable American woman. Both because it's the first session of the day with most people barely awake and also because the audience seemed semi-hostile. Hostile, I imagine, as a result of Microsoft announcement that they're effectively killing LINQ to SQL (which a lot of developers have invested time and code in) in favour of the Entity Framework (EF). As we have also invested in LINQ to SQL for our data access, this seemed like an important session for us.

We currently do a lot of code generation based on the shape of the database so we'll have to update our generation when we make the switch. While there are some obvious gains by using EF which were mentioned, I wasn't sold, the relatively few benefits over LINQ to SQL didn't seem to justify a switch.

Unfortunately the session barely skimmed the surface, no real depth was gone into.

How IT will change in the next 10 years and why you should care

Definitely my favourite session so far presented by an awesome speaker.
There were so many areas that were covered, it's hard to summarise.
Some interesting points were brought up around subjects such as the move towards virtualisation, how the green friendliness of hardware is going to have it's impact and is already.

A really interesting point was the way in which the next generation of employees are going to be the first generation of Digital Natives(DN). Here we are as Digital Immigrants, we were there before the great migration, we've been working through the change and are enjoying the gadgets but we're just not in that same headspace. The DNs of today instinctively navigate and manipulate social networks living their online identities. He pointed out that they're going to be entering the work force where they're to be stripped of their online identities, given a crappy email address and effectively disconnected. Quite a culture shock it will be for them.

The IT industry's carbon footprint is already larger than that of total global aviation. How increasing power consumption means Microsoft will dump their entire computers if a new machine has sufficient power savings. Heat is the great enemy. For the huge savings, data centres are being moved to cold places such as Greenland where there are beefy data backbones between the USA and Europe.

Introducing ASP.NET MVC

In ASP.NET Webforms, there is no master handing your pages and controls the data they need, nothing takes responsibility. The masterpage, page, controls can all have their own presentation, data access and logic.
This can make code less maintainable because you're not sure what in the hierarchy has broken. Wouldn't it be nice if you could have a clean separation of the data, logic and view? Yep! and that's what MVC is all about.
As a result of being separated out like this, your code becomes a lot more testable and you can swap out the different parts as you need.

While this sounds like the golden chalice, it takes a lot more work to make a page. There is a definite hard work tax involved, it's harder to get the same kinds of AJAX functionality that you would by just slapping an ASP.NET AJAX Update Panel around your code.

ASP.NET practices with MVC
Following up on the introduction to MVC which I was very impressed with, this session talked about some of the implementation issues and pitfalls you're likely to encounter.

Also mentioned was Unity, Microsoft's Inversion of Control offering allows you to remove the relationship reliances between layers of your code meaning when one part of your system is rewritten, providing it still matches the interface signature, it can just be swapped out.

Silverlight 2 for Mobile: Developing for Mobile Devices
Mobile development gives you a lot of functionality with a very small footprint.
Somewhere it falls far short of windows and web development is when it comes to graphics. Generally the trade off of using the compact framework is dull looking forms, text and interactivity. While you can do pretty graphics, the work required renders it generally unfeasible.

Silverlight mobile looks to change all that, giving you the full Silverlight experience you'd get on the desktop with all the same awesome animation, vector graphics and interactivty.
For situations where you have a Silverlight website, you can have the mobile get a different experience by checking the type of device requesting the page and redirecting to different content. With Nokia as well as Windows Mobile phones supporting Silverlight, it's a really good way of standing out from the crowd.

Labels: , , , , , , , , ,

Neil Bostrom: Tech Ed 2008 - Day 2

Learning the Entity Framework

Entity Framework is one topic I really wanted to learn more on, however this was not the session to achieve that. The content of the session was only the basics which I already knew. The practical demos were limited. Felt a little let down when I left the session as I missed out on some other interesting topics to make sure I made that session.

Sync Framework - Deep Dive

Sync framework was an excellent session covering everything from what the sync framework is right down to how to write a custom provider for it. The Sync framework allows you to sync almost anything (if you have a provider for it) with anything else. So you could sync a file system with a database, or outlook with facebook etc. This solution would have been a perfect for the Hippo PDA project where we had to write all the synchronisation manually.

Building a Dynamic Info-Screen application with Silverlight 2.0

I was extremely pleased with this session as it was showing a practical implementation of Silverlight in a real world application. The Info screen was talking about ad boards or train station screens, where you need dynamic content inside a range of different templates. Max Knor did an excellent job explaining the architecture of the application and also showing real code to swap in and out dynamic templates in Silverlight. The application showed some of the great power you have with Silverlight, including the ability to run the Silverlight on a client inside a WPF application.

How LINQ Works: A Deep Dive into the C# Implementation of LINQ

This session was a level 400 (uber hardcore) and it was great! Luke Hoban did a fantastic job covering a difficult topic in an easy to understand manner. It covered how LINQ holds together and how the C# compiler converts the LINQ expressions into method calls. Interesting point I learnt here is that the compiler will search closest to the code for extension methods. This means you can override the default implementation of an extension method (like the WHERE clause) by declaring it closer than System.Linq. Luke then covered how IQueryable uses expression trees to allow delayed execution. This is the real power behind LINQ. A real gem that came out when was Luke showed the different code that is generated by the compiler depending on which interface you work against, IQueryable or IEnumerable. IEnumerable lambdas are generated as methods on the class, however IQueryable lambdas are created as expression trees. It's a difference I knew about but didn't join the dots to the different code that is generated.

Silverlight 2.0 Security End to End

Security is not a word I’ve heard being mentioned with Silverlight yet, this is why I jumped at this session when I saw it. Silverlight is very powerful but does run client side so security is a concern. The first area covered was the built in security that the Silverlight CLR uses. It has a SecurityCritical attribute applied to it that is used by the platform Silverlight code, like File.Exists. This code can only be used by the Silverlight framework. There is also a SecuritySafeCritical attribute to allow application code to call code that is SecurityCritical locked. All Silverlight appdomains are sandboxed, no Silverlight app can create app domains or cross call them. To allow Silverlight apps to store settings, there is an Isolated storage class. This is a Virtual File System as it needs to work on both PCs and MACs. The Isolated Storage is per application or per domain. The default space allocation in the Isolated Storage is 1MB, however the developer can prompt the user to request more space. Webservice calls are only allowed to same domain, port and protocol. To make cross domain calls, you need a clientaccesspolicy.xml in the root of that site. We spoke about good practices on securing web service calls by using Querystring tokens when making the calls.

Labels: , , , , , , , , ,