Compsoft Flexible Specialists

Compsoft plc

Compsoft Weblog Compsoft Website News Archive Privacy Policy Contact Us  

Saturday, November 15, 2008

Richard Thomason: TechEnd

The first great thing about TechEd is the buzz. You could spend a little time every month poking around on Microsoft sites, subscribe to their feeds and look at the key blogs. I don't do that and instead rely on the geek version of bush telegraph to alert me of newage that I need to be aware of. This works fine for major stuff, and the killer factor is, it's very low maintenance. At TechEd though, there's a load of people who've been beavering away at Microsoft things for a whole year and are busting to show you. You can spend days reading blogs and feeds and forums and really, it's all words; ten minutes in a TechEd presentation, and you can tell from the seniority of the speaker, the information content and the demo whether something is useful now or over the horizon, irrelevant or cool, forget it or must have.

Azure is a good example of this. I have a blx alarm that automatically goes off every time I hear the phrase "in the cloud", and until last week it has protected me from discovering much about it. I figured I'd better go to an overview since there was so much buzz, and ended up going to a couple more sessions to get the big picture and some practical demonstrations. If MS get the scalability / cost right, and if they make deployment a doddle, and if you can write your app in such a way that it is deployable in or out of the cloud without too much hassle, it could be big.

The second great thing is the random element. It's important to go to the widest selection of sessions that you can, since often the least likely turn out to be the most exciting. You can use the Robotics product to make a cut down version of Windows; that has to be good for something. You can also use it for loosely coupled but high performance applets which must inter-communicate. Virtual Earth, which I had pretty much written off because the Google offering is so good, is actually much better than I realised. There's no excuse now for customers to shy away from GIS functionality in their applications.

Finally, it's a great team builder. There's nothing like being in an away team to clear the air and refocus. It's good to be on the plane home too though. A week's uninterrupted geekery is enough for me.

Friday, November 14, 2008

Tim Jeanes: TechEd 2008 - Day 5

DAT317 - Project "Velocity": A First Look at Microsoft's Distributed Caching Framework

Velocity is Microsoft's upcoming caching framework. It's a distributed in-memory cache for all kinds of data - CLR objects, rows, XML, binary data, etc. - so long as you can serialize it, you can cache it.

This allows you to share cached information over a number of web servers, providing fast access to the data held in the cache. The cache itself is also spread over a number of machines, but you never need to know which server is holding your cached item. Velocity supports failover too, so if one of the cache hosts goes down, your cached item is still available from another host.

Objects are stored in the cache as named items, so the cache acts like a dictionary. Simple Get and Put commands can be used for basic access. Optimistic concurrecy can be used: Velocity tracks a version number of each item internally and only lets you update an item if there have been no other updates to it since it was retrieved. More pessimistically, you can use GetAndLock/ PutAndUnlock/ Unlock to prevent other threads or other servers updating items you're using. On top of the name of each item you cam apply tags, letting you retrieve sets of data with the same tag all in one go.

As you'd expect, you can configure the cache to specify how long it holds on to items before they expire and have to be retrieved from the backend database again. A nice feature is that it also supports notifications, so that if you update an item in the cache, that cache host notifies all others that the item has been changed. Of course this model has a bit more overhead, so which to use depends on how time-critical the accuracy of your data is.

Velocity also supports a SessionStoreProvider, making it easier to share session data over a number of web servers. This is about 200% faster than using SQL Server to store session state. Again this supports failover, so even if the primary machine that's storing your shopping cart goes up in smoke, that's not going to stop you spending money.


PDC309 - Designing applications for Windows Azure

This was a great session because it filled in a lot of the detail of things we'd learnt about Azure earlier this week, and because it gave some coding best practices for working on the cloud. The presenter has already deployed a number of real-life Azure-based applications, so it's great to be able to pick up what he's learnt the hard way.

I was a little surprised at some of the limitations of table storage. You can only have 255 properties per entry, which seems a bit arbitrarily small. Properties on table entities can only be the basic types (int, string, DateTime, Guid, etc.), as you'd expect, but there's a field size limit of 64K for strings and byte arrays. Each entity is limited to 1MB in total, though I suppose that makes sense - once your objects are getting that large they probably belong in a blob anyway. On the other hand, I'm glad to hear that they will be adding index support to table entity properties.

For now you only get indexes on the row key and the partition key (both of which are strings - up to 64KB each). As a pair together, they make the primary key for the table, which I think is perhaps a little awkward: surely the row key by itself should be enough? It would make cross-partition joins much easier, and we all love GUIDs anyway. However, I suppose this does push you in the right direction: cross-partition joins can potentially be more expensive (because Azure will always ensure each partition is held entirely on one physical machine), so I guess you should avoid them where possible.

As you don't get indexes on other properties (for the CTP, at least) this means you have to denormalise your data all over the place if you're going to want to do any kind of searching. More critically, as table storage has no support for transactions, it looks like we'll be waiting for SQL Data Services to come out before we try any real-life database-type storage in the cloud.

We also took quite an in-depth look at queues and how to process them in worker roles.

There is absolutely no limit to the number of queues you can have, so go crazy! One queue for each customer would be entirely feasible. The only restriction is the name of the queue: as queues can be accessed in a RESTful way, the name has to be something that you can use as part of a URI.

I quite like the way messages are handled as they are read from a queue. When a message is read, it is marked as invisible so that other worker roles don't pick it up. If the role that took it dies and never deletes the message, it becomes visible again after a configurable timeout period. The downside is that if a malformed message always causes an exception, it remains on the queue forever. the way to handle this is to check the time the message was created, when you read it from the queue. If it's been there for a long time, delete the message from the queue. What you do next depends on your application - you could log the problem, put the bad message onto a "bad messages" queue, or whatever.

It's possible (and more efficient) to read a number of messages from a queue at once, then process and delete them one at a time. Once the messages have been processed, you loop the worker role back to the start again - just by using while(true) - but sleep the Thread for a bit first if the queue was empty.

One point that was mentioned a few times was that you have to code to accommodate failure. Worker roles may die unexpectedly part way through processing a message, for example, leaving your table storage in a half-baked state. The fact that everything is stateless coupled with the lack of transaction support on the table storage means there's a whole bunch of craziness you'll have to code around.

The worker role has a property that returns its health status - you have to implement this yourself. An easy check is to see how long you've been processing the current message and flag yourself as unhealthy if it looks like you're stuck in an infinite loop. The health property does nothing in the current CTP release - in future Azure will monitor it to choose when to kill and restart the worker role.

One little gotcha: when DateTime.Now in the cloud, remember you don't know where your code is running, so you can assume nothing about what timezone you're in. Always use DateTime.UtcNow instead.


DVP315 - Do's and Don'ts in Silverlight 2 Applications

As we're just starting out in Silverlight 2, this was a really handy session. We got some tips from someone who's already made all our mistakes for us. Here they are:

Don't:

- Leave the default "Install Silverlight" message.

It's rubbish and if your user hasn't heard of Silverlight then they're not going to install it. Instead display an image that shows the user what sort of thing they'll see in the real application, with a message telling them what they have to do.

- Take a long time to load.

Instead load assets after the main app has loaded. Also cache assets in the isolated storage so they don't have to get it again next time. That way if there's no internet access, we can look in the local cache. It there, your app can work offline.

- Leave the default splash screen.

- Use width and height with

Resizing videos is very costly and wasteful in terms of CPU time, so show videos at their natural size only. Similarly, animating the size of text or complicated paths is also CPU intensive. To animate the size of text, build a vector from the text and scale that.

- Use a transparent background to the Silverlight app - it's very expensive. Admittedly it can look great though...

- Use opacity to hide something.

If you fade something out, remember to set Visibility=Visibility.Collapsed at the end.

Do:

- Show the designer mock data for use in Blend.

You can detect where a user control is being rendered by examining DesignerProperties.GetIsInDesignMode(this). Elsewhere you can check HtmlPage.IsEnabled.

- Use EnableFrameRateCounter=true when debugging.

This shows the current framerate in the status bar of the browser. Set the maximum framerate to something very high so you get an accurate indication of how your application's performing.

- Use BackgroundWorker or asynchronous calls.

The UI stops redrawing whilst code is running on the same thread.

- Use xperf to monitor performace.

This is a really handy tool that monitors and records the CPU usage of all processes. You can drill right down to individual procedure calls within your Silverlight app, showing you exactly what part of your application is being resource-hungry. Remember to run it as administrator.


WIN312 - Deep Dive into "Geneva" Next Generation Identity Server and Framework.

I'd heard references to Geneva and its claims-based identity model, so I thought I'd check it out in a bit more depth. At its most fundamental, claims-based identity supplies a series of flags that describe attributes of a user. Who provides the claims for a user can vary, but so long as your application gets the claims from a trusted source, you're good to go.

Under the Geneva framework, claims are passed around as security tokens, so are cryptographically protected by the claims issuer (normally Geneva Server). The Geneva framework takes care of all the cryptography for you.

The IClaimsIdentity, IClaimsPrincipal interfaces are available in .NET to code against, and are compatible with the existing roles-based security model. The Geneva framework converts information such as roles from Active Directory into claims.

The framework is extensible, so you can communicate with any type of issuer that you like (or that you invent), just so long as you have some way to convert their security token to a string.

You can add your own Claims Authentication Manager, where you can transform one set of claims to another. For example, given a claim that the user is in the UK and a claim that states they're over 18, you can emit a claim that they are legally allowed to buy alcohol.

This makes it really easy to define as many of your own application-specific claims as you like, and as Geneva already communicates with Active Directory, Live ID and Cardspace, quite a range of login routes are available right out of the box.

Geneva is a Windows component so is essentially free to use (or will be once it's fully live some time next year).

Richard Thomason: TechEd Day 5

17 The Future of C# - Mads Torgerson

Mads described the main areas of change in future versions of C#. It will be more declarative and functional, like LINQ and F#, and say what you want to do, and not necessarily how or when or in what order. These features can also help with asynchronous programming. Also more effort will be made in the area of concurrency as we address the need to make use of all those cores in our future machines.

C# in future will co-evolve with VB. Where in the past, features were put in as separate language features, now more effort will be made to ensure features in each language are equivalent where it makes sense to do so.

There's now a Dynamic Language Runtime which brings the compiler features to the runtime environment, and contains compiler features such as a parser and expression tree management, dynamic dispatch (useful for COM). In the language itself, there's a new dynamic type which delays type checking until runtime. Mads demoed this by pasting in a piece of JS code and converting it to C# with a few changes.

C# 4.0 will have optional and named parameters, nicked from VB. Mark parameters as optional by adding = value in the function declaration, and use paramname: value to pass named ones. Named parameters must be passed last, after the positional ones.

Improved interop with COM has been a big priority. The ref keyword is now optional as many parameters are passed by reference because it was more efficient at the time to pass a pointer. Obviously if it actually gets written to, you need to put it in. Parameters previously mapped to object are converted to dynamic, and so casting is no longer required.

There's some stuff on relaxing return types from functions - safe covariance and contravariance. If you're a compiler geek, see http://andersnoras.com/blogs/anoras/archive/2008/10/28/c-4-0-covariance-and-contra-variance.aspx for more details.

After looking at what the F# guys are up to, no doubt, and realising that in order to support LINQ they need a lot of the compiler at runtime anyway, they got around to implementing a compiler support library which gives you access to all parts of the compiler. I guess if you felt the need you could write your own IDE. Ho hum, this makes it a lot easier to do an Equinox method language which emits C#. Mads demonstrated an Immediate window in a few lines of code, and it gives you an Eval function for free. Of course Equinox has been doing all this for years... Hehe.

18 Debugging performance issues, memory issues and crashes in .Net applications

This was a repeat session, and was unfortunately full up, again. I'll have to catch the video of this one. Time for some work on Support's urgent 4.20 issue.

19 Universal sign in using Geneva - Sam Devasahayam and Sidd Shenoy

In a distributed, multi-company, cloud-based environment, it is no longer appropriate or even possible to use AD for authentication as in the past. To address this and other problems, the Geneva project provides a server based solution which uses industry standard token based security to provide authentication and other information services. For reasons which are not clear to me, pieces of information held by the system are called claims.

This technology does not require code, and can be set up via wizards in a very similar way to AD. It can be used as a simple alternative to merging directories when two companies merge - actually it looks like a no-brainer in that situation, and since Cardspace also has a Geneva version, it looks like internet user login is going that way too. It turns out that Geneva is the son (daughter?) of Active Directory Federated Services and Cardspace.

There are programmatic APIs similar to AD.

20 Distributed concurrent enterprise software using REST - Arvindra Sehmi

I've been meaning all week to take a look at the Microsoft Robotics Studio, and this is my chance, as this seminar explains how people are using it not only for the cool stuff like flying unmanned aircraft and factory automation but also for business uses where there's a need for a coordinated messaging system across loosely coupled nodes.

More information, this session has been removed, so I'll have to go to Windows Embedded CE and Robotics instead.

Windows Embedded Compact is the robot and phone ready version of Windows CE which also runs on personal navigation devices. It's not Windows Mobile 6.0. I'm confused, but hanging in there. It features a .Net runtime targeted for the devices required, typically about 10% of the size of the PC framework, and providing 30% of the functionality. WE Standard is a tunable version of XP Pro which can produce a small footprint OS suitable for embedded devices, and there's a fully featured enterprise version. There's also Windows .Net micro which is an embedded hardware access .Net.

A CE robot is a programmable system of sensor and actuators, so pretty much any automated system is a robot by this definition. Olivier configured and launched a build of CE (which takes about 20 minutes) then went through the requirements of a real time OS in excruciating detail.

CE is deterministically scheduled, inevitably, which runs counter to most of the low level software I've encountered in the past. However it does appear that they've addressed this and have a reasonably sophisticated mechanism for handling interrupts. Interrupt management is what embedded software is all about, so I'm not convinced by the architecture of this product. However it's a nice idea to be able to develop in a high level productivity environment. Olivier explained the work they've done to minimise the effects of uncontrolled things such as garbage collection.

The Concurrency and Coordination Runtime handles messaging and locking, so simplifies inter-taask management. Decentralised Software Services access individual pieces of hardware and are managegd by an Orchestrator process. This is quite similar to ordinary Windows, clearly.

Olivier put together a simple demo using a robot that he made out of a hoover, an interface card and a tiny pc with a wireless card.

Tristan Smith: Tech Ed 2008 Day 5

TLA311 The Future of C#

C# 1.0 gave us the ability to run managed code, C# 2.0 gave us generics, C# 3.0 gave us LINQ.
There's a strong drive towards dynamic languages and declarative programming at the moment. Declarative programming is about the what, not the how. So with LINQ, we say filter these results on Id, how it does that you're abstracted from.
Dynamic languages - simple and succinct, implicitly typed, meta-programming, no compilation
Static languages - robust, performant, intelligent tools, better scaling

C# 4.0 is enabling greater dynamic features.
Concurrency is a big challenge, we've hit a wall with clock speed so we're now going multi core processors. So in order to make use of these, you have to be able to have code run in parallel and asyncronously.

Microsoft are pushing a co-evolution with the languages that run on .NET so the features that c# has and VB doesn't (and vice versa) are being developed in parallel now, they should be much more the same.

Dynamic programming, DLR (Dynamic Language Runtime) allows a bridging between the static CLR and the dynamic world. Uses expression trees, dynamic dispatch, call site caching.
IronRuby, IronPython, C# and VB can all run against the DLR and allop interop between them.

Static type called dynamic allows dynamic calc - GetCalc(); int sum = calc.Invoke("Add", 10, 20) the actual type is deferred until runtime where the compiler will substitute the dynamic types for the actual types. The trade off is type safety but are more for situations where you don't have type safety anyway.

Javascript methods declared on the page can be called from the c# code by declaring an HtmlWindow.AsDynamic and calling window.MyJSMethod();
Moving Javascript to use dynamics in C# means you don't need to code in js, though you lose all intellisense because we don't have types to interrogate.

Optional and named parameters, currently we use a lot of method overloading OpenFile(string path, bool throwExceptionIfNotFound), OpenFile(string path) with optional parameters you can just use the first there with bool throw = true, setting a default if nothing is passed. Named parameters enable you to go OpenFile(throw: false).

Improvements with COM where before where there are optional parameters now rather than saying OpenFile("myfile.txt", Missing.Value, Missing.Value) because we don't have optional parameters currently where COM does, now we can just call OpenFile("myfile.txt").

Improvements also with co and contra-variance. Arrays are covariant, but not safely (can add a button into a string array of objects. Also you can now pass objects into methods based on base types.
This allows you to do this: public void ProcessCustomers(List stuff) and pass a List for example.

C# evaluator which is scoped so you can declare functions and use them in other evaluations. It allows you to do things such as declare and run code at runtime. Useful for things like plugins and even for secure remote debuggers.

PDC309 Designing applications for Windows Azure

We've seen a few more conceptual and technology sessions on Azure during the week but have yet to see any real life business use, that's what I hoped to get out of this and wasn't disappointed.

He started with what Azure is not, it's not a hosted windows server, or a sql server that you have access to. He gave things not to do and things you can't do.
He used the business example of the RNLI who monitor 10000 vessels and want to extend their safety of life services to the entire UK marine leisure market clearly to build in the redundancy would be a huge infrastructure headache. With Azure, they need only increase the number of running instances to match demand.

Working with queued items when you pull it off the queue, it hides it from other workers with a default timeout so if you don't finish working with an item on the queue (worker process fail for example) it'll get put back on for another worker to access.
Because of the parallel processing model, you need to write your code to expect failures at any point of inserting, deleting, processing etc in the case of a partial failure. Although not active in the CTP, in order to allow Azure to know whether to spin up another instance (in a non catastrophic failure scenario), you can override the health status. You need to forget ultimate accuracy though, because processes can fail after you're 80% though your app logic for example. Poisoned messages (things added to the queue that when processed cause the process to fail) need to be handled by us otherwise they'll keep being run.
The key message was that failure is guaranteed, deal with it. Compensate for errors, don't rely on state.

Useful information was that there are always at least 3 duplicates of your data for robustness.
Some best practices for scalability were shown with tables such as using the partition key as a point of scale, if you imagine every partition is stored on a separate server you can see how this scales well. Row key is there for performance with queries.

A really good talk that showed some really good best practices, much needed after the more abstract hello world examples we'd seen elsewhere.

DVP315 Dos and don'ts in Silverlight 2 Applications

Another useful best practice session. 75 minutes of what to be aware of, avoid and make sure you do.
For user experience, don't use the default Silverlight installer (a white image with a single "Install Silverlight" button in the middle) put your own in and point to it. This is a great place to show an image of what the user can expect when they've installed your app.
Don't load your application all at once, only load what you need to start the application, otherwise you make the user wait. You can download other resources to the user's isolated storage as a cache then load them next time they run it.
If they do have to wait, customise the wait screen by creating your own and pointing the onSourceDownload event at your progress bar update method.

There were a lot of performance tips:
Don't use transparent backgrounds, match the website colour. Don't animate text, make text into vectors and animate that, though don't animate paths if possible these are both expensive. Dispose of invisible controls, once you've animated to an opacity of 0, set vibility to collapsed if needed or otherwise remove them. They're never garbage collected until the references are removed. Use background workers and async webservice calls. Use GC.GetTotalMemory(true) to find out the current memory usage of your appliction. That way you can create a memory usage displaying control for debug. Use EnableRedrawRegions and EnableFrameRateCounter to give you a good view of how your interaction impacts performance. Don't set the width and height of media elements, provide alternate sized media, the media actually gets recoded, blended for transparency etc on resize.

Other tips were:
Hide controls that can't be interacted with such as textboxes in fullscreen mode where you don't have keyboard access.
Help designers out by outputting mock content for controls only shown if in debug mode using a method such as preprocessors (#if debug)

Neil Bostrom: Tech Ed 2008 - Day 5

Project "Velocity": A first look at Microsoft's Distributed Caching Framework

This session gave us a look at a very new project that has started at Microsoft. Distributed Caching is a common practice for any high traffic website. There have been a few products offering this on the market for years but this is Microsoft's first attempt to enter this market. We saw some demos of installing and running the cache server. The installation was simple enough and had some nice configuration options. The cache server had a very simple API for putting and getting cache items. The cache items can be split into regions, these regions restrict the item to being on the same cache server. This is helpful for grouping items together when you access them all at once. The down side of this is that it wont be distributed across multiple servers, reducing scalability. The project does look very promosing and would be ideal for any large scale websites we need to build. The final release date is due mid next year.

Real life experiences: Building your first service application

This session was presented by someone that had written an actual solution on the Microsoft Windows Azure Platform. As the cloud works very differently from anything we have worked with before, this was an excellent session to find out the pit falls and restrictions when working with the Azure Platform. The cloud has a few storage mechanisms, tables, blobs and queues. The session went into detail when working with the queues. When you take an item off the queue, it will just mark it has hidden, then once you have completed your work with the message you can remove it. If you do not remove the item from the queue (Like if your process died) then the message will reappear after a time out. This makes the system very resilient.

Do's and Don't in Silverlight 2 Applications

This session included excellent advice when working with Silverlight. The first item he covered was changing the loading screen for Silverlight. He then went into detail about avoid resizing videos and text as these have a heavy performance hit. He showed a nice user control for tracking memory usage in your silverlight application. Finally he covered Xperf, which is a nice performance monitor for windows.


Top 10 Web Mistakes And How To Avoid Them

This was the final session of the day. It was a nice interactive session on tips and tricks for building websites. Some nice tips on building websites, including headings to be searchable. Make your colour scheme friendly. The "what not to do" sites were shown, that were well amusing.

Thursday, November 13, 2008

Tim Jeanes: TechEd 2008 - Day 4

DAT318 - Microsoft SQL Server - Data Driven Applications from Device to Cloud

This was an extremely interesting session where we saw how SQL Server will evolve in the future, most particularly in connection with cloud computing.

Yesterday I was thinking that using SQL Data Services in the cloud would be pretty much identical to using SQL Server on a traditional server. It turns out that this is far from the case! Though they say they will support traditional database tables sometime soon, that's not the direction Microsoft are taking things and is not really the paradigm to use when thinking about cloud data storage.

SQL Services will store data in the Table Storage. It chucks everything into one big table, with all your different types of entities in together. It doesn't query the table using SQL statements, but rather uses LINQ. A typical statement might look like this:

from customer in entities.OfKind("Customer")
where customer["Surname"] == "Smith"
select customer

What makes it crazier is that there's no schema whatsoever to go with this table. If our application changes and we now need to add a MiddleName property to our customer class, we can just do that and start chucking our new form of customer object into the same table. We'll have to bear that in mind when we query the customers, of course. Even more so if you ever change the datatype of a property.

Another consideration is partitioning of data. Whenever you insert a record of any kind, you have to specify the partition that that record belongs to. The partition name is just a string and you can create as many as you want.

When you query data, your query can't cross the partition boundary: every query runs on a single partition. That's both a massive strength and a massive weakness. On the one hand, if you know which partition your data is in, your query will run very quickly. Let's say you partition on customer id (which was one option the speaker recommended), when you're considering data belonging to that customer you'll get results in no time. However, when you want to search for customers called Smith, you're stuck.

The only thing you can do to query across partitions is to launch queries in parallel, running one in each partition. In our customer search example, that means you're going to run one query for every single customer, which is clearly madness.

So what makes for a good partition decision? I don't know yet, and from talking to the speaker after the session, it doesn't seem anyone else really does either. For massive database (such as those for Windows Live Messenger or for Hotmail), a poor partitioning decision early in the project's lifecycle can have massive repercussions later on. Fortunately, Microsoft plan to have SQL Data Services make it a whole lot easier (for a start, possible) to change your partitions on a live database.

For the size databases we typically use at Compsoft, where (excluding binary data) they typically don't go far over 5GB, it's tempting to chuck everything into a single partition. That's not a scalable solution, though, and it's going to be a nightmare to go from one partition to multiple partitions later on. Also, the CTP release of SDS won't allow partitions bigger than 2GB. So should we arbitrarily assign each customer to one of a handful of partitions, then add more partitions as the application usage grows? Should we split on the first letter of the surname for now, moving to the first two letters when our application becomes too popular? Should we split on country? On the year the customer signed up? Which partition do we put our lookup data in (maybe it belongs in its own partition and we cache it all in the app)? Let's just try it and see!


WUX310 - Beauty and the Geeks: Developer-Designer Workflow

The Compsoft/BlueSulphur partnership is still a pretty new one, and we haven't really figured out quite how to balance the relationship between designers and developers. This session focussed on how to work side-by-side on the same Silverlight project. As this is something we're moving into, I hoped to pick up some pointers on good working practices. I wasn't disppointed!

We saw the development of a Silverlight control, what work the designer and the developer each did, and what considerations they had to make to how the other worked.

The project is available on codeplex: look for DeliciousSilverlight.

This is the first of seen of any real code behind in Silverlight development, and was impressed with how easy it all appears, and well-structured it is.

We saw some good practices for how to make your Silverlight controls unit testable: to do this we create a view model that exposes properties to the user interface. The designers can work against these in Blend, while the developers hook them up either to the actual view or to unit tests. We can detect whether the control is being rendered in a browser or in Blend, and by using dependency injection we can provide mock data that will appear in Blend for the designers to work against. This is genius!

When binding properties on the controls we develop to the view model, use the syntax: Text="{Binding MyTextProperty, Mode=TwoWay}" - this ensures the Text property of the control reads and writes to the MyTextProperty in the view model, both from Blend and from the browser.

We also saw how to make controls that are skinnable in Blend. Using the TemplateVisualState attribute on the control class exposes a number of states that the control can be in (visually). Then in code, you handle the various events that trigger different display states (mouse over, click, etc.) and use VisualStateManager.GoToState to change the control's appearance.

Using the DependencyProperty type, we can expose further properties of our custom controls to Blend. You use this to tell it which actual property in the class you want the designer to affect, set default values, and (optionally) set a change handler method to do anything you need to in order to reflect changes made in Blend on your control is real time.

That's pretty much all you need to do to enable the designers to use the Blend world they're used to to play with your controls and style them visually to their heart's content.


PDC307 - Microsoft Visual Studio 10: Web Development Futures

Here we covered some of the improvements that will be coming out in Visual Studio 10.

First up was the designer view for web pages. At last, this renders in a standards compliant way! Yay!

If like me you prefer to type your own markup in source view, it's just great to see that code snippets now work in there as well as in the code window. They're giving us about 200 out of the box as well as the ability to add your own. I think this will really make a massive difference in churning out easy pages.

Also, when it comes to deleting controls in the source view, triple-clicking an element now selects the whole of it, which will make the whole process a lot less fiddly.

There are some improvements to javascript intellisense. It used to work cross-file only, but is now available within the same script file. Also, if you have separate javascript documentation for intellisense purposes - such as the recently Microsoft-released jQuery support files - there's a fix that means those files (though included in your project) won't be shipped to the browser. This change is already available as a hotfix to VS2008.

Another cool new feature is config transforms. You can set up your base web.config file, then create transforms that describe (in XML) how that file should be modified for use in debug, release, staging, etc. You can create one of these for each Build Type you have defined. When using msbuild to perform your compilation, these can be called in using the switches /t:TransformWebConfig and /P:Configuration.

There are some improvements on the web site publishing front too. They've reworked the publish dialog box, and the publish tab in the project properties has been expanded to include such things as which files are included, which IIS settings, etc.


ARC309 - Using WPF for Good and not Evil

OK, it had been a long day of amazing stuff and my brain was pretty fried, so I was up for something a bit lighter, and (as ever) David Platt didn't disappoint.

We took a look at a few applications in WPF, where (with all the whizz-bang graphical power it gives you) it's extremely easy to make a truly bad user interface. It's also easy to make a really good one, but only if you know what you're doing.

The key fact is that most developers don't know what they're doing, and though a designer can make something look pretty awesome, that doesn't mean they're any good at designing a good user interface. The best user interface is one that the user doesn't notice. The effects available to you should be used sparingly, with subtle transitions appealing to the user's right brain to send subconscious signals. Any effect you use should have a reason for being used (and "because I can and it's cool" doesn't count).

I really must get round to reading The Design Of Everyday Things by Donald Norman.

Richard Thomason: TechEd Day 4

Today is a better day all round. My nose is no longer streaming from the cold I contracted on Monday morning, and because we had to get back on the Metro after the Uk developer party, I got a few minutes more sleep!

13 Writing a 3D game in 60 minutes - Dirk Primbs

I figured this session would either be mind melting or illuminating, but the 60 minutes angle was encouraging. The XNA game development environment has been well conceived, and gives a straightforward object oriented managed code interface to hardware accelerated DirectX game development for Windows and XBox 360. Furthermore you don't need expensive development hardware, just download the free Game Studio XNA development kit. There are starter kits to get you going; Dirk used elements of an Asteroids style interface as the basis for his game, and in about an hour implemented a ship, enemies, bullets, movement, collision detection and a simple background. Not bad.

The technical details are pretty much as you would expect for VS OO development in a 3D graphics environment.

Update method: repeatedly called to handle movement and other actions
Draw method: also repeatedly called.
Content class handles resources.
Meshes are collections of points.
Effects are rendering descriptions - lighting, position, shadow.
Shader is a compilable language which is sent to the graphics card.
Effects are matrices:
Projection describes the field of view.
View describes the direction of view.
World describes the position on the screen.
Moves are handled by Matrix.createTranslation.
Intersections are handled by BoundingSpheres (simple and effective).
Backgrounds are textures.

Etonyek: Green Computing through sharing - Pat Helland

I remembered this chap from last year as the one who annoyingly read out verbatim every single word on every single slide, and prepared to grit my teeth. This year he improved - only 90% read out.

His talk was aimed at providing a rationale for cloud computing that went beyond the computer industry, and focussed on power consumption, competition for resources, SLA's and possible solutions. Fortunately MS are opening a big datacenter late this year, so he was able to talk about that and avoid the strong impression that MS are 3-4 years behind Google and other players such as Amazon in this whole area; Google has been doing datacenters in anger since at least 2006, and the impressive Google File System was white papered in 2003: labs.google.com/papers/gfs-sosp2003.pdf.

But enough sour grapes already. PH said that in the US about 2% of total power goes on datacenters, which is more than on TV. Somewhat less is consumed in Europe (a Google effect?) but the same trend to increasing consumption is there; how can this be managed and possibly reduced? He described two papers on usage of common resources - the famous Tragedy of the Commons by Garret Hardin in 1968, and a development by Michael Heller in 1998 called the Tragedy of the Anti-Commons. Hardin noted that when resources are shared they are always over-used, with detrimental effects on both the resource and on usage; his example was shepherds grazing their sheep on common land - there is no incentive for shepherds to not graze or to have fewer sheep.

Heller observed that when ownership is fine-grained it is more expensive and difficult to share, for example land ownership and patents. These problems both occur when companies use datacenter and other computing resources. Mainframes were expensive, PC's were unscalable and had no redundancy, virtual machines provide some solutions, and Lo! The cloud provides further sharing opportunities. A variety of factors make shared virtual machines efficient; mixing application types on servers makes more efficient use of power and throughput.

PH went on to discuss SLA's and noted that large numbers of low utilisation VM's were more efficient than small numbers of high utilisation ones. Amazon, whose page requests typically contact 150 different services (holy shmoly) have extreme requirements for response times, and use percentage rather than average response times, as this mechanism delivers a far better user experience. Typically they require 99.9% of pages to be rendered in less than 400 ms.

14 Quick integration from Sharepoint to your application - Robert Bogue

As I arrived a little late after lunch, this presenter was demonstrating how to make SP go to an embedded link. Never mind, I thought, I'm sure we'll move rapidly on. In due course, after dealing with parameterised URI's, we moved on to how out of the box features such as single sign on were unusable, how Web Parts were a lot of work, how the demo in fact was not refreshing the application because the cache settings were incorrectly configured, how the Page Viewer Web Part creates many usability issues, how the Business Data Catalog creates an application definition that is difficult to edit manually unless you use the built in definition editor, how good the search SP facitilities facilities were and how all the details were on his blog and not in his demo. And at this point I had had enough.

I returned to the workdesk, plugged in and took a look at his blog - Robert Bogue [MVP]: http://www.thorprojects.com/blog/default.aspx. The lead article was currently Sharepoint Governance and Pandora's Box.

I guess I shouldn't say that this particular messenger should definitely be shot, as I might be accused of being uncharitable. If this wasn't a public facing blog I could be more specific, but instead I propose that some of the energy saved by Pat Helland's efforts earlier should be encapsulated and applied for his benefit.

15 Building advanced Virtual Earth applications - Johannes Kebeck

I was excited about this one - the Google API is a stonker and as VE is actually jolly good maybe MS have caught up or even overtaken it. Unfortunately Johannes had connectivity issues at the start of his talk which made the whole a little rushed, but he overcame the problem with a lot of energy, excellent knowledge and demos.

Virtual Earth (VE) has been going since 2001, and started as an investigation project on dealing with larger data sets, which later became the TerraServer project. In a 50th birthday speech, Bill outlined a need to be able to see the earth from his pc, including local weather, 3D images and even live content. 7 years and half a dozen acquisitions later, VE has most of these features in some form or other, including several sources of geodata, their own camera system and 9000 cores for obtaining and automatically processing 3D data, real-time weather, and rich and powerful manipulation APIs, as well as a lot of support functionality in SQL Server 2008.

In the near future when privacy issues are overcome, which basically amounts to processing out people and number plates, there will be street views as well as 3D cityscapes. Trees are added in by detecting them with IR, matching the type via a geographic library of trees and "planting" them in the places identified by the camera.

Johannes started with a bang and showed in Popfly an RSS feed from Reuters and VE on the same mash-up. However then he piped the output from the feed through a geoconverter service which gave him location information and displayed the result as pushpins in VE with popups containing the stories, no code required. This got a round of applause.

He them showed the Photosynth viewer at National Geographic, using the Sphinx, followed by a demo showing a floor plan of the MS building in Reading side by side with the building in Virtual Earth. He showed in a technology called MapCruncher how to link the two images together so that VE understands how to move when you move in the other window, a matter of a few trangulation points and scaling. This is easy to achieve because VE supports multiple layers (VETileLayer), which can include layers from VE and layers from your own data server.

VE can be integrated via JS with pretty much everything. BP has a fabulously named Hurricane Management System which uses MOSS to figure out where the weather is, which staff will be affected and so on. CRM has obvious requirements for sales staff, customer locations, service engineers etc.

He gave some details of the extensive geodata support in SQL Server 2008, including geometry and geography data types and advanced tesselating indexing functionality. He then did a demo showing data points sourced from his local machine in VE, and discussed how to display the right number of points on the map, optimising the work required to show the correct number of points quickly by choosing to evaluate on the client or on the server. For apps which have less than 1000 points, evaluate them all on the client as there is not much processsing overhead. However use an array in JS to pass the points to VE if there are more than a few. For < 1500 points use a ShapeArray. For more than that, consider using client or server side clustering.

There are a number of data import tools. A good free one is Martin Nielsen's SQL spatial tools. The best commercial one is Spatial ETL.

16 The Windows Vista Bridge: access Vista from managed code - Kate Gregory

This was a very straightforward discussion of how to call unmanaged code from managed. In addition, it's a way to call Vista features not avilable in the CLR.

Originally distributed in the SDK as a sample, Vista Bridge 1.3 is now published on Code Gallery, which is much easier to find than in the SDK samples.

Neil Bostrom: Tech Ed 2008 - Day 4

DAT318 Microsoft SQL Server: Data-Driven Applications from Device to Cloud

This session was about SQL Data Services in the cloud. Currently all the sessions on the cloud have been on the Windows Azure Platform which only has a basic storage service. With SQL Data Services it gives you more complex type hosting with support for queries and reporting. The SQL Data Services is a modified version of SQL 2005 running on Microsoft cloud. They are working on upgrading the service to run SQL 2008 under the hood to get all those nice features. All the data and queries are run via REST services so you can just access them through a browser if you want. They have built a nice LINQ provider to access the cloud services. The SQL Data Service play nicely with the sync framework giving you offline data in a local store if you need it. Currently the first version of the data services does not support tables (as we know them). The later versions will be coming with traditional table support once they work out the best way to manage them.

TLA316 CCR and DSS: A data-driven approach to distributed, concurrent software

I entered this session knowing nothing about CCR and DSS. Turns out its a really lightweight concurrency manager that allows you to run code concurrently leveraging multi core processors. The session had some nice demos on calling the CCR and how you would write the handlers code. I believe this technology could be helpful when we need to off load work to different threads in our asp.net pages, like emailing and sms (Nakheel).

PDC307 Microsoft Visual Studio 10: Web Development Futures

Having seen some sneak preview shots of Visual Studio 2010 in the Key Note speech, this session gave a full run down on the features coming out with 2010 relating to Web Development. A few key areas are being worked on, Html snippets, improved javacript intellisense and overhauled deployment features. The killer feature for us is to be able to have different web.config files for different enviroments. This is done by using transform on the existing web.config.

PDC305 Overview of .NET Framework 4.0

This session gave a flash tour of the new feature they are working on for .NET Framework 4.0. The main focus areas are Web, Client Apps and MEF. One goal with the new version is going to be to unify all the features between C# and VB.NET. That means that C# will be getting named parameters like VB and VB will be getting all the nice features of automatic properties and initialisers. The thing that was mentioned that put me off a little was that they will be removing the ref keyword requirement from c#. I liked this enforcement so its a shame they are removing it. Hopefully we will be able to turn it back on. On the web side, they are doing loads of work on AJAX to support loads more client side binding to reduce the number of server calls you need to make. Client side is getting lots of nice feature when working with WPF and WCF. One of the features that excited me the most was the preview of MEF, Microsoft Extensability Framework. This will be an awesome framework for loading and managing
plugins. This is something I really need for Tim the Enchanter as the plugin loader code in there doesn't work as well as I would want!

Tristan Smith: Tech Ed 2008 Day 4

DAT318 Microsoft SQL Server: Data-Driven Applications from Device to Cloud

The cloud version of SQL Server, has some strong focuses.
- To be able to securely access data on any device from anywhere.
- To do so with high reliability, availability and supportability.

It has automatic failover, by keeping multiple copies of the data, auto switching and spinning up replacement backups.
You can access SQL Services via HTTP, SOAP, REST, Atom using URIs.
There's no schema enforced as metadata is kept with the data so that sending your customer data isn't meaningless outside of the database. You can also return any content you're storing by URI, which for a blob returns the image content for that Id for example.

Microsoft Sync Framework, allows offline and cached mode capabilities for your application so you can reliably cope with occasionally connected scenarios. Sync Framework is being used as the lubricant in writing software plus services.

GEN01 Green computing through sharing reducing both cost and carbon

Pat Helland talked about how since 2001 the cost of hardware, infrastructure etc used in data centers has been outstripped by the cost of power.
He talked about how the current sharing models mean you end up with under utilisation of servers and over provision of service. If people were able to share their servers in a way that didn't mean someone would lose out, it'd make huge savings in power. Where individual ownership means you don't benefit from economies of scale, shared ownership means people always try to get 'Their share' which can lead to over utilisation.

The cloud computing model that Microsoft are using gives a solution to this, they can span the application use over multiple boxes so you get your turn at the all you can eat buffet without high cost and the other penalties of small use.

He showed a video of the Microsoft datacenter where they have sealed containers with tens of thousands of server boxes with only network, power and cooling going into them. This allows the economies of scale and reduced power usage scenarios he was talking about.

WUX310 Beauty and the Geeks: Developer-Designer Workflow

As we have a design team in house, this one was a good session to see how other people work with this dynamic.
The developer showed how by using a data and behaviour model disconnected from the design, the designer was able to work easily with existing tools.

States that you want to expose in Blend for the designer to design for can be specified in the code for the custom control. This allows the designer to just care about the 'SomeCrazyEvent' etc.
You can expose Dependency Properties to Blend by declaring them in the code so the designers can work against the same properties and events as the developers.

Using this model allows you to make a clean separation as well with the model able to take care of updating internal collections, updating properties and informing the Silverlight of the need to update itself.

They definitely gave us some better processes we can put into effect with our designer team. A valuable session.

ARC309 Using WPF for Good and not Evil

This was a really entertaining session, the guys had seen David Platt before earlier in the week and recommended his sessions. In this one he talked about how users really don't care about the pretty pretty stuff, not that they can't appreciate it when done well, just that you really have to think from their point of view. Typically (and unintentionally) interfaces are designed as you'd want to use them, the thing is, you are not your users.

The speaker showed how the sample applicaton for WPF is a good example of both shockingly bad and awesomely good interface design. It features a family tree which is shown as little people, a background vertical gradient dark at the top to light at the bottom has meaning. The darker it is, the further back in history it is, the people are outlines if dead. The coolness of WPF is that it's actually a treeview control (like the FileSystem view of Folders and files). In this instance, it's really well used as a treeview has parent, leaf and child nodes, just like a family has parents, siblings and children. By styling it up nicely, translating each node to a person in the tree, it has a really good user experience.
In the same breath the detail view has a horizontal gradient, dark to light which with text on it actually makes your eyes fight to focus on the text, it's enough to make you physically ill.

The speaker also talked about how the best applications are the ones you never notice, users don't actually want to spend time in your applications. The quicker you can get them to the things they want to do with your application and get them back to enjoying real life, the better. Pretty graphics are just sugar coating, nice, providing you get them out as quick as you can by making the application as usable as possible.

Tim Jeanes: TechEd 2008 - Day 3

PDC201 - A Lap Around Cloud Services

Wow! I'd heard a little about cloud computing and how it was the way forward, but I didn't expect it to be as different as this!

Windows Azure is the operating system that handles it, but it's not an OS you can buy and install. It's just what runs in the Microsoft cloud. You buy computing time and storage space (somehow - they haven't decided how to charge for it just yet) and work within that. To you it looks like you're running in Windows Server 2008 64 bit, fully patched with .NET 3.5 SP1 on IIS7. You don't have many priviledges there though - you certainly can't install anything.

The biggest change is how storage works. The file system's not at all what you're used to. Instead of files you have blobs, tables and queues.

Blobs are the most like files, and can be kept in containers, which are pretty much like folders. If you purchase only storage and no computing power, this is all you need to store all your files in the cloud.

Tables are nothing like SQL tables. They contain entities, which are collections of properties. You can mix types of entities within a table. Each entity needs a row key and a partition key. Row keys give you instant access to an entity; every other query results in a full table scan. You can partition your data into more managable chunks, and so if your query specifies the partition, only that partition will be scanned. If you don't know which partition your data is in, you can run as many asynchronous queries as you have partitions to speed the process up. This seems really weird to me - that there's no indexing at all - but we're assured that it's all designed to be scalable to the order of billions of rows.

Queues let you specify work items. You can buy large numbers of websites and worker processes, but as they can't talk to each other directly, they can only communicate via your storage. Queues are the way of handling this.

There's an SDK available at www.azure.com that lets you run a local mock of the cloud and develop against it. Once you're happy with your service, deployment is a doddle. You build your app, upload the compiled file, upload the Service Model file (that tells the cloud how many instances to run, etc.) and you're done.

Initially your service is deployed to a staging area for checking; deploying it there takes some time to get it uploaded and running, but swapping it with your live application is instant, thus ensuring you have zero downtime, even during upgrades.


DAT308 - Answering The Queries Your Users Really Want To Ask: Full-Text Search in SQL Server 2008

We were debating in the office the other day: when the user uses one of our search pages to search the customer table, and they type John Smith into the name search field, did they mean Name='John Smith', Name LIKE '%John Smith%', Name LIKE '%John%' AND Name LIKE '%Smith%', or Name LIKE '%John%' OR Name LIKE '%Smith%'. Well, Full-Text searching opens up a whole load of new possibilities.

Full-Text searching understands about word boundaries, it understands about different inflections on words (you can search for 'file' and get back 'filing'), and it even understands about thesauruses (you can search for 'customer' and get back 'client'). It can be configured to run on different languages. It can open documents (Word, PDF, etc.) that you're holding in binary fields in your database, pull the text out of those documents and search them too. If you hold documents of your own custom type, containing text in Klingon, you can make your own add-ons to cope with that too.

What's also nice is that the indexing all happens in the background - your searches will run quickly when you come to query the data.

We saw a lot of this at a previous TechEd, but immediately wrote it off as a bad job when we found out how broken it was in SQL Server 2005. The searching was done by the OS rather than by SQL Server, so if you searched on a text field and on an ID fields simultaeously, the OS would scan the text in every single record while SQL pulled out the one record with that ID, then compare the results and keep the intersection. Also, backing up the database didn't back up the Full Text Index, so restoring the database later would leave you with an index that was worse than useless.

Fortunately, this has all been fixed in SQL Server 2008: it does all its own searching, and the indexes are including in the backups. It all just works.

You get a rank for each full text search query as well, so if you say you want 'John NEAR Smith', you'll get every record containing both words, but the further apart they are, the lower the rank.

Still, I feel we're still a step away from idealism. There are so many options on how to search text data, it's fine if you're writing a bespoke SQL statement and understand what the user's actually looking for. Unfortunately what users want is a text box on a web page that acts like Google.

I guess we could run a few different full text search algorithms and merge the results, but merging ranks across queries is meaningless, unfortunately, so I guess we'll just have to pick one search algorithm and run with that. The jury's still out.


DAT307 - ADO.NET Entity Framework In Depth

Oh dear. What a disappointing session. We've been using LINQ to SQL for almost a year now, and were keen to see how we can upgrade to LINQ to Entities and what advantages it would give us.

Unfortunately, we only skimmed over the new features: the examples we saw pretty much may as well have been done using LINQ to SQL. In passing, they mentioned that the Entity Framework supports one entity spanning more than one database table, and polymorphism being allowed in the entity-to-table mapping, but no more detail than that, and certainly no demonstration. I knew this already: I wanted to know what this looks like and how to use it.

One new feature we saw in passing was this:
    from p in myContext.Products.Include("Category")
... ensuring that the Category object for each Product is built when the query is executed. Now that's a whole lot less restrictive than the LoadOptions we used in LINQ to SQL!

We saw a little more of use LINQ against ADO.NET Data Services that we saw on Monday: given a service that returns records, you can write LINQ against its result set - the clever thing being that the query gets put into the query string of the request, so the server only returns the records you want.

Still, if I'd spent the time on Google I think I would have learnt more, but bafflingly there's no wireless network availability in the seminar rooms this year. Sigh.


PDC209 - .NET Services Drilldown - Part 2 (Access Control and Workflow)

OK, to be honest this pretty much went over my head. I was tempted to cut and paste from Wikipedia and see if anyone noticed, but there wasn't enough material on there to make it convincing.

The key points, though, were that Microsoft are moving away from roles-based authentication and towards claims-based authentication. Their offering to help with this is currently called Geneva, which has a number of components to handle the various parts of the authentication process.

When securing a cloud application, the user calls tha app, which requests claims from a trusted claims provider. The claims can give details about the user's age, location, employment status, etc., which the cloud app can then map to its own application-specific claims. Those claims can then be checked at the appropriate points in the application to ensure that the user has the appropriate rights to perform various functions. Microsoft are working to the open standard for claims-based authentication, so the authentication can come from anywhere, provided the application trusts that claims source.


PDC210 - Developing and Deploying Your First Cloud Service

Here we saw a bit more detail about writing cloud services, going into a little more detail than this morning's session.

Configuring an application is a little different to the web.config file we're used to. Instead we have a ServiceDefinition file that tells Azure what your service looks like, and what settings you require; also you have a ServiceConfiguration file that gives the values of these settings for your particular installation.

In this session we also saw (briefly) how blob storage can be secured, and how you need to provide credentials for read or write access, and also how you can keep certain blobs public: public blobs can be accessed directly by URLs, and would typically be what you use for pictures you put in your website.

We saw how to code against table storage. You use ADO.NET Data Services to talk to table storage, which fully supports LINQ. You can make a DataContext for accessing your tables by inheriting it from TableStorageDataServiceContext - the constructor takes a StorageAccountInfo, which is all it needs to start accessing the tables. Your classes that describe the entities in the tables inherit from TableStorageEntity, forcing you to implement the necessary row key and partition key.

Though table storage is what's really used to store data in the cloud, I really hope it isn't the closest thing you get to proper SQL-like table access. I found myself wondering about the most efficient way to store our business entities in this framework, how to construct further tables to index them and make them searchable in a reasonable timeframe. However I pretty soon realised that someone else will do a much better job of it than I can, and, just like SQL Server does that for me in conventional data storage, SQL Services will do it for me in the cloud. Accessing it from our application may be a little different, but actually there's a chance it may be exactly the same.

Finally we saw a (somewhat rushed) example of writing Worker Roles. These are the only bits of executable code you get to put in the cloud other than Web Roles (i.e. the processes that run your web site or web services). These can't make any connections of their own to the outside world, and can only read data from your data storage area.

Each Worker you make has to run indefinitely - basically you deliberately trap it in an infinite loop (with suitable Thread.Sleep calls to ensure it doesn't gobble CPU (that you'll most likely have to pay for)).

The worker picks up jobs left for it in the queue (most likely by your Web Role) and does whatever you specify with them. I guess to me this is most like the scheduled clean-up jobs we have running on our web servers, combined with the long-running jobs our web apps sometimes spin up additional threads to execute.

All in all, cloud computing is the future whether we like it or not. Windows Azure looks to make it pretty manageable and shockingly reliable and fast. It's a bit of a jump in the learning curve, but not as big as it could have been. I feel sure that here at Compsoft we're extremely well positioned to start developing applications in the cloud and I just can't wait to get started!

Wednesday, November 12, 2008

Richard Thomason: TechEd Day 3

8 Creating custom LINQ providers - Bart de Smet

This session was a code heavy explanation of how to go about writing a LINQ provider. The key elements were how to parse the expression tree (invoke the compiler on it) and the relatively straightforward details of how to recognise constants and operators and translate them into the target language. The next stage is to get hold of some simple samples.

It looks fairly straightforward to write a LINQ provider for Equinox. It is also tempting to think about implementing a LINQ subset in Equinox as an alternative to subtable blocks and select statements as all the building blocks are readily available. Allowing the implementation of custom providers is probably a step too far however...

9 REST The lightweight alternative to SOAP - Andy Wigley

I've come across REST before and wanted a refresher. This particular talk was using it with Windows Mobile, so I thought I'd see what the professionals get up to, as I have had bad experiences with it as an end user.

Not one single demo worked.

Poor guy. Fortunately the REST part was all slides and so the presentation of that was fine, and he showed LINQ to XML which makes the parsing of the result trivial. Briefly, REST is becoming increasingly popular as a protocol as it is more lightweight than SOAP, using URIs rather than RPCs to access named data items, and standard HTTP verbs for the main read/create/update/delete operations. Many sites offer REST, including Facebook, Flickr, Yahoo and Amazon.

10 Building cloud based enterprise grade applications - Gianpaolo Carraro

A standing room only session.

This talk assumed familiarity with Azure, which is basically Microsoft Cloud Services; instead of implenting your applications internally you host them "in the cloud", on virtual machines somewhere on the internet, and take advantage of near infinite (they say) scalability and pay as you go pricing models.

Cloud based apps such as Facebook and Flickr are popular with end users but haven't yet made it in the corporate environment. GP introduced VeryBigCorp as his target organisation, and imagined that the marketing department rolls out a 20 user cloud app, then wants to deploy company wide. They require single sign on, integration with mainframe apps and other internal systems, for example, redirection of help desk tickets from the internal system to the cloud service provider.

Firstly, Kerberos etc does't work in the cloud, so what can replace it? Secondly there needs to be different levels of signon to allow administrators and users (for example) to operate differently. You can use your usual development tools to implement this, but there is also available the Azure Services Platform which contains Service Bus, Access Control, Windows Azure and SDS (SQL Data Services).

Security Integration is normally done with a simple username and password, however a better solution is claim based access control. The first stage is authentication which can use a variety of different means of identification, then there is a mapping from identity to roles, called a claim transformer, and finally there are resources protected by claims. He demoed adding a new employee to applicationss and groups in AD, then used the Azure Access Control Service to achieve the same things.

Next, how to monitor your cloud application. Amazon Web Services have a Health Dashboard which is a good example. It needs to provide all the management tools which you would expect in an internal application: backup, start, stop troubleshoot, monitor etc. Cloud apps should be the same as internal ones. GP demoed a cloud app being monitored in the Management Console, just like a normal internal application. The emphasis is on local management of remote services.

Remote applications are much more "black box" than internal ones. You can't back up SQL Server databases, fiddle with IIS implementations as you would internally. Furthermore, large organisations have a need for process integration. The Azure Service Bus provides a way to allow external services to access internal endpoints in order to allow information flow back into the organisation. It uses WCF to reflect existing internal endpoints to the Internet. He impressively demoed sending issues to and from a green screen AS400 application.

Presumably it's all a mega set of web services that you have to implement to provide this functionality, and hopefully this will be covered in the cloud service implementation talk I'm going to later today. SDS didn't come up, but is basically an ADO client with Net facing SOAP and REST interfaces.

11 Developing high performance Javascript and AJAX for Explorer 8 - John Hrvatin

It was the "high performance" aspect of this that I'm interested in, rather than IE8, so I was hoping some of the material would apply generally. This proved to be the case, and John went through a number of performance issues with JS, some new, some old, as well as pointing out improvements made in IE8.

Optimise symbol table resolution. Accessing the DOM is expensive, so avoid it where possible and cache otherwise. JS and the DOM have separate memory management in versions before IE8 and this can lead to circular references and leaks. Do not access DOM arrays directly. Instead copy them locally first. Use DOM methods where possible (eg GetElementById) rather than use generic JS traversing the DOM.

Use var to declare local variables, which avoids the need for the compiler to look through the whole symbol table before creating it. Use local variables to cache writes to DOM items and do one write at the end. Use var to cache DOM function pointers. Closely examine loops, as that is where 90% of the time inefficiencies will be.

String concatenation is very expensive in nearly all browsers (not IE8). Instead use the built in array functions push() and join().

The eval() function is very powerful but very expensive as it creates a new execution context and parser. Especially for JSON, use a 3rd party JSON library which typically use regular expressions and so on to do the parsing. IE8 has a new JSON object which exposes useful methods parse() and stringify(). See also json_parser.js at json.org.

The switch statement is costly for large sets as it resolves to a number of if statements. Consider using a hash table and try/catch instead where appropriate.

HTTP improvements. Put JS in one file at the end of the page. The browser stops rendering when it sees JS and immediately downloads it in case there are embedded document.writes etc. With the one file at the end you maximise browser caching and get the page rendered before downloading the script. Similarly, put css in one file at the beginning, as then the browser has everything it needs to render the page as it is loading.

Use HTTP compression especially for large amounts of text (gzip Accept-Encoding Content-Encoding). Use conditional loading wher epossible via If-Modified-Since/Expires/Max-Age.

MS have a number of tools for script debugging, including some sophisticated debugging tools available at all times in IE8. Press F12 or use the Tools menu. Also check out Fiddler, a network/bandwidth tool at www.fiddlertool.com.

12 Developing and deploying cloud services - David Aiken

This was a code heavy session, as David demonstrated developing and debugging a cloud application locally then set up a cloud site and deployed it to a test environment online, then finally moved it to its live environment. While there was a lot of legwork to achieve the desired result and the deployment was achingly slow, no doubt this will improve as the technology matures.

There was a lively discussion in the bus afterwards as to the merits of the cloud concept, and who exactly would be tempted to use it in anger, and depend on its security and reliability. The demo used the blob store for persistence, and there was no mention of SQL Server, however a little further investigation indicates that services may well be the way it goes.

Tristan Smith: Tech Ed 2008 Day 3

PDC201 - A lap around Windows Azure

Windows Azure is a distributed, highly scaleable and available operating system that lives in the cloud. The cloud here is the Microsoft managed data centre's machines that your application will run on. Microsoft takes care of load balancing between them, managing the DNS setup, patching the machines etc. You upload your apps, get a url and that's it. You don't ever log onto a box, in fact you can't. You don't get file storage in a normal way, no traditional SQL database. The box itself is Windows Server 2008 64 bit running IIS 7 and .NET 3.5 SP1 but you only have a minimal console interface that you can't interact with.

It's a really interesting model with the idea that you write your applications entirely stateless, you have a separation between your application service and worker services. Your application is used as a front end, any processing you need can be carried out by the worker, as many workers or applications as you want. You can't communicate with the worker service directly, it works by monitoring a queue of items that your application can add items to.

WUX317 - Nerdvana Annihilation: Improving Silverlight UX without out-of-the-box controls

User experience isn't a subject I've looked into before but the guy really sold it. It's not just about having an awesome design, it's about having an enjoyable experience using the application.
The mistake people often make when new technologies like Silverlight come out, is that they just use it exactly the same way as previous technologies like ASP.NET. Pages look the same, buttons are there and are just clicked as normal. Porting ASP.NET experiences to Silverlight just isn't taking advantage of the platform.

Customers come to our products with mental models of what they expect to see and how they will use it if they don't get that, it not only impacts negatively on the customer, it impacts on us as well. Giving a good user experience, is a real boon, it can increase customer loyalty, bring more business and make people happy using your product!

The speaker unfortunately wrote all his markup manually and it didn't go as smoothly as it could have but I really liked it.
A good tip I saw on Silverlight animation was that you don't have to set a starting position but if a previous animation has moved it, you can set the ending position and it'll work out how to move it back to to that original position and state. This is something Flash doesn't do, you have to say, I moved you from point A to point B now move from point B to point A.

PDC206 Introducing Windows 7

Having seen the new server side platform Windows Azure I thought it best to follow up with a look at the client side version.
There are a lot of usability improvements to be had here, gone is the quick launch toolbar in favour of applications that you can pin to the task bar. Programs running in the taskbar won't have labels any more so Icons will become much more important. For developers, icons will be more important as you can now change the icon easily at runtime, this allows you to use the icon to display a progress bar so you don't need to open the application until it flashes ready.

As in Vista you'll get a preview when you hover over running programs, added though is that as developers we can add up to 9 buttons to the previews so you needn't fullscreen the application in order to interact with it. Added here also is apps with multiple instances running (multiple copies of Word opened for example) you'll get previews of all of them, if you highlight one of the multiple previews it shows you a larger view that you can click to go into. All these aimed at removing the harder to use quick tabbing.
Another taskbar feature that is extended throughout is jump list menus that we can add items to, users can also pin preferred entries. For example, right click the running word and you'll get the top 5 recent files that you can go into directly without opening Word again.
Windows can now be docked to the screen so you can run two programs easily side by side, should you want to.

Windows 7 has support for federated search, an interesting feature that allows you add searching of any compatible folder, location or even website.
A site can implement this by setting up a configuration file that the client runs to add it into explorer, additionally the site has to expose a querystring like www.compsoft.co.uk/q={searchTerms}, it needs to return RSS results which are then nicely shown in explorer. It's a really nice search experience. The filtering of that search is much nicer using metatags embedded in the config file or general attributes, the preview is nicer too which if you're searching a website will be the site itself.

Virtualisation hasn't been missed either, you can add or mount virtual hard drives just by clicking them. The speaker was actually running his version of Windows 7 from one as his hard drive had a newer version with features we aren't allowed to see yet.

Speed has been increased, the inbuilt graphics uses DirectX 10 by default and uses your graphics hardware rather than rendering the display in software. Semaphores usage has been improved so you should never have to wait for the start bar to load. A more functional approach to resource usage has been taken too, whereas before you'd have all the services that might be used (support for touchscreen and ink for example) loaded into memory. Now it will only load things into memory if code begins being run that needs it. Hopefully this and the many other improvements will mean a vastly faster system.

PDC209 .NET Services Drilldown Part 2

I really wish I had seen session 1 of the drilldown, it was a bit hardcore.
It mostly covered areas such as the move towards claims based authentication when using the cloud. So a user hits your application which asks, is the user old enough to see this content? rather than just trusting the user, they kick the user to a Security Token Service(STS) that our application puts all their trust in, which takes care of authenticating the user, the STS then returns the output claims required by our app and if authenticated, allows the user to access the content. When working with Windows Workflow, the authentication token that's granted may expire before it finishes so it can be granted a long running token that takes care of this.
It was all a bit crazy complicated, the speaker was covering so many aspects of authentication, the .NET Services bus, Workflow services in the cloud. It was a lot to take in, Microsoft's internal authentication mechanisms and that of many other vendors are all heading this way though so it's something that will become more important, especially with cloud services.

PDC210 Developing and Deploying Your First Cloud Service

The first session on Windows Azure which talked about the new platform and fundamentals such as basic concepts and deployment missed out any real examples of the kind of application you can write to run on Azure which this session promised to show.
We saw a little more detail than the earlier session, we got to see the three storage mechanisms that are currently available. Queues, Tables and Blobs, Queues are where you can add tasks for the worker services to run, Tables are entity-value collections similar to the Column/Row dynamic in databases although they're actually just properties of the entities, Blobs are your file storage solution. You don't get normal a file system when you're in the cloud, you'd have no idea what machine you were on in the first place so it's quite a different dynamic. You can set whether blobs (binary objects) are public or private, public means they can be accessed externally by url, private means they are internally scoped to the service.

The Azure platform is Microsoft's distributed, completely scaleable offering, similar in some ways to Amazons EC2 (Elastic Compute Cloud). Amazon's offering is more a scaleable virtualised server that you can clone, take snapshots of and spin up as many instances as you want. You get a machine you can remote desktop to as if it's a normal machine, it's just that it's running in the cloud. They're quite different offerings really, with the one, you write your code in an explicitly scaleable way (with more of a software as a service approach) where the framework provides a lot of scaleability support, the other relies on you making sure the applications you write are scaleable, you could write a completely non scaleable application if you wanted of course. For normal scenarios, Amazon fits the bill, for more advanced scenarios where you want instant, no downtime massively scaleable applications, Azure is clearly the choice. It's an exciting time to be a developer, there are definite scenarios where Azure is going to change the way we work.

Neil Bostrom: Tech Ed 2008 - Day 3

Creating Custom LINQ Providers - LINQ to Anything

This session sounded awesome on the write up and it did not disappoint. Bart De Smet blasted through the inner workings of LINQ and expression trees. Covering how LINQ is really just a compiler trick to call extension methods and a break down on how expression trees are built up when using LINQ. The major part of the session was on parsing the expression tree once it had been given to a provider. This gave invaluable knowledge on the inner workings of expression trees and best uses with them. A nice trick he showed was using Expression.Compile then DynamicInvoke to run the expression and get a result for it. Another cute trick he mentioned was to apply multiple different provider attributes to a single class. Applying LINQ to SQL and sharepoint attributes allowed him to pull out database records into objects then save them directly to sharepoint, without any intervention.

.Net Services Drilldown

Azure Service Platform and buses were the buzz words for this session. Microsoft are releasing a service bus to allow service publishing and user access control. A service bus is just a means for hooking up clients and services. So if you had a service that you want to offer clients, you can publish it on the bus and the clients would have a uniformed way to access your service, wherever that may be. Microsoft's release for that gives everyone an address at servicebus.windows.net. It's currently in CTP but you can go to http://www.azure.com and register for an account to play with it. To support connecting to the bus they have released SDKs for all the services in the cloud. These SDKs are for .NET, Java and Ruby currently.

Entity Framework

This being the only other Entity Framework session it was a must. It was presented by the same lady as the last one, which is a shame as the demos and description just weren’t up to scratch. It was a slow start to the session but it picked up by the end. A few gems did come out of the session on performance. Using CompiledQuery.Compile to cache expressions will reduce cpu usage for any page that is querying the database as expression trees are expensive to create. Switching off tracking is also another tip to increase performance on read only pages. A little gem did come up during one of the demos that showed that you can call an Include method on child relationships to make them be included on webservice calls on your entity objects. The session did go a little sideways by the end of it by showing ADO.NET Data Services. This is a feature I’ve been looking to get information on so that was really helpful. We have been looking for a good way to use LINQ to query the database from Silverlight. However Silverlight runs on the client so it can only call webservices. With the ADO.NET Data services it runs via a webservice but gives you a fully LINQ supported model to query your database.

Reflection

My favourite speaker, Roy Osherove gave a session on the performance problems you can get with Reflection. The example he gave was that you want to Clone a bunch of objects. The usual way you would do that would be to use reflection to copy each property to the new object. He gave stats on three ways, standard reflection, DynamicMethod and String Compile. The standard reflection way was always the slowest. The last two however were quicker in different situations. The DynamicMethod started out much quicker than the compiled strings, however, once we passed 200,000 clones it was taken over by the compiled strings. The reason for this is that the DynamicMethod under the hood has a delegate point to the real method that means it has to look it up to execute it. As always Roy finished with a home grown song which is always amusing!

Developing and Deploying your first cloud service

This has been my first real talk about the Microsoft Windows Azure Platform. The Azure platform is a "cloud" offering which means its a managed service that could be running on one box or a thousand. It is all about distributed computing, your code will run somewhere on the cloud but you have no idea where. This model gives the greatest scaleability, as you can just ramp up the number of "boxes" you are running your code on. The demo showed how to access the file store and deploy a simple web application into the cloud. The cloud platform is a very locked down enviroments so there is no file system as we know it. It instead has a virtual file system model using Tables, Blobs and Queues. These three items are part of the Azure Storage Service. The cloud offering is an exciting opportunity to write truely scaleable applications. When we say scaleable, we mean just change the config from "x" nodes to "y" nodes and you could just double your application capacity. Its a great version 1 offering from Microsoft and I'm excited about getting the opporunity to work with it.

Tuesday, November 11, 2008

Tim Jeanes: TechEd 2008 - Day 2

WUX202 - Building Rich Internet Applications Using Silverlight 2

I've fallen a bit behind on the Silverlight front, so it's great to take this opportunity to catch up a bit. This was a fairly low-level session to get you up and running, but without skipping over the details.

We were taken through setting up a Silverlight application, creating and (fairly radically) styling some controls, retrieving data from a web service, creating business objects from that data and then displaying it.

I can't think there's many times I'd want a slowly rotating text box whose background is playing one video, whilst the interior of each (multi-alphabet) character contains part of another video, but it's nice to know that you can.

One thing I was really pleased to see was quite how feasible it was to develop Silverlight by typing the xaml directly. I've only seen it generated in blend before, but I prefer the feel of the fine control you get from typing it yourself - I generate all my html that way for precisely the same reason. I suspected it would be too onerous to be practical, but was glad to see that it really wasn't.

Data access in Silverlight is really easy: it all works by calling web services, and using .NET's XDocument and XElement classes, converting the XML text to objects is a doddle. Web services can be called from the same site as where the Silverlight is being hosted, or, by negotiating a SilverLight policy file, from an external domain.

Creating reusable controls in Silverlight is just as easy as in ASP.NET, and data can be passed to them just by setting their DataContext property. In many cases that's all you have to do in the code behind, and the xaml will pick up the data and display it accordingly.

I deliberately avoided Silverlight 1, and I'm glad I did. Silverlight 2 has dozens more controls available to you in its core libraries, and a whole bunch more - mostly the more advanced ones such a DataGrids - that can be included by namespace. The neat thing is that if you don't use those namespaces, they aren't included in the the download, giving less of an impact on your user. Microsoft plan to release more control toolkits in future.

The argument they gave us for the lack of controls in version 1 was that you should design your own; it's nice that those of us with little artistic talent can throw the standard controls into our applications, but also that they're all completely re-stylable by applying templates.

Databinding works a lot like in ASP.NET, but with the additional power of 2-way binding, whereby data entered by the user automatically immediately changes the properties on your objects.

All in all, I'm looking forward to getting involved in some Silverlight development. Much of what I know of ASP.NET will be transferrable, but we'll also be spared the pain of trying to get a decent layout using css.


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

I thought the content of this talk would be similar to talks I've seen at the last two TechEds: long term projections about where software development will be going in the next decade. But no - one tenth of "the next decade" has already past since last year; nearly a quarter since the year before.

IT is undoubtedly a fast-moving industry, and I've often wondered what my job will look like when I'm 60; or even if I'll still have one. How will I keep up with the industry as it moves? How can I know if it's even possible when there aren't any 60-year-old software developers yet?

The key really is keep at the bleeding edge. IBM crashed and burned because they had a cash cow (the mainframe), and made the mistake of treating it as a sacred cow. The technology we rely on today can (and will) be obsolete soon after you get comfortable with it.

An interesting graph (I'll link to it when the slides from the session are published) showed the relationship between cost, risk, availibility and value as technology moves through the phases of being a future technology, emerging technology, widely applied and obsolete. We're running on a treadmill and you never want to get too close to the back. I think this is something we do well at Compsoft: we're always looking ahead and keeping abreast of what the next big thing will be, adopting it right as soon as it becomes available.

We covered quite a bit of how we'll not only treat software as a service, but treat hardware as a service too. With more and more processing being offloaded to the cloud, we don't expect most companies to have their own server room a few years from now. The car/ taxi analogy works well: if you're buying a car, you care about the make, the model, the colour, the tyres, etc.; if you're catching a cab you only care about how clean it is, how dodgy the driver looks, and how much they're going to charge you.

Expect to see some legislation coming in for IT services soon though - we're pretty much the only public service at the moment that isn't regulated; and also probably the fastest-growing one.

Some interesting international statistics and predictions came out. Nigeria's most profitable export is oil; its second is internet scams. Every year the US produces 100,000 new software engineers; China produces 500,000 (and that's if you only count the ones who can speak English). Iceland's data centre industry will be booming shortly: IT currently produces as much carbon as aviation and we need to radically cut back on our power consumption. We need cold, remote places with cheap electricity; Iceland has this, along with the fattest of pipes to America and Europe.


WUX307 - Developing Accessible Web Experiences With Silverlight

Like last year, the seminar on accessibility was poorly-attended, and with a lot people dropping out before the session ended. I guess it's just not a sexy topic, and unless you have a customer who particularly cares about it, you're likely to have a zero budget to implement any accessibility whatsoever. Ah well.

We covered some basic principles of making websites accessible. This applies to everything, not just Silverlight. The WCAG guidelines give some useful pointers about accessibility: everything should be perceivable (with low, colour-blind or no vision); everything should be operable (the keyboard should be the only tool you need); everything should be understandable (clear, readable, predictable layouts, and forgiving of mistakes such as miss-clicks); everything should be robust (we should assume as little as possible about the technology used by the end user.

We got to see a little more of ARIA (Accessible Rich Internet Applications) in this session. This adds a whole bunch of attributes to standard html that is respected by assisted technology (AT) for people with disabilities. Thsi basically lets you write less semantic html to produce all the nice effects your fully-able users want, but add the attributes that ensures it's still accessible.

For example, the tabindex attribute is now available on all elements, with the addtional support of tabindex="0" to let the browser decide the order, and tabindex as a negative value for items that shouldn't be accessible via the keyboard but that can be set programatically.

Also the role attribute lets you give a lot of information about what an html element is actually for - you can give your div a role of banner, navigation, main, etc., for example.

Setting live regions in your html lets AT know that these are parts of the page that will change dynamically. You get some pretty fine control over how sensitive it is to change, and even how the AT should announce that the region has changed (the settings are "polite", "assertive" and "rude").

I expected accessibility in Silverlight to be more painful that in html, but actually it opens a whole of new opportunities. As Silverlight is so media-rich, you can easily add your own subtitles to videos, as well as sign language options. Users can change the size of captions, turn additional descriptions on and off, etc. You really get to make the experience for disabled users as exciting and as varied as it is for everyone else.

The AutomationProperties class lets you add attributes such as name, help text, accelerator keys, etc. to pretty much any element, for use by AT devices.

Another nice feature is that Silverlight can detect that the user has set their browser to High Contrast mode, meaning we can automatically switch the Silverlight component to use a more clearly visible theme.

Media files support media markers that can trigger events code-side, so you can handle them however you want. We saw a demo of extended descriptions, where (if the user had turned them on) the video would pause, provide an audio description of what was happening, and then continue from where it left off.

There's still room for improvement: Silverlight doesn't yet support two videos playing in sync, so if the user's on a slow connection the sign language may get out of sync with the main video. However, as you can change the video stream being played dynamically, it's feasible to swap between one video with signing and one without, seamlessly whilst the video's playing.

The Silverlight demo (which showcases a whole bunch of best practices for accessibility) is available on CodePlex - look for AMP (Accessible Media Player).


WUX305 - ASP.NET MVC Practices

I've been resolutely avoiding MVC for the last year, waiting for it to settle down, iron some of its problems out, and then decide if I like it or not.

Well, it's done a fair bit of ironing, but I'm not entirely convinced that I like what I see.

On the one hand, I just LOVE the testability of the MVC paradigm. In this session we saw how tidily it integrates with Inversion Of Control and purity of the code that you get as a result.

On the downside, the html you write has bits of code littered through it, which is proper filthy dirty as far as I'm concerned. Hadi's argument in this session was that your view should have no logic in it, so the code in your page is going to minimal, so that little bit of dirt is just fine. Hmm... I don't know...

What we got to see today showed us a whole lot of how to implement a nice-looking, AJAX enabled, error-handling, fully testable MVC application. I'd like to have one of those, but getting there would just be such a hell of a lot of work.

The trouble is that we've invested a whole lot of effort ensuring that developing applications at Compsoft takes as little effort as possible. To edit a record, you barely have to write more than the properties you want to edit, and you get all the right controls for the datatypes, full error-checking, etc. right out of the box. Searching, listing, pageable repeaters, building up complex records without saving anything to the database - we can do it all in minutes. Unfortunately we do it all using the technology we have available: we use web forms, web controls, update panels, the view state - everything you lose if you switch to MVC.

So switching to MVC would be great because our code would be cleaner, purer, (in theory) more maintainable, more swappable; the problem is that we'd have to throw away most of the last year or two's investment in our reusable web controls.

Though today I saw a vision of how I would like to rewrite our reusable code libraries to work on MVC, it's not a few tweaks to upgrade it, but rather a total re-write.

Roy, can I have a while to do this? I reckon about three or four months solid work should be enough to get us back to a point indistinguishable from where we now, except for a warmer glow within. Thanks.


WUX306 - Silverlight 2 Security End-to-End

Silverlight has security built in at a pretty fundamental level. All Silverlight applications are sandboxed and so can't touch anything else on the client machine - not even other Silverlight applications.

However, the Silverlight plugin that the user has installed does have acces to their hard disk. Not all of it - it can store persistent data up to a limited volume. By default it's 1MB per site, but you can cause the application to request more storage capacity from the user. The store can be unique to each Silverlight app, or shared by the applications on a single site if you prefer.

This data can be accessed via the IsolatedStorage class. At its simplest it contains a dictionary of name value pairs, though you can also use it as a virtual file store where you can create folders and files of any kind.

Whenever a Silverlight application needs some data from the outside world, it's going to be getting that via web services. The web services you call are limited: you can always call webservices on the same point of origin as the original application (to the domain, sub domain, port and protocol).

That's sufficient for when you're developing your own self-contained Silverlight system, but you can also expose public services to other Silverlight applications. Out of the box, cross-domain web service calls aren't allowed. However, the server can opt in by having a file called clientaccesspolicy.xml in its route directory. This contains information about which Silverlight applications can call the web service, by domain name, with wildcards. For ease of upgrade, Silverlight also supports the existing Flash version of this file.

You have to make sure you disable any caching on this file, and you can't use any redirects.

As with web sites, these web services are susceptible to cross-site request forgery attacks, so you need to include a token both in the cookies for the site and the request itself. Also, if you have a service that's used both by your local application and also exposed publically, it's best to keep the service and the application in separate subdomains, so that cookies from your site don't inadvertently get included in requests from other Silverlight applications in the same browser session.

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

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: , , , , , , , , ,

Monday, November 10, 2008

Tristan Smith: Tech Ed 2008 Day 1

The day started as it would continue, I was woken up to the joyous bouncing on my bed of Neil Bostrom excitedly shouting “Tech Ed! Tech Ed!”.

Arriving at the conference centre, I looked in wide eyed amazement at the sheer amount of caffeinated geeks and laptops on display. Quickly joining the queue I picked up my laptop bag, cap and timetable and headed for lunch.

The keynote was first, we heard about the awesome new features that are planned for Visual Studio 2010 (The development environment we all use at Compsoft).

Integrated into the IDE are code analysis tools which allow you to see visual dependency diagrams and relationship diagrams which you can dig deeper into. This allows people unfamiliar with the code base to learn a system without starting by trawling the code, allowing people to be productive quicker.

Designer additions
Writing markup for pages is a time consuming task, using the code snippet mechanism which has been improved, html and other control declaration should be a quicker experience. [keyword] [tab] is sufficient to have an entire html or asp control rendered.

There are a lot of improvements with code navigation, you can now see code highlighting of variable usage. This should make bug fixing and code tracking a much easier task.

There is a new QuickSearch feature as well, it's surprising how much difference small improvements like this can make.

Deployment
A new deployment profile should allow for easier deployment scenarios and the configuration pain associated with debug and release modes is being made easier.
Multiple configuration files can be used with a new transformation syntax so that different environments can be configured independantly with little change. SQL server details, versioning etc can all be done in a much nicer way.

SharePoint
Sharepoint development looks like being a bit easier with a new integrated explorer and new controls.

Integrated test centre
This was a focus area of Visual Studio 2010. The classic problem is that a tester will encounter an issue but that the developer won't be able to reproduce the bug.
With the new integrated Test Center a tester's session is entirely video captured and logged. Moreover, the entire debugging history is captured at every stage of the test cases. This allows a developer to literally 'jump into' the testers session even if that session was weeks or months ago.

The developer need not even be on the same machine, the tester's machine configuration is cloned into a virtual machine with state so a virtual instance of it can be launched and debugged.

Logging bugs is a much easier experience too as the majority of the information needed is passed into a new bug report template.

The testing features should make a real impact in taming and fixing bugs, helping us develop higher quality software.

Lap around the .NET Framework 3.5 SP1 Enhancements for Web Developers
Normally service packs are just big packages of bug fixes, 3.5 SP1 however, included a lot of framework and supporting technologies.

ADO.NET Data Services
Gives us another mechanism for exposing data of any kind over the web in a standard and easily consumable way.
Using the same technology as RSS (Atom) the data can be queried via URI. http://mysite.com/customers can list all customers where /customer(1) can give customer ID 1 etc.

It's secure – Locked down by default. You get query and command interceptors to allow you to perform additional processing both before and after the data is returned and the query is fired off.
You can also retrieve values without the XML that normally accompanies webservices by using $value.

Routing
Microsoft's solution for friendly URL that allows sites to have “mysite/Products/Toy_Car” instead of /Products.aspx?prodId=234. Is used in a lot of the technologies shown, Dynamic data, DataServices etc.

Dynamic Data
We use our own code generation to produce List, View, Edit pages in ways that we find most useful. Dynamic Data is a similar solution, it uses templating of List/Edit pages which can be customised based on types and pages with customisation an option.

It uses Meta Data attributes for validation, overriding field names etc.
Modifying these templates and attributes allows for styling, custom processing and behaviour.

AJAX History
To allow the back/forward buttons in the browser which have been off limits with Microsoft's AJAX implementation up to now.

Script Combining
Allows you to combine multiple Javascript resources into one to cut down on the resource requests. This helps keep the page load time down.

Web and User Experience - ASP.NET AJAX 4.0

This talk took us through the multiple ways you can build the same page and give quite different user experiences each time.

When it comes to writing a page, you can use the traditional postback model where the server returns a whole new page every time. Not very responsive, the user sees the page load in full but it's safe, the server is in control.

Alternatively we can use AJAX update panels which intercept the page requests and give a more consistent experience, you don't see the page reloading but the content changes nicely.

From there you have a choice of using the Microsoft AJAX Client Library which means the server gives you the page once and the browser makes requests for data as and when it needs it. This approach is the most responsive here but with the trade off that the server loses control.

The speaker showed how the amount of bytes being sent and received using the different implementations varied from 3.5k to 0.6k, a significant performance improvement.

When working with the client library normally, you have to write your javascript by hand to populate the content as you need. Version 4.0 of the AJAX framework includes declarative controls such as the DataView which (on any control) give you the properties and syntax to pull in your data and template out the style etc without any javascript.
Less javascript = more maintainability so it's really for the win.

Live Binding is a new feature that looks very interesting, when using the DataView you can specify the property and method names to bind to your templates in a {{ Title }} way.
This allows you to execute javascript on the context of the current data item.

There is also a way of implementing two way databinding using a style similar to WPF that was shown with an MVC example which I'll have to look at again.

The summary was basically that moving more to the client side will enable better performance and a better user experience. Compsoft's projects have been moving towards this a lot more recently with Javascript libraries such as jQuery. We've been using Update Panels for more than a year to give a better user experience.

Apologies for length... :p

Tim Jeanes: TechEd 2008 Day 1

The first day of TechEd is shorter than the others - we start with the KeyNote speech at 2pm and have only two proper sessions after that in the afternoon.

Keynote speech

By far the most exciting things outlined in the keynote speech were the new features coming out in Visual Studio 2010.

For a start, the whole IDE incorporates WPF, meaning that many of the new features look a whole lot nicer. Making it easily extensible means you can add your own eye candy too,

The testing support has been vastly expanded: in VS2008 we could run automated tests but now we have a whole suite of support for manual testers. Test plans can be drawn up, and the tester ticks off the key points of them as they execute the test. As they do this, their whole session is recorded to a video file, with bookmarks at the points where they ticked off the various tests. Most impressively though, the route taken for the code to run, with full call stack and additional debug information recorded as every single line of code executes. When a bug is found, this gives the developer a ton of valuable information to track down and eradicate that bug.

A nice new feature for developing web applications is a way of scripting modifications to the Web.config file. No longer do you have to worry about remembering to remove the debug="true" statement and adjusting the connection string when deploying to the live server: those will all be changed automatically according to the build type.


WUX201 - Lap around the .NET Framework 3.5 SP1

This session covered the features they just couldn't wait until 4.0 to give us.

There are some big changes to how we can handle data now: the new Data Services make it possible to expose data over the web extremely easily. Though the quick overview we had here didn't show us how to secure that data, we are assured it is possible.

The ADO.NET Data Services map HTTP verbs (GET, POST, DELETE, etc.) to your standard CRUD operations. All you need to do is make a class that inherits from DataService (where T is your data context), and you're only a few lines of code away from URLs like "http://.../Customer" to get a list of all customers, "http://.../Customer(1)/FirstName" to get the first name of the customer with id 1, and even "http://.../Customer(1)/FirstName$value" to get the raw value without any XML wrapping.

This will play nicely with the new Entity Framework. I got my first real look at this technology in this session and hope to see a lot more of its depth as the week goes on.

From what I've seen so far, it looks a whole lot like LINQ to SQL. The designer's pratically identical, though we now also have the Mapping Detail view that shows how each property on your objects maps to the columns in your database.

I'm still concerned that reliance on the designer means we still hit a wall of pain when we come to change the database schema, but I hope to be proved wrong.

Moving on to a quick look at the MVC-style routing, it's felt good to be a bit ahead of the game: we've already moved up to SP1 at Compsoft and had implemented the MVC-style routing it offers even before SP1 came out.


WUX312: ASP.NET AJAX

In this session, Stephen Walther demonstrated the same simple website constructed five times over, using traditional ASP.NET first, then server-side AJAX, then three different ways of using the new client-side AJAX.

The first two of these are what we're used to, and (to be honest) are the easiest to develop, the safest to use (in terms of the compatibility of different browers' versions of javascript) and work just fine on an intranet (in terms of the volume of data sent about). However, they lack somewhat in terms of the user interface and aren't tremendously scalable, both because they pass a lot of data both ways, and because both of them result in the server having to process the entire page for every user button click.

In JavaScript, $addHandler is used in the pageLoad() method on the page. This is something I've not played around with much before - I've only really used UpdatePanels in the past - but it seems surprisingly easy to call web services from javascript, handle the JSON response, and construct the new html on the client.

ASP.NET AJAX 4.0 adds new controls, such as the DataView control, which allows you to define templates using html fragments with tags to inject specific data values.

As always, using AJAX produces some hurdles for accessibility. It can be done (and most of Compsoft's standard AJAXy controls have accessibility considerations built in). Fortunately for us, there are some new guidelines coming out soon for accessibility standards when working with AJAX. These are called Aria, and I'll be keeping an eye out for them as soon as they're available.

It was nice to see this approach in action with MVC too. The actions on the controller can return various types of response, including JSON, which is exactly what we need in this case.

The final method of using client-side AJAX was the most remarkable, where we put in all the behaviour entirely declaratively: by adding XML namespaces to the body tag, which in turn allows us to add dataView attributes to other elements in the page (the tbody tag of a table, for example), that then does all the work for you. Everything's extensible too: attributes are available to invoke commands in javascript when controls are clicked, etc.

This is a whole new world, and a whole new way to use javascript to make fast, responsive apps. I'm going to have to find some time to look into this in a lot more detail to see how we can use it in our real-world applications. It'll be quite a step to break away from our heavy dependency on UpdatePanels' callbacks, but this could be our way into MVC. Watch this space!

Richard Thomason: Day 1

Keynote session

Jason Zander made a brave pre-alpha presentation using Windows 7 and Visual Studio 2010, demonstrating improved testing, debugging and delivery in .net, some excellent tools for analysing and importing VS 6 applications, which made me think hard about doing something along those lines with Equinox in VS2008, something I have been considering for some time but have thus far rejected. In particular, Microsoft are making efforts in future releases to improve and simplify support for multi-threaded architectures, as this will be the primary way to deliver acceptable performance in applications with big graphics requirements.

1 Introduction to F# - Luke Hogan

This sesion was something of a longshot as my previous experience of functional programming is that it has a lot of brackets and is only really useful for academics and writing programs to shut down nuclear reactors. However the overview emphasised links with the CLR and implementations of parallel and asynchronous techniques, so I thought I'd give it a shot. The session was full.

Luke introduced the programming environment, which included a Basic like interactive pane, and showed how to write more declarative code. This boils down to syntactic changes which achieve similar results in other languages. The languages has elements of Basic and especially the functionality hiding features in Javascript, but also has interfaces to UI controls and the CLR generally. The parallel functionality was a direct call to the .net functions.

The session was very interesting. It would be interesting to compare the facilities in Javascript with those in F#. I'm wondering if the sandbox nature of Javascript would probably restrict the things you can do, although the language itself is so powerful. On the basis of this session, I might have a little go with F#.

2 Evangelising Sharepoint - Gianpaolo Vittorelli

Not much choice this time. Neil is doing Virtual Earth. There's one on customising Sharepoint with an awful presenter who I remember from last year. The others are doing Ajax and data retrieval. The best available is a high level requirements seminar on how Sharepoint was used in a number of projects.

This was an excellent non-technical session led by a developer/manager with considerable customer facing experience in SP.

Sharepoint developers are a highly sought after, scarce resource, however Sharepoint development has an arguably bad rep. Why is this? SP can be used in a variety of ways - from a configurable internet all the way to a framework for a bespoke .Net application. The main issues are the need to learn how SP works, plus it requires a slightly different mentality - the need to co-operate with the SP framework, rather than program using .Net as a development environment. There is a loss of control involved. Basic requirements for staff are to be a good .Net developer - you can't use inexperienced people unless they are very very bright. Workflow in SP is not great except for simple applications; there will be improvements in 2010.

In many ways, there are parallels with Equinox - it's simple programmable and extensible, but SP is a less controlled environment, where simple configuration changes and uncontrolled end user development can make a big mess. Therefore it's necessary to severely limit these options.

"Long tail" applications are ideal for SP, where you start simple and the users continue to add functionality forever. User self-development is the key to its success - something like Equinox queries and reports - however SP adds forms also.

Possible SP sponsors:
  • HR etc want an intranet, and have made a start but want help.
  • IT want to get rid of file shares, plus better document management and don't have time/skills to implement themselves.
  • Some other business unit has a process which needs automation.


SP in his opinion is not a cheaper/more profitable platform. However, if SP is already there, or if the application is a small natural SP app, it would be cheaper/more profitable. The benefits of SP are probably more important than the profitability.

Neil Bostrom: Tech Ed 2008 - Day 1

Key Note Speech

Started the day out with the key note speech. This is Microsoft's catch to sell the event to us and get all the developers on board. The speech went into a few key areas that everyone should be getting goo'ey over.

First was Visual Studio 2010, the presenter was particularly adventurous by running a pre-alpha Visual Studio on a pre-alpha Windows 7. It seemed to work well enough, only one crash during the talk. Showed some of the interesting features coming relating to Visualising your assemblies and classes. They've sexed up Visual Studio, by re-writing the editor to have WPF embedded, meaning that nice code highlighting can happen, you can have embedded images inside your comments and so much more.

Next major section he covered was a fully intergrated testing center. Showing nice features like video recording while testing that is attached to the bugs that are stored in Team System. Another sexy feature is that the testing centre will store all the debugging symbols of the application has its running so developers can replay the test in Visual Studio stepping through each line.

He also went on about some new C++ features but I phased out at that point. Richard perked up.

Lap Around the .NET Framework 3.5 SP1 Enhancements for Web Developers

4 new major items came out with SP1, Entity framework, ADO.NET Data Services, ASP.NET Routing and ASP.NET Dynamic Data. A quick overview of the entity framework was covered which was good to see the differences from LINQ to SQL. Looking forward to digging in much deeper on this topic to see how much pain we will suffer moving to it. ADO.NET Data services interested me greatly for silverlight. As silverlight can only talk to the server via web services, this seems like a perfect solution to builting a flexable data access layer for a silverlight application. ASP.NET routing is something we have already used for a couple of applications at Compsoft and are already building common code to implement. The last item was Dynamic Data which is a quick scaffolding framework for ASP.NET. This might have some use for admin screens in our applications but other than that, it didn't interest me that much.

Live Platform: Deep Dive on Microsoft Virtual Earth

I've never really seen much on Virtual Earth so I thought I would go outside my comfort zones and check this session out. First we covered the basics of Virtual Earth's web control. This is just a javascript include, making it an nice platform independent control. The part of the talk that interested me the most was the web service support now coming to Virtual Earth. This now allows you to generate map images server side to be rendered where ever you can imagine. Other nice features implemented on the web service was routing and searching. The service included nice complex searching for finding lat and longs from building names, streets or almost anything. Mark Brown showed some nice demos glueing all the features together. Interesting features that was covered as well were SQL 2008 spacial data type. Mark also showed nice code on how to query it and return spacial data.

Tristan Smith: Day Zero

November 10th 2008 is to be my first ever taste of the Tech Ed experience and I must say, I am *really* excited at the opportunity.

I’ve been to developer days (www.developerday.co.uk) held at Microsoft for the past few years and found them to be immensely useful, delving into areas of development you might be unlikely to come across in your day-to-day and finding out what future techniques and technologies are in the pipeline. It keeps you on the crest of the wave, able to see what is going to bring real value and what’s just sugar coating.

I imagine Tech Ed will be similar to this, though on a much grander scale, packed with industry leading speakers and experts who’re building the technologies we’ll be developing with in the future.

The developer track at Tech Ed consists of 481 sessions spread out over the 5 days, planning which sessions to attend is the first challenge.

The Tech Ed website has a schedule planner you can use to map out the sessions you want to attend. Within 5 minutes of using it, I found I would have to split myself 5 ways in order to see all the talks I wanted to.

Of the plethora of available sessions to attend, I’m most excited to find out more about (in no particular order):

Silverlight

I’ve been working with Silverlight since version 1.1 and found it to be a really well considered offering in the RIA (Rich Internet Application) space. It not only allows you to create a much more interactive user experience but also allows you to port your existing .NET development experience straight into this new space.

I will most certainly be attending a number of the sessions on offer for Silverlight. There are sessions on Silverlight Mobile, Accessibility, User Experience and Developer-Designer workflow to name but a few.

Visual Studio 10

The next version of Visual Studio looks like it will be offering a number of useful development features from additional code generation to software modelling tools, improved testing capabilities and better features for Team Foundation Server (Source control). I will be interested to find out how Microsoft will be improving the development environment we all use at Compsoft.

.NET Framework 4.0

It will be interesting to see what’s on the roadmap for the next version of .NET.

Microsoft Azure

Microsoft’s cloud computing platform features heavily in the sessions on offer as does writing applications that live in and work with data from the cloud. I will definitely be attending a few of these sessions.

Project Velocity – Distributed Caching Framework

Caching in all its forms can give significant application speed improvements. Velocity looks like Microsoft’s response to the call for making application scalability easier to implement.

Though somewhat biased, I believe Compsoft’s developers are quite unique in their passion for the software they develop and in making sure they’re using the best techniques to build the highest quality software possible. We are constantly improving our methods and techniques above and beyond the 9-5 and it is this passion combined with events such as Tech Ed that help give us that edge, and make us one of the UK’s forefront bespoke development houses.

Richard Thomason: TechEd - day zero

Yay it's TechEd again, the wheels are on the feet and the TechEd registration card is on the table at the airport car park check-in. No matter, the efficient team at the registration desk have me up and running in minutes, and the only danger is the TechEd TV guy lurking with his camera looking for stories. No heelying until out of sight of him.

This year I haven't had time to do the extensive evaluation of the tracks and topics that happened last year, so at least for today it's a question of looking through the excellent summaries in the conference timetable and chooosing the best one of the moment.

Last year was the big bang for Visual Studio 2008, and so had loads of material and so lots of big wigs. This year is more incremental. SQL Server 2008 is big, managing extra large data sets. The core of the content however is providing detailed under-the hood information on the current hot technologies. One I'm definitely going to is one called LINQ to anything - providing data sets to the LINQ interface. Can't be worse than ODBC and ADO...

Session 1 main choices:
  • Microsoft PABX for Windows, due out next year. Interesting technologically.
  • F# functional programming language, does simple and powerful asynchronous programming, apparently.
  • A couple of architecture astronaut sessions to be avoided (http://www.joelonsoftware.com/items/2008/05/01.html)
  • Sharepoint overview.


Session 2 has a Sharepoint detail workshop so it might have to be the F# one first.

Sunday, November 09, 2008

Tim Jeanes: TechEd 2008 - Day 0

Oh yeah! It's November again, which can only mean it's time for TechEd! "W00t" doesn't begin to describe it - this is a solid week of non-stop dawn-till-dusk hardcore geekery.

Since the TechEd, this past year has been an interesting one for our implementing new Microsoft technologies - we've made the most of Visual Studio 2008, and LINQ has radically accelerated our application development. LINQ to SQL has (for us, at least) made the biggest difference, so it's with some surprise that we've recently been hearing that Microsoft might be ditching it to focus entirely on LINQ to Entities.

If that's true, it's annoying at least. Still, I feel sure we're in good stead to adopt the newer technology and it shouldn't be too painful a transition: switching from using Gentle.NET (our previous object persistence framework) to LINQ wasn't too bad, and we've ensured the reusable code libraries we developed for LINQ to SQL would be even more easily swappable for the next big thing. Either way, I'm eager to see what LINQ to Entities can do for us.

TWo other technologies I've been largely ignoring this past year have been MVC and Silverlight. I've been reading the odd thing about them but I've also been aware that they've not really been ready for widespread use in the real world just yet.

We've been using the MVC routing engine to give some of our sites friendlier URLs, where that's been important to the customer, but that's all we've used. Though the whole MVC model appeals to me for its purity and testability, adopting it in its entirity would play havoc all the AJAX UpdatePanel goodness we've been using for the last couple of years. I've been sitting back and waiting for Microsoft MVC to turn into a grown-up complete product and let a few other people find and solve the most common problems, so it'll be interesting to see where it's up to now.

Silverlight hasn't been that useful for the sort of projects we've done at Compsoft historically, so I've not been keeping too close an eye on it - especially as Microsoft were quite open about how half-baked version 1 would be. However, now version 2's out, and with a couple of our recent clients having businesses that could really benefit from the rich user experience it offers, it's definitely time to get on board.

Friday, November 07, 2008

Neil Bostrom: Tech Ed 2008 Excitement!

Here we are again, Tech Ed 2008 is just around the corner. Tickets are booked, transfer is arranged, hotel map has been printed. We are all set!

So what am I excited about seeing this year? Well with Silverlight on everyone's lips and V2 fresh into RTW and toolkits being published quicker than I can download them, how could that not be at the top of the list!?

Next out of excitement box is C# 4.0 and Visual Studio 2010. Interested to find some of the less well known features coming out with it. Heard a bunch about dynamics and I'm only mindly excited about it (for our use anyway).

Another big topic I want to start working on while at Tech Ed is LINQ, more specifically the sad sad news that Microsoft is basically killing LINQ to SQL meaning we will need to make a move to LINQ to Entites at some point. I'm looking to take the opportunity at Tech Ed to geek up on LINQ to Entities before we have to make the move.