Technology Overview

Preview:

DESCRIPTION

An overview of up to date Microsoft technology, like VSTS, WCF, Silverlight and more

Citation preview

סקר טכנולוגיסקר טכנולוגי

לירן זילכהמנכ"ל משותף

Liran.zelkha@alunasoft.com

AlunaAlunaIsrael’s leading Java/JavaEE and SOA

consulting companyCustomers:

AgendaAgendaIT concepts:

◦SOA◦Cloud Computing

Products:◦SQL Server 2008◦VSTS

Development Technologies:◦WPF (XAML)◦Silverlight◦WCF

SOASOA

From Objects to ServicesFrom Objects to Services

PolymorphismPolymorphismEncapsulationEncapsulationSubclassingSubclassing

Message-basedMessage-basedSchema+ContractSchema+ContractBinding via PolicyBinding via Policy

1980s1980s

2000s2000s

Interface-basedInterface-basedDynamic LoadingDynamic LoadingRuntime MetadataRuntime Metadata

1990s1990s

Object-OrientedObject-Oriented

Service-OrientedService-Oriented

Component-BasedComponent-Based

Benefits of Service OrientationBenefits of Service OrientationFacilitates implementation/platform

interopIndependent deployment, versioning,

mgmtPromotes technology reuse

The Challenge - Radically Simplifying The Challenge - Radically Simplifying Distributed Application DevelopmentDistributed Application Development

Development of connected systemsremains costly and frustrating

Different programming models for different tasksNeed for security and reliable messaging Interoperability with applications on other platformsProductive service-oriented programming model

needed

Cloud ComputingCloud Computing

QuestionsQuestionsWhat is cloud computing?

◦Horizontal and functional servicesWhat’s it going to change?

◦Software business models, science, lifeHow many clouds will there be?

◦1, 2, 3, infinity What’s new in cloud computing?

◦HPC grids, ASPs, hosted services, Multics (!)◦Emerging “cloud stack” to support a broad

class of programs, including data intensive applications

Living in the CloudsLiving in the CloudsWe want to start a new website,

FredsList.comOur site will provide listings of items for sale,

jobs, etc.As time goes on, we’ll add more features

◦And illustrate how more cloud capabilities (and corresponding infrastructure components) are used as needed List of capabilities/components is illustrative, not

exhaustiveOur cloud provides a “dataset” abstraction

◦FredsList doesn’t worry about the underlying components

Step 1: Listings ScenarioStep 1: Listings Scenario

Simple Web Service API’s Simple Web Service API’s

Database

PNUTS

FredsList.com application FredsList.com application

1234323 ,transportation, For sale: one

bicycle, barely used

FredsList wants to store listings as (key, category, description)

5523442 ,childcare ,Nanny available

in San Jose

215534 ,wanted ,

Looking for issue 1 of

Superman comic book

DECLARE DATASET Listings AS )ID String PRIMARY KEY,

Category String,Description Text(

DECLARE DATASET Listings AS )ID String PRIMARY KEY,

Category String,Description Text(

Step 2: System EvolutionStep 2: System Evolution

Simple Web Service API’s Simple Web Service API’s

Database

PNUTS

FredsList.com application FredsList.com application

1234323 ,transportation, For sale: one

bicycle, barely used

Fred belatedly realizes prices are useful information!

5523442 ,childcare ,Nanny available

in San Jose

215534 ,wanted ,

Looking for issue 1 of

Superman comic book

ALTER DATASET ListingsADD (Price Float)

ALTER DATASET ListingsADD (Price Float)

Schemas are

flexible, and

evolve

32138 ,camera ,

Nikon D40,USD 300

Not every record in adataset has values defined

for all fields declared forthe dataset

vs.

Step 3: SearchStep 3: Search

Simple Web Service API’s Simple Web Service API’s

Database

PNUTS

“bicycle”

FredsList’s customers quickly ask for keyword search

Search

Vespa

“dvd’s” “nanny”

FredsList.com application FredsList.com application ALTER Listings

SET Description SEARCHABLE

ALTER ListingsSET Description SEARCHABLE

MessagingTribble

Federation of systems

offering different

capabilities

Step 4: PhotosStep 4: Photos

Simple Web Service API’s Simple Web Service API’s

Database

PNUTS

FredsList decides to add photos/videos to listings

Search

Vespa

Storage

MObStorForeign key

photo → listing

FredsList.com application FredsList.com application

ALTER ListingsADD Photo BLOB

ALTER ListingsADD Photo BLOB

MessagingTribble

Federation of systems

offering different

performance points

Step 5: Data AnalysisStep 5: Data Analysis

Simple Web Service API’s Simple Web Service API’s

Database

PNUTS

FredsList wants to analyze its listings to get statistics about category, do geocoding, etc.

Search

Vespa

Storage

MObStorForeign key

photo → listing

FredsList.com application FredsList.com application

ALTER ListingsMAKE ANALYZABLE

ALTER ListingsMAKE ANALYZABLE

Compute

Grid

Batch export

Pig query to analyze

categories

Hadoop program to

geocode data

Hadoop program to generate fancy pages for listings

MessagingTribble

Step 6: PerformanceStep 6: Performance

Simple Web Service API’s Simple Web Service API’s

Database

PNUTS

FredsList wants to reduce its data access latency

Search

Vespa

MessagingTribble

Storage

MObStorForeign key

photo → listing

FredsList.com application FredsList.com application

ALTER ListingsMAKE CACHEABLE

ALTER ListingsMAKE CACHEABLE

Compute

Grid

Batch export

Caching

memcached

And by now, Fred is global,

and wants geo-

replication!

Data Serving vs. AnalysisData Serving vs. AnalysisVery different workloads, requirementsData from serving system is one of many

kinds of data (click streams are another common kind, as are syndicated feeds) to be analyzed and integrated

The result of analysis often goes right back into serving system

Why Clouds?Why Clouds?On-demand infrastructure to create a

fundamental shift in the OE curve:◦Do things we can’t do

Build more robustly, more efficiently, more globally, more completely, more quickly, for a given budget

Cloud services should do heavy lifting of heavy-lifting of scaling & high-availability◦Today, this is done at the app-level, which is

not productive

Requirements for Cloud ServicesRequirements for Cloud ServicesMultitenant. A cloud service must support

multiple, organizationally distant customers. Elasticity. Tenants should be able to

negotiate and receive resources/QoS on-demand.

Resource Sharing. Ideally, spare cloud resources should be transparently applied when a tenant’s negotiated QoS is insufficient, e.g., due to spikes.

Horizontal scaling. It should be possible to add cloud capacity in small increments; this should be transparent to the tenants of the service.

Requirements for Cloud ServicesRequirements for Cloud ServicesMetering. A cloud service must support

accounting that reasonably ascribes operational and capital expenditures to each of the tenants of the service.

Security. A cloud service should be secure in that tenants are not made vulnerable because of loopholes in the cloud.

Availability. A cloud service should be highly available.

Operability. A cloud service should be easy to operate, with few operators. Operating costs should scale linearly or better with the capacity of the service.

Types of Cloud ServicesTypes of Cloud ServicesTwo kinds of cloud services:

◦Horizontal (“Platform”) Cloud Services Functionality enabling tenants to build applications or

new services on top of the cloud◦Functional Cloud Services

Functionality that is useful in and of itself to tenants. E.g., various SaaS instances, such as Saleforce.com; Google Analytics and Yahoo!’s IndexTools; Yahoo! properties aimed at end-users and small businesses, e.g., flickr, Groups, Mail, News, Shopping

Could be built on top of horizontal cloud services or from scratch

Yahoo! has been offering these for a long while (e.g., Mail for SMB, Groups, Flickr, BOSS, Ad exchanges)

Horizontal Cloud ServicesHorizontal Cloud Services Horizontal cloud services are foundations on which tenants

build applications or new services. They should be:◦ Semantics-free. Must be "generic infrastructure,” and not tied to

specific app-logic. May provide the ability to inject application logic through well-defined

APIs◦ Broadly applicable. Must be broadly applicable (i.e., it can't be

intended for just one or two properties). ◦ Fault-tolerant over commodity hardware. Must be built using

inexpensive commodity hardware, and should mask component failures.

While each cloud service provides value, the power of the cloud paradigm will depend on a collection of well-chosen, loosely coupled services that collectively make it easy to quickly develop and operate innovative web applications.

Web Data ManagementWeb Data Management

Large data analysis)Hadoop(

Structured record storage

)PNUTS/Sherpa(

Blob storage)SAN/NAS(

• Scan oriented workloads

• Focus on sequential disk I/O

• $ per cpu cycle

• CRUD • Point lookups and short scans

• Index organized table and random I/Os

• $ per latency

• Object retrieval and streaming

• Scalable file storage

• $ per GB

The World Has ChangedThe World Has ChangedWeb serving applications need:

◦Scalability! Preferably elastic

◦Flexible schemas◦Geographic distribution◦High availability◦Reliable storage

Web serving applications can do without:◦Complicated queries◦Strong transactions

SQL Server 2008SQL Server 2008

SQL Server 2008SQL Server 2008

Enterprise Data PlatformEnterprise Data PlatformPolicy-Based Management

◦Management of multiple SQL Server instances from a single location.

◦Create policies that control security, database options, object naming conventions, and other settings at a highly granular level.

Data Collector◦Collect, store, and view performance data

automatically. ◦ It collects disk usage, server activity, and query

statistics data, which it loads in a management data warehouse and performance data can be reviewed in SQL Server Management Studio or by using third-party tools.

Enterprise Data Platform – Cont’Enterprise Data Platform – Cont’

Data compressionResource Governor

◦Allocate resource to high profile applicationsDatabase files encryptionAuditing

DevelopmentDevelopmentMERGE support

◦Allows easy merge of data for Data WarehousesLanguage Integrated Query (LINQ)

◦A .NET Framework version 3.5 feature that provides developers with a common syntax to query any data source from client applications.

◦Using LINQ to SQL or LINQ to Entities, developers can select, insert, update, and delete data that is stored in SQL Server 2008 databases using any .NET programming language

Development – Cont’Development – Cont’Change Data Capture (CDC)

◦Allows you to track changes in the database (insert/update/delete) and store them in a table, for use in Data Warehouses

ADO.NET Entity Framework◦An ORM solution, much like Nhibernate

ADO.NET Data Services ◦A data access infrastructure for Internet

applications by enabling Web applications to expose SQL Server data as a service that can be consumed by client applications in corporate networks and across the Internet.

Non Relational DataNon Relational DataSpatial supportFull text searchLarge user defined typesBetter XML support

Visual Studio Team Visual Studio Team SystemSystem

ExcelExcel

ProjectProject

Operations, QA Operations, QA and Help Deskand Help Desk Non-Microsoft Non-Microsoft

DeveloperDeveloper

Team System Team System Web AccessWeb Access

VSTS ALM SolutionVSTS ALM Solution

Facilitate Team CollaborationFacilitate Team Collaboration

Approachable and intuitive products Tight integration across tools, process and roles Single integrated server for greater

communication and collaboration

Tailored toolsTailored toolsfor each rolefor each role

GreaterGreaterteam productivityteam productivity

Team System ArchitectureTeam System ArchitectureDev Team (Local)

Dev Team (Remote)Business User

Build Server

Version Control Proxy

(Remote)Active Directory

TCP/IPHTTP / S

Win 2003 ServerSQL Server 2005

IIS 6.0

Team Foundation ServerTeam Foundation Server

Process Enacted By ToolingProcess Enacted By Tooling

Choose process when Choose process when creating a new creating a new

projectproject

Process IS important in TFSProcess IS important in TFSTake your process/methodology and use itDoes not need to be heavy processGrab processes from elsewhere

◦Eg: SCRUMEasily Customizable through Process

Templates

Process Templates:Process Templates:

Make the entire system work the way you want it to work:◦Define your (bug, etc) definition, your terms,

your form layout, and workflow◦Create your own process guidance easily◦Create your own look and feel for a collaboration

portal◦Include all of your document templates, other

artifacts◦Include your own roles and security settings◦Include your own reporting

Team Foundation ServerTeam Foundation ServerA single, integrated server for team

collaboration:◦ Team Portal – SharePoint site for team collaboration◦ Change Management – flexible work item tracking

system for requirements, change requests, bugs, issues and other work items

◦ Project Management – manage project resources, timelines and quality

◦ Version Control – robust version control system forall project artifacts, including branching, change sets, and shelving

◦ Build Server – automate team project build, analysis, testing

◦ Reporting – central data warehouse for real-time project metrics and analytics

Team ExplorerTeam ExplorerCommon integrated client to access:

◦Work Items◦Documents◦Reports◦Team Builds◦Source Code Control

Single team view of all project artifactsFully integrated into Visual Studio 2005Available as stand-alone for business

analysts, project managers and other team members

Web AccessWeb AccessBrowser-based

access to◦ Project Dashboard◦ Documents◦ Reports◦ Work Item Tracking◦ Source Code Control

Single team view of all project artifacts

Includes Source Control search capabilities

ASP.NET 2.0 SolutionFree Download!

Some Adoption ScenariosSome Adoption ScenariosReplace Source Control (Replace

SourceSafe)Need to track bugs, etc.Want to have a build server to handle

promotion managementNeed to work towards audit requirementsSupport for distributed teams

Compliance and AuditCompliance and AuditTFS supports this easily:

◦Process Guidance details how you work◦Work Items provide a granular audit trail◦Reports used to supplement this

TFS does all (or most of) the work for you.

Compliance And AuditingCompliance And Auditing

Capturing evidenceCapturing evidencedoes not have to be a does not have to be a

manual process, ...manual process, ...

Compliance And AuditingCompliance And Auditing

……because there is abecause there is acomplete audit trail on allcomplete audit trail on all

the tasks, code, and tests.the tasks, code, and tests.

Integrated Project PortalIntegrated Project PortalCustomizable SharePoint Customizable SharePoint portal for team portal for team collaborationcollaboration

Business RequirementsBusiness Requirements

Business requirements Business requirements captured and managed to captured and managed to enable end-to-end enable end-to-end traceabilitytraceability

Project PlanningProject Planning

Full integration into Full integration into Microsoft Project forMicrosoft Project for

a real-time viewa real-time viewof work itemsof work items

Team ExplorerTeam Explorer

Access work items, projectAccess work items, projectdocuments, reports, buildsdocuments, reports, builds

and source control from one and source control from one locationlocation

Web AccessWeb Access

Access work items, projectAccess work items, projectdocuments, reports, buildsdocuments, reports, builds

and source control any browser!and source control any browser!

Work Item AssociationWork Item Association

Associate work items with eachAssociate work items with eachcheck-in to provide traceability from check-in to provide traceability from

requirements to coderequirements to code

Check-In PoliciesCheck-In Policies

Policies enforced by toolingPolicies enforced by toolingreinforce good development reinforce good development

practicespractices

Managing Work ItemsManaging Work Items

Manage and analyze work items Manage and analyze work items using Microsoft Excelusing Microsoft Excel

Database Change Database Change ManagementManagement

A new offline Database A new offline Database project allows you to work project allows you to work

with your database schema with your database schema offline while full integration offline while full integration

with TFS allows you to with TFS allows you to manage and version these manage and version these

changeschanges

Rename refactoring makes Rename refactoring makes it easy to make changes to it easy to make changes to

your database schemayour database schema

Build And DeploymentBuild And Deployment

Build verification Build verification test results as part test results as part

of the build processof the build process

Who checkedWho checkedin whatin what??

What Requirements Haven’t Been What Requirements Haven’t Been TestedTested??

Tracks progression ofTracks progression ofrequirements’ states from requirements’ states from

untested to passed by successive untested to passed by successive buildbuild

How Far Can We Get In The How Far Can We Get In The Available TimeAvailable Time??

WorkWorkcompletedcompleted

WorkWork planned planned

Where Do We Need To Shift Where Do We Need To Shift ResourcesResources??

Bulge in work in process (i.e. in Bulge in work in process (i.e. in testing) indicates inadequate testing) indicates inadequate

resources or inadequate incoming resources or inadequate incoming qualityquality

Scope CreepScope Creep

““Dark matter” emerging Dark matter” emerging during iterationduring iteration

Planned work is Planned work is squeezed outsqueezed out

How Effective Is Our TeamHow Effective Is Our Team??

Test ratesTest rates(pass, inconclusive, (pass, inconclusive, fail) shown in barsfail) shown in bars

Against code Against code coverage, …coverage, …

code churn, …code churn, …

and active bugsand active bugs

Inadequate Unit TestingInadequate Unit Testing

Falling code coverageFalling code coverage

Fewer passingFewer passingand moreand more

inconclusive testsinconclusive tests

Rising code churnRising code churn

Integration with Project ServerIntegration with Project Server

Project Server 2007 VSTS Connector available on CodePlex

WorkspacesWorkspacesWorkspaces provide Isolated areasA single PC can have many workspacesWorkspaces are a powerful tool with

branching

BranchingBranchingAllows parallel developmentBut for anything that you don't want to

service or patch, labelling is sufficient.  For a release that you do want to service

or patch, branching is the way to go. 

Using merging, you can move changes between branches.

BranchingBranching

Using the TFS APIUsing the TFS APITeam Explorer installs all the DLLs are in

the GAC, but doesn’t registered them for Visual Studio

Can write own desktop clients to do anything you can in Team Explorer or the command line

Other Cool ToolsOther Cool ToolsSVNBridge – Allows SubVersion client to

access TFSConchango’s Scrum Project Guidance PackPersonify Design’s TeamLook Outlook Addin Microsoft Israel’s Team System Outlook AddinTeamPrise Client Suite – TFS access from

Macs, Linux and Eclipse IDE

NB all clients still need a Team Explorer

TFS & VSS DifferencesTFS & VSS DifferencesArchitecture

◦TFS: client/server, VSS: client-sideSecurity

◦Windows/AD vs. VSS based securityReliability

◦VSS database integrity can be compromised◦TFS uses SQL Server

Scalability◦TFS can support up to 2000 user per instance

and data size is limited only by physical media & SQL Server limits ( in the terabytes)

TFS & VSS DifferencesTFS & VSS DifferencesTFS does NOT perform a “get latest” on

checkout◦“get latest” and “check out” are 2 separate ops◦“get latest” is explicit in TFS, controlled by the

user◦Provides a consistent snapshot of code

TFS does NOT add a file until checked in

Migration from VSS to TFSMigration from VSS to TFS

VSSConverter migration toolImports VSS repository into TFSCommand line interfaceCan migrate most VSS repositories easily◦VSS Shared files are copied◦VSS Pinned items are labeled as “PINNED” in TFS

Visual Studio 2008 AdministrationVisual Studio 2008 Administration

Share Point 2007 supportEnable use of a separate Share Point

farm.Support for SQL Named Instances “Longhorn” server support Sync Large Groups (~30,000 or more)Installation on a domain controllerNon-default ports & web sites Simplify installation Upgrade from TFS 2005

Visual Studio 2008 Version Visual Studio 2008 Version ControlControl

Add support for checkin policy overrides to the warehouse (an oversight from V1).

Annotate & Folder Diff Destroy Get Latest On Checkout Workspace improvements Performance & Scale improvements Migration toolkit between TFS and other

systems

Visual Studio 2008 BuildVisual Studio 2008 BuildSupport multi-threaded builds with the new

MSBuild. Continuous IntegrationImproved ability to specify what source,

versions of source, and other build properties.

Improved ability to manage multiple build machines.

Stop and delete builds from within VS. Simplified ability to specify what tests get run

as part of a build. The ability to store build definitions anywhere

in the version control hierarchy

WPFWPF

Why WPF?Why WPF?Windows Presentation Foundation, part of

WinFx, is a completely new presentation framework replacing User, GDI, GDI+, Win32

Competes with HTML, Macromedia Flash, SVG

Give developers the tools to make Office quality applications, but also Flash like websites.

Hello WorldHello WorldC# example

using System;using System.Windows;

namespace AvalonExample { class MyApp { [STAThread] static void Main(){ MessageBox.Show(“Hello World!”);

}

}

}

using System;using System.Windows;

namespace AvalonExample { class MyApp { [STAThread] static void Main(){ MessageBox.Show(“Hello World!”);

}

}

}

Hello WorldHello WorldXAML example

<Page xmlns="http://schemas.microsoft.com/winfx/avalon/2005" xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005">

<TextBlock>Hello World!</TextBlock>

</Page>

<Page xmlns="http://schemas.microsoft.com/winfx/avalon/2005" xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005">

<TextBlock>Hello World!</TextBlock>

</Page>

What Is XAMLWhat Is XAMLXAML = eXtensible Application Markup

LanguageXAML provides a declarative programming

model that allows various objects to be defined:◦Layout controls◦User input Controls◦Shapes (lines, rectangles, ellipses, plus more)◦Media (audio or video files)◦Animations and transformations

Silverlight supports a subset of the original XAML schema created for WPF applications

Application ObjectApplication ObjectApplication object acts as container for

more complex applications◦MainWindow◦Application events like

Startup & Shutdown

Application ObjectApplication Object

public class MyApp : Application{ [STAThread] static void Main(string[] args) { MyApp app = new MyApp(); app.Startup += app.OnApplicationStartup; app.Run(args); }

void OnApplicationStartup(object sender, StartupEventArgs e)

{ Window w = new Window(); w.Title = "Mark says: Hello World!"; w.Show(); }

}

public class MyApp : Application{ [STAThread] static void Main(string[] args) { MyApp app = new MyApp(); app.Startup += app.OnApplicationStartup; app.Run(args); }

void OnApplicationStartup(object sender, StartupEventArgs e)

{ Window w = new Window(); w.Title = "Mark says: Hello World!"; w.Show(); }

}

Content ModelContent ModelWPF offers strong separation of behaviour

(API) and presentationBehaviour (API) consists of

◦Commands, Properties, Events & MethodsPresentation of controls is controlled by

◦Nested content◦Templates

StackPanel exampleStackPanel example<Window x:Class="Demo4.Content.Window1" xmlns="http://schemas.microsoft.com/winfx/avalon/2005" xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" Title="Demo4.Content"> <StackPanel Orientation=“Vertical"> <Button Name="button1">Just text</Button> <Button Name="button2"> <Image Source="banner.jpg" Name="image1" Width="100"/> </Button> <Button Name="button3"> <StackPanel Orientation="Vertical"> <TextBlock>Just text<LineBreak/>The next line</TextBlock> <Image Source="banner.jpg" Name="image1" Width="100"/> </StackPanel> </Button> </StackPanel></Window>

<Window x:Class="Demo4.Content.Window1" xmlns="http://schemas.microsoft.com/winfx/avalon/2005" xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" Title="Demo4.Content"> <StackPanel Orientation=“Vertical"> <Button Name="button1">Just text</Button> <Button Name="button2"> <Image Source="banner.jpg" Name="image1" Width="100"/> </Button> <Button Name="button3"> <StackPanel Orientation="Vertical"> <TextBlock>Just text<LineBreak/>The next line</TextBlock> <Image Source="banner.jpg" Name="image1" Width="100"/> </StackPanel> </Button> </StackPanel></Window>

Grid exampleGrid example<Window x:Class="Demo4.Content.Window1" xmlns="http://schemas.microsoft.com/winfx/avalon/2005" xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" Title="Demo4.Content"> <Grid ShowGridLines="True"> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <TextBlock Grid.Column="0" Grid.Row="0">Top left</TextBlock> <TextBlock Grid.Column="1" Grid.Row="1">Middle</TextBlock> <TextBlock Grid.Column="2" Grid.Row="2">LRight</TextBlock> </Grid></Window>

<Window x:Class="Demo4.Content.Window1" xmlns="http://schemas.microsoft.com/winfx/avalon/2005" xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005" Title="Demo4.Content"> <Grid ShowGridLines="True"> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <TextBlock Grid.Column="0" Grid.Row="0">Top left</TextBlock> <TextBlock Grid.Column="1" Grid.Row="1">Middle</TextBlock> <TextBlock Grid.Column="2" Grid.Row="2">LRight</TextBlock> </Grid></Window>

EventhandlingEventhandlingMost significant feature is ‘Event

Bubbling’ called ‘EventRouting’◦RoutedEventArgs

e.Handled = true;

void innerButton_Click(object sender, RoutedEventArgs e)

{

MessageBox.Show("Hello SDN!");

e.Handled = true;

}

void innerButton_Click(object sender, RoutedEventArgs e)

{

MessageBox.Show("Hello SDN!");

e.Handled = true;

}

Databinding exampleDatabinding example<StackPanel Name="pnlMain"> <TextBlock>Name: </TextBlock> <TextBox Name="txtName" Text="{Binding Path=Name}“/> <TextBlock>City:</TextBlock> <TextBox Name="txtCity" Text="{Binding Path=City}“/> <StackPanel Orientation="Horizontal"> <Button Name="btnPrevious“ Click="btnPrevious_Click">&lt;</Button> <Button Name="btnNext“ Click="btnNext_Click">&gt;</Button> </StackPanel> <ListBox Name="lstCustomers“ IsSynchronizedWithCurrentItem="True“ ItemsSource="{Binding}"/></StackPanel>

<StackPanel Name="pnlMain"> <TextBlock>Name: </TextBlock> <TextBox Name="txtName" Text="{Binding Path=Name}“/> <TextBlock>City:</TextBlock> <TextBox Name="txtCity" Text="{Binding Path=City}“/> <StackPanel Orientation="Horizontal"> <Button Name="btnPrevious“ Click="btnPrevious_Click">&lt;</Button> <Button Name="btnNext“ Click="btnNext_Click">&gt;</Button> </StackPanel> <ListBox Name="lstCustomers“ IsSynchronizedWithCurrentItem="True“ ItemsSource="{Binding}"/></StackPanel>

Silverlight2Silverlight2

IntroductionIntroductionWhat is Silverlight?

◦Browser control capable of displaying objects, shapes controls and media

◦Handles animations and transformations of objects

◦Works with IE, FireFox and Safari◦Works on Windows or Macs◦Applications written using C#, VB.NET,

JavaScript or other languages◦Support for VC-1 (HD), WMV, MP3 and WMA

Silverlight2 FeaturesSilverlight2 FeaturesBuilt-in subset of the CLRSupport for multiple languages including C# and

VB.NETSupport for LINQ30+ built-in controlsAccess distributed services (WCF, SOAP, sockets,

more)Custom stylesCustom control templatesData binding supportMultiple layout control optionsColor, gradient and image brushesMore…

UsesUses

CalendarCalendar<UserControlxmlns:my="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls "x:Class="UserInputControls.Page"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"…<my:Calendar x:Name="cal"IsTodayHighlighted="True"HorizontalAlignment="Left" />…</UserControl>

<UserControlxmlns:my="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls "x:Class="UserInputControls.Page"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"…<my:Calendar x:Name="cal"IsTodayHighlighted="True"HorizontalAlignment="Left" />…</UserControl>

WCFWCF

Windows Communication Windows Communication FoundationFoundation

Unified framework for rapidly building service-oriented applications

WCF Design GoalsWCF Design Goals“The unified programming model for rapidly

building service-oriented applications on the Windows platform”

Unification◦ Unifies today’s distributed technology stacks◦ Composable functionality◦ Appropriate for use on-machine, in the intranet, and

cross the InternetService-Oriented Programming

◦ Service-oriented programming model◦ Maximized developer productivity

Interoperability◦ WS-* interoperability with applications running on

other platforms◦ Interoperability with today’s distributed stacks

Services and ClientsServices and Clients

ClientClient ServiceService

MessageMessage

MessageMessage

EndpointsEndpoints

ClientClient ServiceService

MessageMessageEndpointEndpoint EndpointEndpoint

EndpointEndpoint

WCF ArchitectureWCF Architecture

Address, Binding, ContractAddress, Binding, Contract

ClientClient ServiceService

MessageMessageAABBCC AA BB CC

AA BB CC

AddressAddress BindingBinding ContractContract

((WhereWhere)) ((HowHow)) ((WhatWhat))

WCF Architecture: Messaging WCF Architecture: Messaging RuntimeRuntime

Transport

Encoder

Protocol(s)

Transport

Encoder

Protocol(s)

ClientClientDispatcherDispatcher

ServiceService Contractand

Behaviors

Binding

Address

Service Model Layer

Influences system operation based on incoming and

outgoing messages.Effects of behaviors are local.

Messaging Layer

Moves messages back and forth and adds transfer semantics.

Channels are symmetric.

ServiceServiceCodeCode

Message Inspector

FormatterBehavior

Instancing Behavior

SecurityChannel

TCP Transport

SecurityChannel

TCP Transport

Transaction Behavior

FormatterBehavior

WCF Architecture: Composition & Behaviors

Three Types of ContractsThree Types of ContractsService Contract

◦Defines Operations, Behaviors and Communication Shape

Data Contract◦Defines Schema and Versioning Strategies

Message Contract◦Allows defining application-specific headers and

unwrapped body content

Ways to TalkWays to Talk

One Way: ◦ Datagram-style delivery

Request-Reply◦ Immediate Reply on same logical thread

Duplex◦ Reply “later” and on backchannel (callback-style)

ClientClient ServiceService

One Way

Request-Reply

Duplex (Dual)

Bindings & Binding ElementsBindings & Binding Elements

Transport

IPCMSMQ

Custom

TCP HTTP

ProtocolEncoders

.NETTX

Custom

Security Reliability

Binding

HTTP TXSecurity ReliabilityText

Text

Binary

Custom

Standard BindingsStandard Bindings

Binding InteropSecuritySessionTXDuplex

BasicHttpBinding BP 1.1N, TNNn/a

WSHttpBinding WSM, T, XN, T, RSN, Yesn/a

WSDualHttpBinding WSMRSN, YesYes

WSFederationBinding Federatio

nMN, RSN, YesNo

NetTcpBinding .NETT, MT ,RSN, YesYes

NetNamedPipeBinding .NETTT, NN, YesYes

NetPeerTcpBinding PeerTNNYes

NetMsmqBinding .NETT, M, XNN, YesNo

MsmqIntegrationBinding

MSMQTNN, Yesn/a

N = None | T = Transport | M = Message | B = Both | RS = ReliableSessions

N = None | T = Transport | M = Message | B = Both | RS = Reliable Sessions

Bindings & Behaviors: SecurityBindings & Behaviors: Security

Service

CBA

CBA

Client

ABC

CBA

BeBe

Bindings Insert Claims in Messages

Behaviors Implement

Security Gates

SecuritySecurity Claims based end-to-end security

◦ Secure end-to-end message exchanges◦ Secure access to resources◦ Record resource access requests

X509, Username/Password, Kerberos, SAML, custom credentials

Message security◦ Confidentiality and integrity◦ Transport or message level

Access to resources◦ Authentication and authorization

Bindings & Behaviors: Bindings & Behaviors: TransactionsTransactions

Service

CBA

CBA

Client

ABC

CBA

BeBe

Bindings Flow Transactions

Behaviors AutoEnlist and AutoComplete

Service

CBA

CBA

Client

ABC

CBA

Bindings provide

Session and Guarantees

Bindings & Behaviors: Reliable Bindings & Behaviors: Reliable SessionsSessions

Reliability and TransactionsReliability and Transactions

End-to-end Reliable messaging◦In-order guarantees◦Exactly once guarantees

Transport-Independent Sessions◦Integration with ASP.NET Sessions in IIS-Hosted

compatibility modeTransactions

◦Guaranteed atomic success or failure across services

Recommended