Archive for March, 2012

Nowadays we can found a lot of posts over the internet about new Microsoft windows 8 capabilities or Windows 8 Metro style Apps.  Since i am diving in to this platform since the public announcements of the developer preview, i decided today to take sometime to make a journey with you in a different view of windows 8.

I am talking about windows 8 runtime. This is the first post of our win RT journey.

Win RT is the codename that stands for Windows runtime, and is the software block of the new windows that powers metro style applications.

!important: remember that at the time of this written Windows 8 is at the consumer preview version so that can happen some slightly changes in the final versions.

Presenting WinRT

Presenting WinRT as a concept can be made on 4 different sentences:

  • Is a bunch of Windows Management APIS used to build Metro Style applications;
  • Is the runtime that manages the resources necessary to make a Metro Style APP run;
  • Is the maestro between the different software blocks that connects windows core and metro style apps;
All the sentences above are true and complementary views so if we try to condense all this view in to just one we will found the definition presented by microsoft since the build event
“WINRT is the solid, efficient foundation to build and run metrostyle APPS”
Localize WINRT in Windows 8
After understanding what is and what the mission of WINRT, let’s position Metro APPS in to the Windows 8 Universe and find the action place of WINRT.
                                                                                         (image copyrights to Microsoft)
 As you can see from the figure above and as you maybe already know, windows 8 windows support 2 kinds of different interaction paradigm (and build) apps.
  • Desktop Apps : the usual kind of applications we are used to in a windows operation system
  • Metro Style Apps: apps that follow the patterns of Metro style principles

As you can see from the picture Metro Style Apps are supported by a bunch of APIS named Windows Runtime APIS, this APIs correspond to the programmatic service interface of Windows runtime over the Operating System Kernel (like win32 or .NET libraries) . Basically WinRT sits right on top of Windows as a thin layer, exposing functions of Windows. These functions can be used in Metro style apps from all languages.

The figure above shows the different APIs used by developers to build Windows 8, that provides the abstraction layer over the operating system.

  • User Interface: Abstraction layer related to the handling of controls and other Visual and user interaction objects.
  • Devices: Abstraction layer that gives the developer an abstraction over the different devices that are assembled in the machine where the operating system runs (sensors, GPS and others).
  • Communication & Data: Abstraction layer over the communication between apps and systems.
  • Fundamentals: The core of the windows Runtime this API is an abstraction layer over the basic computation processes and needs of the application like memory management, security and others.

But Windows Runtime is much more than just a bunch of APIS, the most beautiful part is the runtime system and our main goal is to deconstruct and understand how this runtime works, so let’s continue our journey.

Discovering Windows Runtime Architecture

Let’s make take a deep look in to the Windows runtime deconstructing and understanding his architecture.

Windows Core: correspond to the services of Windows;

Windows runtime core: Is a Layer that exposes the Windows services, definition of types exposure of interfaces, is the core of the runtime;

UI, Pickers, Controls; Media; XAML;Storage; Network;.. : Some APIS that live on the top of windows runtime;

Windows Metadata & Namespace: The runtime give us the concept of metadata for types, what allow us to manage and get in a natural way the runtime notions of types.

Web Host: A host for Web applications;

Runtime Broker: is a separate process that handles the security permission of separated processes like sensors or cameras;

Language projection: A mechanism that allows the windows runtime API be exposed in a different way according to the language in usage;

Language support: Is the implementation of the technologies to allow the support of windows runtime over the different languages (WINJS,  CLR )

Thanks to is design and architecture of Windows Runtime it is allowed to create applications over Windows 8 runtime that respect the fundamental software development principles:

  • Major improvement of developer experience and freedom: thanks to the language projection and metadata developers can choose and use different languages without losing functionality and thanks to metadata we have great intellisense.
  • Responsive and fluid user first: One of the principles of windows 8 programing is assyncronism, that option is imposed in some cases by the platform and WINTRT;
  • APP Centric platform: Applications are isolated as they was in the past (with processes boundaries) but are possible the creation of contracts between apps and operating system and the manage of app to app contracts;
  • Versioning: The runtime enables the concept of version in a way that each application as the reference of built and can run in future systems, because runtime knows how to get that information and can adapt to the needs of the application.

That’s all for now, in the next post we will take a look in to Windows metadata and to the way memory managed and objects are supported. Thanks for your attention and stay tuned.

Next posts:


Memory protection in Internet explorer 10 explained step by step in this post a worth reading for the browsers builders and enthusiasts

I had been spending a great part of the night trying to figure out how could i automatic generate Controls and views in ASP.NET MVC 3 and i end up with a review to code first way to do things.

My problem was to allow some dynamic content to be manged directly from a website. For my example i used a canonical example based on books.

So here goes the review of automatic creation to the ones like me that don t remember sometimes this wonderful MVC 3 feature.

After long running R& D and tests i finally can do this. To do that i had to use some CRUD with scaffolding with Entity Framework and code first. So let’s meet my road to accomplish this.

Step1: Before sacaffolded, i create a model and a DbContext to define what data will be collected.  So i create the following classes

public class Book
public int ID { get; set; }
public string Title { get; set; }
public string Isbn { get; set; }
public string Summary { get; set; }
public string Author { get; set; }
public string Thumbnail { get; set; }
public double Price { get; set; }
public DateTime Published { get; set; }
public class BookDBContext : DbContext
public DbSet<Book> Books { get; set; }

The first class defines the concept of book and his data and actions. The second class is the context of book.

Step2: Create the model

i had use the right click of the mouse in to the Controller folder of my project and select Add Controller visual studio opens the window

This is a great way to quickly put your entities and elements running

While Windows 8 keep growing and creating fans in the backstage a lot of important decisions and metrics start to gain form. One of the things that make more curious nowadays when a application driven technology emerges, is how will work marketplace and what will be the market place requirements.

Today i had spend a part off my pre dinner reading the draft of requirements for windows 8 and i must confess this sems a good way to filter good from bad. Here you have for your analisies

Front end development class

Posted: March 22, 2012 in Anouncements, HTML 5

Today was announced a new class where i will be teaching HTML 5in Portugal  and some Front end development tricks and true deep knowledge, stay tunned in edit offers.

Snipets for HTML 5

Posted: March 21, 2012 in HTML 5

One off the useful things a good work tool of any developer had to have is snippets to maximize productivity. A lot of ides allows to had some off that.

I had joint to my visual studio some new snipptes of html5 today i share with you the post with that information

HTML 5 quick start

Posted: March 21, 2012 in HTML 5
Tags: , ,

Since half of the year off 2011 HTML 5 had become a growing star in the development community and business, some off the fault are of Steve Jobs you may say, but the true is HTML 5 is a great improvement in markup world and Client server applications.

Since the date i start developing in talking teaching and discussing HTML 5 about a year and half ago every day someone ask me how to start, what course should get what book.

Well today i had been viewing the Belgium Tech Days 2012 and i recommend this video from Jeff Prosise to everyone, even for the ones who think they know everything about HTML 5  (silverlight needed).

Today some developer of my company had ask about Dynamic Data usage for the creation of a backoffice, not about advantages and disadvantages but about how to do this. After asking another developers and architects inside and outside the company i figure out that dynamic data stills a mystery for a lot of people. So decided to post a cast i had upload to youtube long time ago about this subject.

I hope this helps people have an idea about how to use Dynamic Data.

Be carefull if your intend is to generate dynamic backoffices for your sites that have a lot of usability thoughts and needs and are nos sealed in time. Dynamic Data is great but is not easy to make a valid framework based on it.

But if you need and adopt this technology to doit pay attention that entities are generated by VS, so if in the feature anything changes in the database you have the need to regenerate all the entities and you can louse your customization and changes. So use the generated entities as a base from where you extend. To know how to extend in a elegant way as we do next.

Imagine you have a product table that had been used to generate the entity that represent that product, we have the need to extend the business logic of Product. To do that you take advantage of the fact that the generated class is Partial, knowing that is easy to extend the business logic. Imagine a reordering method.

public partial class Product
private short sStockLevel;
public short StockLevel
get { return sStockLevel; }
set { sStockLevel = value; }
partial void OnSafetyStockLevelChanging(short value)
StockLevel = value;
partial void OnReorderPointChanging(short value)
if (value > StockLevel)
throw new ValidationException(“Re-order Point exceeds the Safety Stock Level!”);

Javascript must have book

Posted: March 21, 2012 in Anouncements

I had been reading without stopping a great book about a language that is not always well understood by the development community. Everyone talks about javascript but how many really knows to develop in javascript, raise your hand…

Has i suspect very few hands raised. I admit there are a lot of javascript i still have to learn even after years in web development and contributions to open source javascript projects. At a first view javascript seems a weak and simple language, but there are a lot power in this small bro and a lot of secrets to be reveled even for the pros.

If you are in this quest for knowledge like i,  i would advice you to get this great book…even some patterns that we are already familiar to work with in javascript frameworks like jquery and mootools are finally explained here.

A great work of John Resig’s ( ).

Software factories are a good produtive quick start. They hel us not to repeat some hard work and to develop fast, but our Knowldge base still gold on the arena.

SPSF Sharepoint Software Factory is one off that cases. This tool that i strongly recommend to any Sharepoint 2010 developer is very usefull, but stay alert there are some bugs in the creation off fields, and by defaul features are always activated at the deploy off the solutions.

So don’t stay with the mindset that the factory will do everything and validate the core generated code, especially the code related with fields and content types.

At the company where i work i had adopted this great for the technical team but since the first days sometimes SPF don’t do all his work.

So beaware to the points:

Column Fields based on hyperlink or image will not work well;

List schema definitions should be reviewed because the factory assumes the item always as a valid content type of a costumfiled;

If you are not in the TFS championship yet…You may experience some problems using the GIt or the sourcesafe 2005

In the future we will talk more about Sharepoint Factory for sure for know i end with a video from the Developers of SPSF Sharepoint Software Factory to give you some clues of what ypou can do, and how this tool can help you