Category Archives: Uncategorized

“The .Net Continuum” Laurant Bugnion

[MS Techdays 2009] Summary “The .Net Continuum” Laurant Bugnion

Laurant Bugnion explained that Microsoft worked hard to expose WCF to all the presentation environments. The presentation continuum going from basic ASP.NET to Silverlight and WPF can now connect to WCF.

WPF1

The next part of the presentation explained the difficulties of connecting the presentation platforms to WCF if they are hosted on different serves resulting in cross-domain calls between the web server and WCF. The questions at hand was, is it possible to go direct to WCF or are we forced to go through the web server.

WPF2

Summary:

  • HTML: here there is no choice; you?l always have to pass through the web server. The web server will be the client of WCF.
  • AJAX: cross domain calls will result in the user being prompted in other cases AJAX will connect to WCF directly.
  • Silverlight: if the correct policies, client access policies, are in place WCF can be reached directly.
  • WPF: no problem, direct access is always possible.

The last part of the presentation was about the ViewModel pattern. This pattern avoids having your Silverlgiht or WPC logic connected directly, although some proxy is in between, to your data in WCF. It is the MVC for declarative and data-bound interfaces. The idea is to go from …

WPF3

to …

WPF4

… .

The ViewModel pattern removes the mixing of presentation and logic when you?e using codebehind during the development of your UI. The data is presented as properties of the ViewModel and consumed through normal databinding. Operations on the data, events, are exposed as methods of the ViewModel.

For code-examples and a detailed discussion of the ViewModel pattern have a look at: http://www.nikhilk.net/Silverlight-ViewModel-Pattern.aspx

Share this postSave this post

“WCF Tips and Tricks ” Christian Weyer

[MS Techdays 2009] Summary “WCF Tips and Tricks ” Christian Weyer

WCF
WCF is not just about web services (only consumption of web services) and not always about SOA (cool SOA framework). It is about Communication!

Consuming
Tips:

  • Follow the ABC-rule: Address, Bind and Contract.
  • For non-interop we don’t need proxy classes. Shared contracts work fine in WCF-to-WCF scenarios. Share contracts not types.
  • For ChannelFactories always try to close the channel.
  • Avoid using statements in proxies. These can throw network exceptions at the end of the using block. So use an explicit close with explicit exception handling.
  • Caching proxy or ChannelFactories avoid high overhead for setting-up and tearing-down in every call.

Examples:

WCF1

Hosting
Tips:

  • Use IIS always for robust high scalable hosting. Self-hosting in Windows Services is light-weighted and allows for more control.
  • Custom initializations can be realized through custom ServiceHost and ServiceHostFactory classes.

Examples:

WCF2

Binding
Tips:

  • Try to work session-less. By default WsHttpBinding is used which means heavy security and is session-based. Sessions also have the advantage that the security hand-shake is only done once. Wrong binding options can affect performance.
  • SOAP formatter is preferred over binary formatter. The argument most often used: ‘Because it is human readable.’Weyer’s? reaction: ‘Yeah right!’ In WCF-to-WCF communication the binary formatter is optimal for speed. Only in interop situations choose for angular brackets i.e. XML

Examples:

WCF3

Performance
Tips:

  • WCF is very conservative and is written to avoid DNS attacks. This means although default quota’s seem to be unbounded, WCF enforces quotas!

WCF4

To achieve real unbounded quota? you?l have to set these values to MaxValue. So never use the defaults but use some custom framework to change the values by default to MaxValue or to any other suited value.

Examples:

WCF5

Metadata
Tips:

  • Do not rely on the ?wsdl?because it is dynamically generated. Create a static flat WSDL file. By flat we mean avoid includes of other files.
  • Use IIS host headers to reflect names into WSDL instead of localhost. .Net 3.5 SP 1 supports multiple bindings without requiring multiple IIS-site base addresses.

Examples:

WCF6

Large Data
Tips:

  • Large data means avoiding SOAP messages.
  • Technical solutions are chunking and streaming:
    • Chunking: chopping the data payload into chunks, sent the chunks over the wire and glue back the chunks together. Chunking Channels are available as SDK and work transparently with different transports and bindings.
    • Streaming: requires contracts to follow the stream and message shape. Can’t be used in combination with MSMQ.
  • Alternative is the MTOM framework for encoding binary data. This is an alternative to SOAP in the case interop is required. So don’t be alarmed if you don’t have XML documents in an interop context!

Examples:

WCF7

Performance
Tips:

  • Cache, cache and cache! The problem is that to enable the scale out of your application to a farmed environment we require distributed caches which are only available in specialized frameworks.
  • Client site HTTP communication is limited by default to two concurrent connections but this is configurable through System.Net.

Examples:
WCF8

Tracing
Tips:

  • Tracing can save your day but don? overuse it in production! Tracing is organized through configuration.

Examples:

WCF9

Share this postSave this post

“LINQ In Breadth” Bart De Smet

[MS Techdays 2009] Summary “LINQ In Breadth” Bart De Smet

LINQ
Language Integrated Query or LINQ keeps on growing and is providing support for a lot of sources and allowing integration with several languages (see LINQ fan-in and fan-out below).

Linq1

LINQ brings together some parts introduced in the earlier versions of the .NET Framework like Lamba Expressions, Type Inference and Extension Methods and can be expressed in several syntaxes.

I started off trying to summarize for you everything Bart said but his presentation contained some many things going from Lambda expressions to the mathematical theory of Monads (Category Theory used to explain similarities between query operators like IEnumarble and IQueryable) that I just gave up. Summarizing it would have taken me about fifty pages of text and would probably confuse you more than help you. Moreover, I would have massacred a lot of Bart? ideas.

So I?l just direct you to his blog: http://community.bartdesmet.net/blogs/bart/Default.asp. Just have a look at the posts about Isoteric LINQ bindings, The construction of ExceLINQ and LINQ to Objects Debugging.

His blogs contains a lot of other interesting material if you?e more into the mathematic theories behind software development and programming.

A few highlights from his presentation

The evolution in C#

  • C# 2.0 iterators
    • yield return
    • On-demand fetch
    • E.g. LINQ to Objects
  • C# 3.0 lambdas
    • () => compute
    • On-demand evaluation
    • E.g. TPL futures

Expression translation cheat sheet:

Linq2

Share this postSave this post

“RAD Web Applications with ASP.NET Dynamic Data” Ingo Rammer

[MS Techdays 2009] Summary “RAD Web Applications with ASP.NET Dynamic Data” Ingo Rammer

(Very) Short Introduction
ASP.NET Dynamic Data basically is about quickly building data driven websites were data is stored in a SQL DB accessed through LINQ.

It requires scaffolding to bring the data and forms together but the remainder is automatically generated. The forms are generated at run-time so there is no code generation!

There are several templates available, for example for pages and fields, that can be modified or replaced by your own templates. There is support for full customization of the UI. There are really no limits since is all .NET. MVC style URLs can be used for example: http://server/DB/Table/Edit.

How to get started?
You can download ASP.NET Dynamic Data 4.0 Preview 3 via http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24887

Before you can get going with Dynamic Data you need to install at least .NET 3.5 SP1: http://www.microsoft.com/downloads/details.aspx?FamilyId=AB99342F-5D1A-413D-8319-81DA479AB0D7&displaylang=en

Ingo has written a tool to do the required scaffolding for you:

Important Remark from Ingo!
Because everything is generated at run-time performance is rather slow. According to Ingo this means Dynamic Data will never be used for high performance business applications. The added value is to use it whenever pages performing CRUD operations on a DB must be generated quickly and performance is not of the outmost importance but customization requires you to leave default forms alone.

For details

Share this postSave this post

“Software + Services: The Convergence of SaaS, SOA and Web 2.0” Beat Schwegler

[MS Techdays 2009] Summary “Software + Services: The Convergence of SaaS, SOA and Web 2.0” Beat Schwegler

I added some personal interpretations!

Trends in IT
Consuming software as a service (SaaS) can be easy if not a lot of customization is involved, for example e-mail and CRM.

The current web has evolved from a Web 1.0 application model, i.e. 1 author and n consumers, to the Web 2.0 model that works with n authors and m consumer and by that explicitly leveraging the network effects. For example Facebook and Amazon.

What are thriving Web 2.0 applications made of?
Firstly they bring together lots of data. Why is Wikipedia doing better than Encarta? The world is feeding Wikipedia whereas Encarta is being feed only by one company’s workforce. In a slogan “Data will be the next Intel inside’

Secondly they work on several devices. Applications must be able to adapt easily to the device there run on i.e. the environment of the user. Currently users are very demanding and they switch from a desktop to a laptop to a smart phone in a wink of eye. If your application does not support all these environments you are commercially handicapped.

What new business models can be found to make Web 2.0 application a success? In other words how to make money from blogs, wiki’s, social network, enterprise search, mash-ups, Š

In their book Place to Space: Migrating to E-business Models Peter Weill and Michael Vitale introduce several models. Every business model is explained using three basic flows, 1. cash-flow, 2. flow of information and 3. flow of products, and relationships between parties participating in the flows 1. consumer, 2. producer or 3. intermediate party.

A typical example is Google advertising. Google provides, as intermediate party, information to a potential customer looking for a product and receives a small fee for this from a supplier of that product. You have an information flow between Google and the customer and a cash flow between the supplier of the good and Google. If the customer decides to buy there is product flow and a cash flow between supplier and consumer.

Example of Web 2.0 applications:

  • Eve online
  • Photosynth
  • British Library
  • Yosemite Extreme Panoramic Imaging Project
  • Exchange server 2007

Enterprise 2.0
Enterprise 2.0 is about bringing together:

  • SaaS: Service delivery model = ‘How to deliver!’
  • SOA: Service composition = ‘How to create!’
  • Web 2.0: Service Experience and business model = ‘How to make money!’

Following decision matrix for service delivery and provisioning can be used in Enterprise 2.0 application models.

SaaS1

The provisioning axis is the decision between making it ourselves or buying a solution, balancing the control over implemented features and the economics of scale. The other axis is the delivery model going from local hosted on your own premises to completely hosted and maintained by a vendor, balancing the control over the SLA and economics of scale.

Important for Web 2.0 applications is how your company will cope if an applications becomes a success?

Technically this means that applications must be build in such way they scale-up and scale-out very easy.

Economically the question is raised how and where the applications are going to be hosted. How are you going to find the money required for the additional server capacity? Do you really want to invest in the server capacity to host it yourself? What if things go bad? In that case you?l end up with expensive unused capacity!

The economic crisis forces us to critically look at Capital Expenditure (CAPEX) and Operational Expenditure (OPEX). Enterprise 2.0 concepts give you alternatives to investing in self hosting during the credit crunch. If you start using services in the cloud with flexible capacity schemes you?l avoid pre-financing. Operational costs are reduced as well. Think about installing a patch for an OS if you?e self hosting compared to hosting in the cloud. For the latter case it is just up to your service provider to get this organized.

The idea about moving to the cloud is basically reducing costs by folding back to core activities. For most of us hosting is not a core activity and so it can be focal point for cost reduction.

Programming Model for the Cloud
Normally applications adhere to CAP:

  • Consistency
  • Availability
  • Tolerance to network Partitions

Applications in the cloud trade in one of these. For example ACID DB transactions are very hard, if not impossible, when you want scalable systems with thousands of simultaneous users. So CAP becomes BASE:

  • Basically availably networks
  • Soft-state
  • Eventual consistency

Microsoft’s Programming Model adhere to the Cloud
Microsoft’s Windows Azure is a platform specifically designed for cloud services. Microsoft promises flexible scaling where you only pay for the hosting capacity you require. The platform brings everything, you would locally use, to the cloud. For example SQL DB has become SQL Services for Azure.

SaaS2

.NET Services are an extension of .NET capabilities to the cloud, trying to make cloud computing as transparent as possible to the developer in other words leveraging the developers knowledge to the cloud.

For the moment three services are available but more to follow:

  • .NET Service Bus
  • .NET Workflow Service
  • .NET Access Control Service

Summary

  • Services enrich software ‘1+1 = 3’ think about Web 2.0 new business models
  • Effective provisioning is key: reuse what others already have build as a service, do not reinvent the wheel
  • Think green and save a buck: cloud computing allows for power efficient software hosting in data centers
  • Focus on programming models embracing cloud computing and take into account the BASE principles when developing for the cloud.
Share this postSave this post