Overview WinFx

Download Report

Transcript Overview WinFx

Overview of
Next-gen technologies
Raimond Brookman
IT Architect
Info Support
[email protected]
http://blogs.infosupport.com/raimondb
5 Pillars of Connected Systems
ASP.NET 2.0
Atlas / WPF
WCF
WWF
Infocard
AD
LINQ
WinFS
2
Agenda
Introduction
Windows Presentation Foundation (WPF)
ASP.NET Atlas
Windows Communication Foundation
(WCF)
Windows Workflow Foundation (WWF)
C# 3.0, LINQ, DLINQ & XLINQ
Q&A
3
Windows Presentation
Foundation
4
User Experience Matters
Consumer Software
HTML
DHTML
WinFX
5
Developer Art
6
Windows Presentation Foundation
BUILD THE APPLICATIONS YOU
ALWAYS DREAMED OF
7
WPF Capabilities
Document Services
User Interface Services
XPS Documents
Application Services
Controls
Databinding
Packaging Services
Deployment Services
Layout
Media Integration Layer
Imaging
Base Services
2D
Audio
XAML
Video
Accessibility
Text
Effects
3D
Animation
Input & Eventing
Composition Engine
Property System
8
WPF: User Interface Services
User Interface Services
Application Services
Controls
Databinding
Deployment Services
Layout
Layout & Databinding
<StackPanel>
<Label>Select A Customer</Label>
<ListBox
Name="myListBox"
Background="HoneyDew"
ItemsSource="{Binding
{StaticResource myDataSource}}"
</ListBox>
</StackPanel>
9
project structure
Window1.xaml.cs
Window1.xaml
Styles.xaml
Contains:
Application logic
Contains:
Principal UI
(controls, layout, etc.)
Contains:
Application “style”
(visual description of
UI elements)
Created by:
Application developer
Created by:
Application developer
or designer
Created by:
Application designer
Design Experience:
By hand or using a
visual tool
Design Experience:
By hand or using a
visual tool
Data model, event names,
element names, etc.
Resource names and
element types.
10
ASP.NET: Future Directions
Developing Rich Web Applications
With “Atlas”
11
ASP.NET “Atlas” Goals
A FRAMEWORK FOR BUILDING RICHER, MORE INTERACTIVE,
MORE PERSONALIZED WEB EXPERIENCES
Increased productivity
Fewer concepts, fewer lines of code
Application and UI building blocks for common scenarios
Easier to author, debug, and maintain
Clean separation of content, style, behavior, and code
Well integrated with design and development tools
Seamlessly integrated application model
Works with ASP.NET pages and server controls
Allows access to ASP.NET-hosted web services and components
Works everywhere – cross-browser, standards based
12
“Atlas” Architecture
“Atlas” Client
ASP.NET “Atlas” Server
“Atlas” HTML
Page
“Atlas”
Service
Proxies
‘Atlas” Client Script
Library
“Atlas” Client
Application
Services
Local Store
“Atlas”-enabled
ASP.NET Pages
(ASMX or WCF)
ASP.NET “Atlas” Server Extensions
Built-in
Controls and Behaviors
Component and UI
Model
ASP.NET-hosted
Web Services
“Atlas”
Server Controls
ASP.NET “Atlas”
Application Services
“Atlas”
Web Services Bridge
Base Class Library
ASP.NET 2.0
Browser
Integration
Script Core
Browser Compatibility
Page Framework
And
Server Controls
ASP.NET
Application
Services
13
Script-Based Type System
Scenario:
Script code can be ad-hoc, unmaintainable, etc.
Solution:
Encapsulate data and logic into classes and
components
Expose intuitive object model
“Atlas” OOP constructs built on top of standard
script constructs and techniques
Namespaces
Classes, Interfaces, and inheritance
Properties, methods, events
Private and public members
Delegates
Enumerations and Flags
14
API Samples
var myArray = new Array(‘abc’, ‘ghi’);
myArray.push(‘jkl’);
myArray.splice(1, 0, ‘def’); var myArray = new Array(‘abc’, ‘ghi’);
myArray.add(‘jkl’);
myArray.insert(1, ‘def’);
var myObject = ...;
var s = ‘’;
for (var name in myObject) { var
var
var value = myObject[name];
for
s += name + ‘ = ‘ +
value + ‘\r\n’;
}
myObject = ...;
s = ‘’;
(var name in myObject) {
var value = myObject[name];
s += String.Format(‘{0} = {1}\r\n’,
name, value, value.length);
}
var myObject = ‘...’;
var sb = new Web.StringBuilder();
for (var name in myObject) {
var value = myObject[name];
sb.append(name);
sb.append(‘ = ‘);
sb.appendLine(value);
}
var s = sb.toString();
15
“Atlas” Networking
Client networking stack layered on XMLHTTP
WebRequest, WebResponse, MethodRequest classes
ASP.NET “Atlas” Web Services Bridge
Access to ASP.NET-hosted and serviced components
ASMX and WCF services, .NET objects, ASP.NET page-level
services
Automatic client proxy generation
<script src=“MyService.asmx/js” />
Integrated with ASP.NET intrinsics
Wire format: Javascript object notation
public class Location {
public Point Coordinates;
public String Name;
}
{ Coordinates : { X: 2.17, Y: 48.51 },
Name :
"Eiffel
Tower" }
16
Introduction to the Windows
Communication Foundation
17
Windows Communication Foundation –
Why?
ASMX
[ with WSE ]
Simple Configuration
Open Standards
Service-Oriented
.NET Remoting
Extensible
Object-Oriented
COM+
Enterprise Services
Attributes
Transactions
Components
MSMQ
System.Messaging
Messages
Reliable
Windows
Communication
Foundation
18
Windows Communication Foundation
The unified programming model for rapidly building serviceoriented applications on the Windows platform
Unification
Unifies today’s distributed technology stacks
Appropriate for use on-machine, cross
machine, and cross Internet
Service
Orientation
• Codifies best practices for building distributed
applications
Integration
Interoperates with applications running on other
platforms
Integrates with our own distributed stacks
19
Clients and Services
Client
Service
Message
20
Endpoints
Client
Service
Message
Endpoint
Endpoint
Endpoint
Endpoint
21
Address, Binding, Contract
Client
Service
Message
C
B
A
A
B
C
A
B
C
A
B
C
Address
Binding
Contract
Where?
How?
What?
Endpoint
22
Creating Endpoints
Client
Service
Message
C
B
A
ClientChannel
A
B
C
A
B
C
A
B
C
ServiceHost
23
Inside Bindings
Binding
HTTP
Transport
Text
Security
RM
TX
Protocol
Encoders
TCP
HTTP
Text
Security
RM
MSMQ
IPC
Binary
TX
.NET
Custom
Custom
Custom
24
Standard Bindings
Session
Transactions
T
T|S
T|S
T|S
T|S
T|S
T|S
X
X
X
X
X
X
X
X
X
X
X
X
X
Streaming
Security
BP 1.1
WS
WS
.NET
.NET
.NET
.NET
Duplex
Interop
BasicHttpBinding
WsHttpBinding
WsDualHttpBinding
NetTcpBinding
NetNamedPipesBinding
NetMsmqBinding
NetPeerTcpBinding
O
O
X
T = Transport Security | S = WS-Security | O = One-Way Only
25
Integration using Bindings
WCF
*
Binding
Binding
Http/WS
Binding
Java
WCF
WS-* Protocols
Http/WS
Binding
WCF
WS-* Protocols Http/WS
WCF
WS-* Protocols
Java
MSMQ Protocol
MSMQ
Binding
WCF
ASMX/WSE3
Binding
MSMQ
WCF
*
Binding
WS-* Protocols Http/WS
ASMX/WSE3
WCF
WS-* Protocols
MSMQ Protocol
MSMQ
Binding
WCF
MSMQ
26
Windows Workflow Foundation
27
Windows Workflow Foundation
The workflow framework & tools for
Microsoft products and partner/customer
ecosystem
Single workflow technology for Windows
Base for Microsoft products and ISV/customer solutions
One technology for human and system workflow scenarios
A framework for building workflow into applications
A framework to build on - not an application or server
Exposed to developers via WinFX
Brings workflow to mainstream .NET development
Transform workflow from niche to mainstream paradigm
Build strong partner & solution ecosystem
28
What Is A Workflow?
A set of activities that coordinate people
and / or software...
Example activities….
EscalateToManager
CheckInventory
…organized into a workflow.
Like a flowchart….
Or a state diagram….
29
Workflow Scenario Spectrum
Human Workflow
Participants: people, roles
Flow style: flexible, dynamic
Data: unstructured, documents
System Workflow
Participants: apps, services
Flow style: prescriptive, protocols
Data: structured, transactional
Information Worker
• Document Review…
Business to Business
• Supply Chain Mgmt…
Line of Business Apps
CRM ERP
• Quote to Cash, Sales Automation…
IT Management
• New Hire Provisioning, Trouble Ticket,…
.NET Developer
• Pageflow, Service Coordination…
Windows Workflow Foundation
30
Workflow And BizTalk Server
BizTalk Server
Accelerators
Desig
n
Tools
Workflow
Orchestration
Messaging
Transformation
Busines
s
Activity
Monitor
And
Admin
Tools
Adapters
Visual Studio Designer
Windows Workflow
Foundation
WinFX
• Premium BPM server
• Distinct server product
• Use in B2B, EAI, BPM scenarios
• Deployable solutions
• Manageability, Scale-out
• Future version will migrate to
Windows Workflow Foundation for
orchestration
• Workflow framework
• Exposed via WinFX
• Broad set of scenarios
• Used to build solutions
• Enables manageability
and scale-out in solutions
• Use for building workflow into
apps or workflow-enabled servers31
Windows Workflow Foundation
Visual Designer
Key Concepts
Workflows are a set of Activities
A Workflow
Workflows run within a Host Process:
any application or server
Developers can build their own Custom
Activity Libraries
An Activity
Components
Base Activity Library: Out-of-box activities
and base for custom activities
Runtime Engine: Workflow execution and
state management
Custom Activity Library
Windows
Workflow Foundation
Base Activity Library
Runtime Engine
Runtime Services: Hosting flexibility and
communication
Visual Designer: Graphical and codebased construction
Runtime Services
Host Process
32
Visual Designer
Design
Debug
33
The .NET Language
C# 3.0 Integrated Query Project
34
Getting productive
Today we program against relational and
hierarchical data using a language that
does not support this natively
Data != Objects
We are busy describing how things need to
get done in stead of what we want
35
C# 3.0 Design Goals
Integrate objects, relational, and XML
Build on foundation laid in C# 1.0 and 2.0
Run on the .NET 2.0 (“Whidbey”) CLR
Remain 100% backwards compatible
36
The LINQ Project
C# 3.0
VB 9.0
Others…
.NET Language Integrated Query
Standard
Query
Operators
DLinq
(ADO.NET)
XLinq
(System.Xml)
<book>
<title/>
<author/>
<year/>
<price/>
</book>
Objects
SQL
WinFS
XML
37
LINQ Style programming
class Contact { … };
List<Contact> contacts = new List<Contacts>();
foreach(Customer c in customers)
{
if(c.State == “WA”)
{
Contact ct = new Contact();
ct.Name = c.Name;
ct.Phone = c.Phone;
contacts.Add(ct);
}
}
var contacts =
from c in customers
where c.State == "WA"
select new { c.Name, c.Phone };
38
Query Expressions
Language integrated query syntax
from id in source
{ from id in source | where condition }
[ orderby ordering, ordering, … ]
select expr | group expr by key
[ into id query ]
39
C# 3.0 Language Innovations
Local variable
type inference
Query
var contacts =
expressions
from c in customers
where c.State == "WA"
select new { c.Name, c.Phone };
Lambda
expressions
var contacts =
customers
.Where(c => c.State == "WA")
.Select(c => new { c.Name, c.Phone });
Extension
methods
Anonymous
types
Object
initializers
40
Standard Query Operators
Restriction
Where
Projection
Select, SelectMany
Ordering
OrderBy, ThenBy
Grouping
GroupBy
Quantifiers
Any, All
Partitioning
Take, Skip, TakeWhile, SkipWhile
Sets
Distinct, Union, Intersect, Except
Elements
First, FirstOrDefault, ElementAt
Aggregation
Count, Sum, Min, Max, Average
Conversion
ToArray, ToList, ToDictionary
Casting
OfType<T>
41
DLinq For Relational Data
Accessing data today
Queries in
SqlConnection c = new SqlConnection(…);
quotes
c.Open();
SqlCommand cmd = new SqlCommand(
@"SELECT c.Name, c.Phone
Loosely bound
arguments
FROM Customers c
WHERE c.City = @p0");
cmd.Parameters.AddWithValue("@p0", "London“);
DataReader dr = c.Execute(cmd);
while (dr.Read()) {
Loosely typed
result sets
string name = dr.GetString(0);
string phone = dr.GetString(1);
DateTime date = dr.GetDateTime(2);
}
dr.Close();
No compile time
checks
42
DLinq For Relational Data
Accessing data with DLinq
public class Customer { … }
public class Northwind: DataContext
{
public Table<Customer> Customers;
…
}
Northwind db = new Northwind(…);
var contacts =
from c in db.Customers
where c.City == "London"
select new { c.Name, c.Phone };
Classes
describe data
Tables are like
collections
Strongly typed
connection
Integrated
query syntax
Strongly typed
results
43
XLinq For XML Data
Programming XML today
Imperative
model
XmlDocument doc = new XmlDocument();
XmlElement contacts = doc.CreateElement("contacts");
Document
foreach (Customer c in customers)
centric
if (c.Country == "USA") {
XmlElement e = doc.CreateElement("contact");
No integrated
XmlElement name = doc.CreateElement("name");
queries
name.InnerText = c.CompanyName;
e.AppendChild(name);
XmlElement phone = doc.CreateElement("phone");
Memory
phone.InnerText = c.Phone;
intensive
e.AppendChild(phone);
<contacts>
<contact>
contacts.AppendChild(e);
<name>Great Lakes Food</name>
}
<phone>(503) 555-7123</phone>
doc.AppendChild(contacts);
</contact>
…
</contacts>
44
XLinq For XML Data
Programming XML with XLinq
XElement contacts = new XElement("contacts",
from c in customers
where c.Country == "USA"
select new XElement("contact",
new XElement("name", c.CompanyName),
new XElement("phone", c.Phone)
)
<contacts>
);
Declarative
model
Element
centric
Integrated
queries
<contact>
<name>Great Lakes Food</name>
<phone>(503) 555-7123</phone>
Smaller and
</contact>
faster
…
</contacts>
45
XLinq For XML Data
Language integrated query for XML
Expressive power of XPath / XQuery
But with C# or VB as programming language
Leverages experience with DOM
Element centric, not document centric
Functional construction
Text nodes are just strings
Simplified XML namespace support
Faster and smaller
46
Benefits Of LINQ
Unified querying of objects, relational, XML
Type checking and IntelliSense for queries
SQL and XQuery-like power in C# and VB
Extensibility model for languages / APIs
Describe What, not how boosts productivity
47
Questions?
48