Archive for August, 2012


Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF, you can send data as asynchronous messages from one service endpoint to another. A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application. An endpoint can be a client of a service that requests data from a service endpoint. The messages can be as simple as a single character or word sent as XML, or as complex as a stream of binary data.

WCF Everything

WCF is used to design, implement and deploy distributed applications. While creating such applications was possible prior to the existence of WCF, WCF makes the development of endpoints easier than ever. In summary, WCF is designed to offer a manageable approach to creating Web services and Web service clients. WCF is designed using service oriented architecture principles to support distributed computing where services have remote consumers. Clients can consume multiple services; services can be consumed by multiple clients. Services are loosely coupled to each other. Services typically have a WSDL interface (Web Services Description Language) that any WCF client can use to consume the service, regardless of which platform the service is hosted on.

WCF Feature Highlight :

WCF is a flexible and robust platform. Here is the list of all major WCF features.

    1. Endpoints: Addresses, Bindings, and Contracts

    2. Data Transfer and Serialization

    3. Sessions, Instancing, and Concurrency

    4. Transports in Windows Communication Foundation

    5. Queues and Reliable Sessions

    6. Transactions

    7. Windows Communication Foundation Security

    8. Peer-to-Peer Networking

    9. Metadata

    10. Clients

    11. Hosting

    12. Interoperability and Integration

    13. WCF Web HTTP Programming Model

    14. WCF Syndication

    15. AJAX Integration and JSON Support

    16. WCF Discovery

    17. Routing

    18. Workflow Services

I will explore each and every feature listed here in coming blog posts. In Next post I will try to explain WCF architecture and fundamental terms.
Click “Follow” in right-bottom corner of your screen to subscribe to this blog and to have all new blog posts directly in your inbox.

I have been thinking to start a multi-part blog series targeting a latest Microsoft Technology. Purpose of which was to share my knowledge on the same and to acquire more in depth awareness on the technology. There were many techs on my list like C# language, Silverlight, WCF, Entity Framework, N-Hibernate, Telerik Controls etc… After enough brain storming for deciding on one of it, I have selected WCF – Windows Communication Foundation.

WCF Everything

Reasons for which I decided to write on WCF…

  1. For having more exposure to most trending, most buzzing technical terminology “SOA” – Service Oriented Architecture.
  2. All .Net client technologies like Silverlight, WPF, Windows Phone or even ASP.Net somewhere-somehow are integrating with WCF to communicate with another client, server or service. So while learning WCF, I will be having encounter-exposure to almost all diverse .Net technologies.
  3. Also targeting to take up MCTS certification in 2013 first quarter for which also I have decided to go with WCF.

Content of Blog Series…

  • It won’t be just WCF centric blog series at all. In fact while talking-writing about WCF we will also get in to integration details with other client techs also. And not just clients only but also we will try to have some exposure on WCF integration with latest stuff like caching, virtualization, cloud computing (largely on Microsoft Azure Platform).
  • Specifically I will start with explaining… What is WCF? Why is WCF required? Then progressively we will get in to ABC (Address, Bindings, and Contract) of WCF, SOAP, and REST with in-depth exploration of the same. And at last I will end up with high end integration scenarios like working with concurrency, transactions, sessions, web sockets and more.

Resources…

  • With each blog I will provide the source code for the samples I will be creating plus will provide with links to online docs, samples, videos on the related topic as well. And of-course comments, questions and discussions are always invited.
  • All the coding will be done in Dot Net Framework 4.5 with Visual Studio 2012 RC installed on Wndows 8 RC.
  • I will be writing all WCF blogs under new category called “WCF Everything”. I also will be keep writing on non WCF .Net stuff as well. So be prepared, be ready for some exciting reading on WCF.
Click “Follow” in right-bottom corner of your screen to subscribe to this blog and to have all new blog posts directly in your inbox.

 

 

 

Visual Studio Snippets… Very useful but not really widely discussed topic at all at workplaces. Recently one of my colleagues shared a snippet file to use but many of my other colleagues around me were not really very familiar with the snippet concept itself. So here I am with worth reading blog on Snippets.

Snippets are the code blocks which can be defined as templates in xml format with well-defined elements and attributes.   The example of most common snippet is “prop”/”propfull” in visual studio which many of us are using in day to day code writing. We just need to type “prop” and press Tab key twice and visual studio will generate generic code block for property in code behind file.

Create Snippet…

Now we will create a new snippet “propfpc” for Property but with some addition to default “prop” snippet.

  1. Copy following xml code to Notepad file.
  2. Save File with .snippet extension.
  3. Observe the file which is very well self explanatory with well defined Elements and Attributes.

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="<a href="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet</a>">
<CodeSnippet Format="1.0.0">
<Header>
<Title>propfpc</Title>
<Shortcut>propfpc</Shortcut>
<Description>Code snippet for an automatically implemented property with property change call</Description>
<Author>Nikhil Thaker</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>type</ID>
<ToolTip>Property Type</ToolTip>
<Default>int</Default>
</Literal>
<Literal>
<ID>property</ID>
<ToolTip>Property Name</ToolTip>
<Default>MyProperty</Default>
</Literal>
<Literal>
<ID>_property</ID>
<ToolTip>_property Name</ToolTip>
<Default>_myProperty</Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[
private $type$ $_property$;
public $type$ $property$
{
get { return $_property$;}
set { $_property$ = value; FirePropertyChanged("$property$");}
}
$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>

Import Snippet to Visual Studio…

Go to Visual Studio –> Tools –> Code Snippets Manager –>Click “Import” button –> Select the snippet file you just created –> Select Location –> Click “Finish” button

Using Snippet in Visual Studio…

Now you are ready to use the snippet in Visual Studio.

  1. Open any code behind file in Visual Studio.
  2. Type shortcut you gave for snippet. In this case its “propfpc”.
  3. Press Tab key twice and bingo.. Your snippet has been implemented in file.

Here are some MSDN links for getting into more details on Visual Studio IntelliSense Snippets…

http://msdn.microsoft.com/en-us/library/ms165392(v=vs.80).aspx

http://msdn.microsoft.com/en-us/library/z4c5cc9b(v=vs.80).aspx

Here is the link for SnippetDesigner (Visual Studio Extension) on CodePlex which simplifies snippet creation…

http://snippetdesigner.codeplex.com/

Feel free to put comments, ask questions and start discussions on Visual Studio IntelliSense Snippets here.
It is the fourth flick Directed by Christopher Nolan in which Christian Bale has played the lead role and it was as awesome as last three (“Batman I & II and “The Prestige”). This movie is not really as exceptional as Christopher Nolan’s other trend setter creations like “Inception” or “The Prestige”, but definitely it is just more than good for being descendent of first two Batman movies “The Batman Begins” and “The Dark Knight Rises”.
The Dark Knight Rises
Just like previous Batman movies, here also it is a great battle between “good” and “bad”, and ultimately it is win of “good” over bad. So if you will go to see the movie with some great expectations of story and suspense, it will be the disappointment for you. The story has got nothing fancy but you will of-course feel the touch of Christopher Nolan in each and every aspect/moment of the movie. Whether it is Bruce Wayne’s release from prison in climax or the way Alfred is departing from Bruce or the belief Batman/Bruce shows in Selina even after she betrayed him or the character of Ben and Miranda who rise from the prison and tries to bury the city of “Gotham” for unjustified reasons, all are just portrayed perfect by the creator.
The Dark Knight Rises
Being fan of Christian Bale, I of-course like the dual character of Batman and Bruce Wayne he played again successfully, however the surprise here was the character of Selina played greatly by Anne Hathaway. Gary Oldman as Commissioner Gordon and Joseph Gordon Levitt as Blake (who actually ended being “Robin”) did really acted exceptionally well in their positive roles. The negative side also is well balanced by Tom Hardy as Bane and Marion Cottilard as Miranda Tate. Other characters were also crafted just picture perfect as always like Morgan Freeman as Mr. Fox and Michael Caine as Alfred.
Must see movie if you are calling yourself anything close to “fan” of Hollywood movies. Maybe the movie has got no repeat value considering the straight forward storyline and length of over two and half hours but still if are a real fan of any of the big names like Christopher Nolan, Christian Bale, Anne Hathaway or any other actor, I can bet you are going to see this flick again.