Visual Studio 2008

Download Report

Transcript Visual Studio 2008

Visual Studio 2008
Fons Sonnemans (Trainer)
Reflection IT
[email protected]
http://www.reflectionit.nl
1
Agenda
Multitargetting
Occasionally connected Systems
Office Applications
Client Applications
Windows Communication Foundation
ASP.NET Web Applications
C# 3.0 and LINQ
2
Release History
Visual Studio 2008 Sp1
Visual Studio 2008
Visual Studio 2005
Visual Studio .NET 2003
Visual Studio .NET
3
.NET 3.5 Sp1
2008
.NET 3.5
2007
.NET 3.0
2006
.NET 2.0
2005
.NET
1.1
2003
.NE
T
1.0
2002
Multitargetting
No longer a hard link between Visual Studio
and the application’s target framework
.NET Fx 2.0
VS
2008
.NET Fx 3.0
.NET Fx 3.5
4
Sync Framework & Services
Connected
Single data source
Database driven
Hard coded
Monolithic & rigid
5
Occasionally connected
Multiple data sources
Information based
Model driven
SOA
ADO.NET Sync Services
Client App
No active connection to the database
required
Data is persisted using
SQL Server Everywhere Edition
Local Change Tracking for
Sending Updates When Connected
VS2008 Developer Productivity
“Pay to Play”, RAD Component Architecture
Leveraging Developers ADO.NET Knowledge
Auto Creation of Database and Table Schema
SQL Server
Everywhere
Edition
6
Sync
Services
SQL Server
{ ADO.NET Sync Services }
7
Office Applications (VSTO)
Office 2003 & 2007 Support
• Built in to core product
Office 2007 Customisations
•
•
•
•
•
8
Document or Application
Ribbon Designer
Outlook Form Region Designer
Custom Action Panes
ClickOnce Deployment
Ribbon Customization
New Look and Feel for Office UI
Group
Control
Ribbon
Tab
Replaces Command Bars in “the big 5” Office
apps
VSTO Ribbon Designer
9
Custom Task & Actions Panes
VSTO simplifies and speeds up
task pane UI design process
with visual designers and .NET
hookup
Actions Pane
More robust, easier to program
alternative to Office’s built-in “Smart
Document” technology
Custom Task Pane
The same general idea as Actions
Pane, only on the application add-in
level, not individual doc
10
Outlook Form Region Features
New technology in Outlook 2007 for
enhancing and replacing Outlook’s built-in
forms
Code behind form region is implemented
as COM add-in
New controls provide built-in look & feel and
data binding to Outlook data
11
{ Office Applications }
12
Client Applications
Windows Presentation Foundation
• Visual Designer Integrated into Visual Studio
• XBAP deployment to FireFox
• UIElement3D, Viewport2DVisual3D
Windows Forms
•
•
•
•
ClickOnce For FireFox
Consume ASP.NET Provider Services
Better WPF Interoperablity
UAC Manifests
Consume WCF Services in Partial Trust
13
{ WPF Support in VS2008 }
14
WF and WCF
Workflow (WF)
• Integration with WCF
Communication (WCF)
• RESTful support
• Syndication Support
• Partial Trust Support
15
ASP.NET Web Applications
Microsoft AJAX Libraries
IDE Enhancements
• Javascript IntelliSense
• Javascript Debugging
• New HTML Editor
• Shared with Expression Web
• Rich support for CSS
• Split view with better switching performance
• Nested Master Pages
Controls – ListView, DataPager
16
{ WCF Support in VS2008,
ASP.NET Applications }
17
Language Features in VS 2008
Most are LINQ enablers
VB9
C# 3
Anonymous Types
XML Literals
Collection Initialisers
Extension Methods
Relaxed Delegates
Lambda expressions
If Ternary Operator
Nullable Syntax
Object Initialisers
Local Type Inference
Partial Methods
18
Automatic Properties
Lambda statements
C# 3.0: Local Variable Type Inference
Local variable type inference is a feature in
C# 3.0 where you can use the var keyword
instead of explicitly specifying the type of a
variable. The C# 3.0 compiler makes the
type of the variable match the type of the
right side of the assignment.
public void Foo() {
var i = 5;
var s = "Hello";
var d = 1.0;
var z;
// compiler error, no initializer
z = DateTime.Today;
}
19
C# 3.0: Object Initializers
public class Point {
private int x, y;
public int X { get { return x; } set { x = value; } }
public int Y { get { return y; } set { y = value; } }
}
Field or property
assignments
Point a = new Point { X = 0, Y = 1 };
Point a = new Point();
a.X = 0;
a.Y = 1;
20
C# 3.0: Anonymous Types
var emp = new {
Name = "Fons",
Salary = 2000,
DateTime.Today.Year
};
var year = emp.Year;
class XXX {
public string Name { get; set; }
public int Salary { get; set; }
public int Year { get; set; }
}
• Different anonymous object initializers that define
properties with same names in the same order
generate the same anonymous type
21
C# 3.0: Extension Methods
Extend existing types with additional methods.
namespace MyStuff {
public static class Util {
public static bool IsWeekend(this DateTime value) {
return (value.DayOfWeek == DayOfWeek.Sunday ||
value.DayOfWeek == DayOfWeek.Saturday);
}
}
}
using MyStuff;
Brings extensions
into scope
DateTime dt = DateTime.Today;
bool b = dt.IsWeekend();
22
dt.IsWeekend()

MyStuff.Util.IsWeekend(dt)
C# 3.0: Lambda Expressions
delegate string SomeDelegate(string s);
C# 1.x
23
private static string TestMethod1(string s) {
return s.ToUpper();
OO Function}
Pointer
...
SomeDelegate d1 = new SomeDelegate(TestMethod1);
string a = d1("abcde");
C# 2.0
SomeDelegate d2 = TestMethod1;
string a = d2("abcde");
Delegate
Inference
C# 2.0
SomeDelegate d3 = delegate(string s) {
return s.ToUpper();
};
string a = d3("abcde");
Anonymous
Method
C# 3.0
SomeDelegate d4 = s => s.ToUpper();
string a = d4("abcde");
Lambda
Expression
{ C# 3.0 }
24
Language INtegrated Query?
Lots of code written today in order to loop,
filter, sort, group, etc.
sort
loop
Why not build better support for this?
25
sum
Why Have LINQ?
Access to common data like XML or SQL is
harder than accessing in memory objects;
hope!
pray!
hope!
Why not have better API’s than this?
26
Language Integrated Query
from
join
on
let
where
orderby
select
group
into
data in someDataSource
otherData in someOtherSource
keyExpr equals keyExpr (into itemName)?
someVariable = someExpression
somePredicate
(expression (ascending | descending)?)*
expression
Languageexpression
Features ( C#
and VB V9 )
byV3
keyExpression
itemName
.NET Framework V3.5
Objects
27
XML
SQL
Custom
How Does LINQ Work?
Compiler rewrites as method calls
No need to implement Select() etc. if myData is
either
IEnumerable
28
IQueryable
Implementations already present in the .NET
Framework for those cases
IEnumerable & IQueryable?
IEnumerable – query is executed in memory
where
select
Execute
Execute
IQueryable – query is parsed then translated
to SQL and finally executed on to the database
where
select
Parse & Execute
29
LINQ to SQL
from c in db.Customers
where c.City == "London"
select c.CompanyName;
IQueryable<T>
Application
db.Customers.InsertOnSubmit(c1);
c2.City = "Asten";
db.Customers.DeleteOnSubmit(c3);
Objects
SubmitChanges()
LINQ to SQL
SQL Query or SProc
SELECT CompanyName
FROM Customer
WHERE City = 'London'
30
Resultset
SQL Server
DML or SProcs
INSERT INTO Customer …
UPDATE Customer …
DELETE FROM Customer …
{ LINQ to Objects,
LINQ to SQL }
31
Summary
Visual Studio 2008
Great for Windows Vista Development
Great for Client Development
Great for Web Development
Great for Database Applications Development
Great for .NET Framework v3.5
Service Pack 1 will add even more features
ADO.NET Entity Framework
ADO.NET Data Services
ASP.NET Dynamic Data
32
Resources
http://msdn.microsoft.com/en-us/vstudio
http://msdn.microsoft.com/en-us/sync
http://msdn.microsoft.com/en-us/office
http://windowsclient.net
http://netfx3.com/content/WCFHome.aspx
http://www.asp.net
http://msdn.microsoft.com/en-us/vcsharp
http://www.datadeveloper.net
Visual Studio 2008 Upgrade Training
http://www.reflectionit.nl/Training/default.aspx#orcas
33
Questions
mailto:[email protected]
http://www.reflectionit.nl
http://www.objectmap.nl
34