http://dallastechfest.com/2009
The following Technologies will be covered
Register today at http://dallastechfest.eventbrite.com - the cost is $50
Nandri
SreenivasaRagavan.
Bytes Matters
http://dallastechfest.com/2009
The following Technologies will be covered
Register today at http://dallastechfest.eventbrite.com - the cost is $50
Nandri
SreenivasaRagavan.
Composite Application Guidance for WPF and Silverlight- Feb 2009.
PRISM ?
PRISM is the code name for the Composite Application Guidance for WPF and Silverlight is designed to help you more easily build enterprise-level Windows Presentation Foundation (WPF) and Silverlight client applications.
Nandri
Sreenivasaragavan.
Silverlight supports data validation in TwoWay bindings for target-to-source updates. To setting the following two properties ValidatesOnExceptions=True,NotifyOnValidationError=True to True we can receive Error Notification from Binding engine.
Note: Siliverlight throws Exception in two cases
Setting ValidatesOnExceptions to true tells the binding engine to create a validation error when an exception occurs.
Setting NotifyOnValidationError to true tells the binding engine to raise the BindingValidationError event when a validation error occurs and resolves.
The BindingValidationError event is a routed event, so if you do not handle it on the element that raised the event, it will continue to bubble up until it is handled.
Here is sample Program. Here i going to build a small data entry form which requires user to enter Name , Age, Email and Phone. in this Data entry form I am setting Name,Email, age are Required fields and Age is numeric if you enter more than 100 it will throw an Expectation saying Invalid Input. No validation set on Phone Property . all the above mentioned properties makes a class called Contacts as shown below.
Now i am Initializing the Contacts class properties with the following values as shown.
All Inputs field has valid data.
This form shows Name can not be empty.
This Data entry form shows Age can not be more than 100 .
Nandri
SreenivasaRagavan.
In .NET Framework 2.0 we are able to detect the network status using System.Net.NetworkInformation API. Now we can use this same feature in Silverlight 3.0
The Namespace System.Net.NetworkInformation has the class name called NetworkChange this class has one event called NetworkAddressChanged using this even we are able to detect network status . Now i am going to write small Silverlight App which will show how to use NetworkChange and NetworkAddressChanged. event.
Again you can write simple application to demonstrate but i wanted to use some of the other new features of SilverLight 3.0 like Effects , Projection
In my blog i put lot of pictures because One Picture == 1000 words ( so that we can C# ( see sharp)).
Here is the XAML UI code and Code behind Logic .
Nandri
SreenivasaRagavan,
Pex (Program EXploration) is an intelligent assistant to the programmer. From a parameterized unit test, it automatically produces a traditional unit test suite with high code coverage. In addition, it suggests to the programmer how to fix the bugs.
Point your IE browser to http://msdn.microsoft.com/en-us/devlabs/cc950525.aspx to download, Install and Evaluate .
Nandri
SreenivasaRagavan.
Code Contracts are static library methods used from any .NET program to specify the code’s behavior. Runtime checking and static checking tools are both provided for taking advantage of contracts.
Code Contracts provide a language-agnostic way to express coding assumptions in .NET programs. The contracts take the form of pre-conditions, post-conditions, and object invariants. Contracts act as checked documentation of your external and internal APIs. The contracts are used to improve testing via runtime checking, enable static contract verification, and documentation generation. Code Contracts bring the advantages of design-by-contract programming to all .NET programming languages. We currently provide two tools:
[Source : Microsoft]
Here is the link to know more about Code Contracts http://msdn.microsoft.com/en-us/devlabs/dd491992.aspx
Nandri
SreenivasaRagavan
A well-known speaker started off his seminar by holding up a Rupee 500 [Indian Currency] note.
In the room of 200 people, he asked, "Who would like this Rupee 500 note?"
Hands are started going up. He said, "I am going to give this note to one of you but first let me do this." He proceeded to crumple the note up. He then asked, "Who still wants it? Still the hands were up in the air.
"Well," he replied, "What if I do this?" And he dropped it on the ground and started to grind it into the floor with his shoe. He picked it up, now all crumpled and dirty. "Now who still wants it?" Still the hands went into the air.
"My friends, you have all learned a very valuable lesson. No matter what I did to the money, you still wanted it because it did not decrease in value. It was still worth Rupee 500/-.
Many times in our lives, we are dropped, crumpled, and ground into the dirt by the decisions we make or some one will Rate our skills or work experience etc.. and the circumstances that come our way. You may feel as though you are worthless! But no matter what has happened or what will happen, you will never lose your value.
You are special. Don't ever forget it! Never let yesterday's disappointments overshadow tomorrow's dreams.
[source :Sheo Narayan]
Thanks
SreenivasaRagavan
In Silverlight 3.0 we can able to produce 3D effects using new feature called Projection. Now the UIElement has a new property called Projection .
Here is the Example how to use this new feature.
The above XAML code the Image Element uses PlaneProjection and also i used another new feature called Element to Element binding to bind the Value of Slider to PlaneProjection property RotationY and Text property of TextBlcok .
While running this application change the slider to new position the current value of Slider control will updated in TexBlcok and angle RotationY in PlaneProjection. here are the screenshots in different Projection value.
Nandri
Sreenivasaragavan.
Here i have highlighted some of the new controls which is part of Silverlight 3.0. I think in future most of the web apps will be light up with Silverlight. Look like Flash going to lose Action soon( Remember it uses Action Script).
Nandri
SreenivasaRagavan
In Silverlight 3.0 beta we can bind a value of one control to other Silverlight control . for example here i am going to choose two elements TextBlock and Slider Control. Now I am going to bind Value of Slider Control to TextBlock Text property with out writing single line of code.
In SilverLight 2.0 we write code behind to update the TextBlock text property when the slider ValueChange event occur .
This is GUI for above XAML CODE.
Text="{Binding ElementName=slider, Path=Value, Mode=OneWay}" // The Binding mode i am using One-way because my Binding control is TextBlock (Read-only)
we can also specify Mode =TwoWay in that case we need use TextBox instead of TextBlock. Now if you input any integer value in TextBox same time First Element Slider Control also slide to same position as the value imputed in TextBox.
Now Run the application and Move the slider same time Second Element TextBlock Control Text will be updated based on slider position value as shown below .
Nandri
SreenivasaRagavan.
With Silverlight 3.0 now we can run any Silverlight Application we can run as Desktop Application that means Running a SL 3.0 apps out side the IE Browser. The good things that this feature added to SL.3.0 with no additional download any plug-in and also this feature work in Cross platform Windows and MAC.
Let see how we can enable this feature.
1) Create a Silverlight 3.0 Application
2) Change the AppManifest.xml as shown below.
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<Deployment.Parts>
</Deployment.Parts>
<!--Uncomment the markup and update the fields below to make your application offline enabled-->
<Deployment.ApplicationIdentity>
<ApplicationIdentity
ShortName="Out of Browser Silverlight Application"
Title="Sreeni Silverlight Application ">
<ApplicationIdentity.Blurb>Description of your Silverlight application</ApplicationIdentity.Blurb>
</ApplicationIdentity>
</Deployment.ApplicationIdentity>
</Deployment>
After enabling the above Lines on AppManifest.xml file run the application and right click you get the context menu as shown in below screenshot.
When you select Install Out of Browser Silverlight ..On this computer option you get the following dialog box
This below screenshot shows SL 3.0 Application Runs out of browser application ( Local host)
I choose Install on Desktop so my SL 3.0 application installed on my DESKTOP now you can see last desktop ICON in below screenshot
Now your right click on running Application you will get Different Context menu saying Remove this Application.
NOTE: this same feature you can enable via Programming .
Nandri
SreenivasaRagavan.
Download the Silverlight 3.0 and light up the Web and Business.
SL 3.0 Runtime
http://go.microsoft.com/fwlink/?linkid=143433
VS.NET 2008 SP1 Tools
SDK
SDK Installation
Nandri
SreenivasaRagavan.
Install both the Windows Azure Tools for Visual Studio and SDK: http://go.microsoft.com/fwlink/?LinkId=128752
Nandri
SreenivasaRagavan.
WCF REST Starter Kit Codeplex Preview 2 available on CodePlex. please point your IE browser here and download.
http://www.codeplex.com/aspnet/Wiki/View.aspx?title=WCF%20REST&referringTitle=Home
Nandri
SreenivasaRagavan
What is Correlation?
Suppose let say Microsoft asked HITACHI CONSULTING to host a Hands on training events for Developing an Applications on Windows AZURE Platform. In this case HITACHI CONSULTING will send out an Invitation to the developers nationwide at the same time HITACHI CONUSLTING wants to know how may people will be to attending this events so that they can arrange all facilities for all attendees . To find out number of attendees for this events HITACHI CONSULTING will match the all of these responses to the Invitation they sent out this is called Correlation.
Now let see how we can achieve this process using BizTalk Solution. We will use BizTalk Orchestration to define the process and we define the Invitation as BizTalk XSD Schema. When we send Initiation we also send Unique reference number the same way the response also should have this reference number this help us to match the request to the response.
For a Invitation that is sent in an orchestration instance we have to define in the orchestration which part of the message correlates the request. The response to this Invitation should also specify this same reference number, this will allow us to easily match the request to the response. In BizTalk correlation type is simply a collection of one or more properties that uniquely identify a request and matching response.
Steps needed to implement this Business process in BIZTALK 2009( i am using 2009 you can also use 2004 , 2006).
1) Define a Invitation Message as BizTalk XSD Schema .
2) Create a Property schema with Invitation Ref Number as promoted filed .
3) Create and Configure Orchestration with Receive and Send ports.
4) Create Correlation type and set.
5) Deploy the solution and test it.
Create the Invitation Schema with following attribute . In this Schema InviteRefNumber is Uniquely indentify a attendee.
When we wanted to access a message property inside BizTalk Orchestration we need to promote that particularly property that is called Message Context . this can be done with special kind of schema called Property Schema . in this above schema we are going to promote InviteRefNumber once we are done that we can define correlation type.
Add new Property Schema as shown below.
Promote the InviteRefNumber field.
Creating a Business process as BizTalk Orchestration and define the message type , ports and correlation type and sets.
Now deploy the BizTalk solution and configure Receive , send ports and Orchestration. Before that do not forgot to add SN Key ( strong name key ) file to the BizTalk project. because this BizTalk solution will deployed in GAC
GAC – Global Assembly Cache.
After configuring BizTalk solution using BizTalk Admin console . drop the Invite message in In Folder you will see ASAP the BizTalk process picked of the message and send to Out Folder. now if you query the message Instances you will see the Orchestration instance status is Dehydrated that means it persisted in BizTalk message box and waiting for response message to arrive.
Now you copy the message from OUT folder and paste into IN1 ( folder ) then query the Service Instance you wont find in BizTalk Message DB this is called Hydrated that means the persisted Orchestration instance is processed by the corresponding correlated Response message .
Nandri
Sreenivasaragavan.
[Success is the result of your action –BABA]
Microsoft SQL Data Services known as SDS its part of the Windows Azure Platform. SDS are highly scalable and its built on Microsoft SQL Server and Windows Server Technology. SDS provides industry standard protocol such as SOAP and REST way to Program and query the data.
SDS data model is three level of containment model that is known as ACE .
A- Authority , C – Container , E- Entity.
Authority :
Authority is the top level of this Three level containment. An authority is represented by a DNS name for example sreenicontact.data.database.windows.net where sreenicontact is an authority and data.database.windows.net
refers to the service. You can create more than one authority The DNS name of an authority resolves to an IP address that maps to a specific data center.
Container :
Authority is a collection of containers. A single authority can have zero or more containers Each containers have unique Id within authority. containers stores entity this is noting but Data. Containers can have zero or more entities.
Entities :
Each entity inside a container can store any number of user-defined properties and corresponding values. for example i can store the following entity model in a container.
Right now the following Data types are supported by SDS. when you create a XML payload either using SOAP or REST.
By default all the Entity has the following fixed set of metadata properties. Id, Version , Kind.
Id – This properties uniquely identifies a flexible entity .
Version – This property value is assigned by system when ever any entity is created. current date time value will be assigned .
Kind –This property values is user defined Identifiers to identifies entity type ( for example HContact, Employee, Orders etc..);
Now let us Access SDS via programming to do create Authority , Container and Entity after that we will store and query the data as well.
I am going to use SOAP based API to program against SQL Data Service . Here is the URL for SOAP format to access SDS.
https://data.database.windows.net/soap/v1/mex. Here i am going to create simple C# console application . First we need to add Service reference to the console application.
After adding SDS service reference you can see the list of operations.
Now we need to create a methods for to Create Authority , Container , Entity and store and Query the SDS data.
Please make sure that you provide small case letter for authority id
private static string authority="sreenicontact";
private static string container = "contact";
Now Call the above created the function in main program and store some data in above created Entity.
Here is output of the above Query [ from e in entities select e"]
Nandri
Sreenivasaragavan