1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT [email protected] .

34
1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT [email protected] http://www.reflectionit.nl
  • date post

    19-Dec-2015
  • Category

    Documents

  • view

    224
  • download

    0

Transcript of 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT [email protected] .

Page 1: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

1

Visual Studio 2008

Fons Sonnemans (Trainer)Reflection IT

[email protected] http://www.reflectionit.nl

Page 2: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

2

Agenda

Multitargetting Occasionally connected SystemsOffice ApplicationsClient ApplicationsWindows Communication FoundationASP.NET Web ApplicationsC# 3.0 and LINQ

Page 3: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

3

Release History

Page 4: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

4

Multitargetting

No longer a hard link between Visual Studio and the application’s target framework

VS VS 20082008

Page 5: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

5

ConnectedSingle data sourceDatabase drivenHard codedMonolithic & rigid

Occasionally connectedMultiple data sourcesInformation basedModel drivenSOA

Sync Framework & Services

Page 6: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

6

ADO.NET Sync Services

Client AppClient App

SyncSyncServicesServices

No active connection to the database requiredData is persisted using SQL Server Everywhere EditionLocal Change Tracking for Sending Updates When ConnectedVS2008 Developer Productivity

“Pay to Play”, RAD Component Architecture Leveraging Developers ADO.NET KnowledgeAuto Creation of Database and Table Schema

SQL Server SQL Server EverywhereEverywhere

EditionEditionSQL Server SQL Server

Page 7: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

7

{ ADO.NET Sync Services }

Page 8: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

8

Office Applications (VSTO)

Page 9: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

9

Ribbon CustomizationNew Look and Feel for Office UI

Replaces Command Bars in “the big 5” Office appsVSTO Ribbon Designer

Tab GroupControl

Ribb

on

Page 10: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

10

Custom Task & Actions Panes

VSTO simplifies and speeds up task pane UI design process with visual designers and .NET hookup

Actions PaneMore robust, easier to program alternative to Office’s built-in “Smart Document” technology

Custom Task PaneThe same general idea as Actions Pane, only on the application add-in level, not individual doc

Page 11: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

11

Outlook Form Region FeaturesNew technology in Outlook 2007 for

enhancing and replacing Outlook’s built-in formsCode behind form region is implemented as COM add-inNew controls provide built-in look & feel and data binding to Outlook data

Page 12: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

12

{ Office Applications }

Page 13: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

13

Client Applications

Page 14: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

14

{ WPF Support in VS2008 }

Page 15: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

15

WF and WCF

Page 16: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

16

ASP.NET Web Applications

Page 17: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

17

{ WCF Support in VS2008, ASP.NET Applications }

Page 18: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

18

VB9

Language Features in VS 2008Most are LINQ enablers

C# 3

Collection Initialisers

Partial Methods

Automatic PropertiesExtension Methods

Object Initialisers

Anonymous Types

Local Type Inference

Lambda expressions

If Ternary Operator

Nullable Syntax

Lambda statements

Page 19: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

19

C# 3.0: Local Variable Type InferenceLocal 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;}

Page 20: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

20

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; } }}

Point a = new Point { X = 0, Y = 1 };

Point a = new Point();a.X = 0;a.Y = 1;

Field or property assignments

Page 21: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

21

C# 3.0: Anonymous Types

• Different anonymous object initializers that define properties with same names in the same order generate the same anonymous type

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; }}

Page 22: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

22

C# 3.0: Extension MethodsExtend 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

dt.IsWeekend()

MyStuff.Util.IsWeekend(dt)DateTime dt = DateTime.Today;bool b = dt.IsWeekend();

Page 23: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

23

C# 3.0: Lambda Expressionsdelegate string SomeDelegate(string s);

private static string TestMethod1(string s) { return s.ToUpper();}...SomeDelegate d1 = new SomeDelegate(TestMethod1);string a = d1("abcde");

SomeDelegate d3 = delegate(string s) { return s.ToUpper();};string a = d3("abcde");

SomeDelegate d4 = s => s.ToUpper();string a = d4("abcde");

SomeDelegate d2 = TestMethod1;string a = d2("abcde");

Delegate Inference

Anonymous Method

Lambda Expression

OO Function- Pointer

C# 1.x

C# 2.0

C# 2.0

C# 3.0

Page 24: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

24

{ C# 3.0 }

Page 25: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

25

Language INtegrated Query?

Lots of code written today in order to loop, filter, sort, group, etc.

Why not build better support for this?

sortsort

looploop sumsum

Page 26: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

26

Why Have LINQ?

Access to common data like XML or SQL is harder than accessing in memory objects;

Why not have better API’s than this?

hopehope!!

prapray!y!

hopehope!!

Page 27: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

27

Language Integrated Queryfrom data in someDataSourcejoin otherData in someOtherSource on keyExpr equals keyExpr (into itemName)?let someVariable = someExpressionwhere somePredicateorderby (expression (ascending | descending)?)*select expressiongroup expression by keyExpression into itemName

.NET Framework V3.5.NET Framework V3.5

Language Features ( C# V3 and VB V9 )Language Features ( C# V3 and VB V9 )

CustoCustomm

ObjectsObjects XMLXML SQLSQL

Page 28: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

28

How Does LINQ Work?

Compiler rewrites as method calls

No need to implement Select() etc. if myData is either

IEnumerableIEnumerable IQueryableIQueryable

Implementations already present in the .NET Framework for those cases

Page 29: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

29

IEnumerable & IQueryable?IEnumerable – query is executed in memory

Execute Execute

where select

whereselect

Parse & Execute

IQueryable – query is parsed then translated to SQL and finally executed on to the database

Page 30: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

30

LINQ to SQLfrom c in db.Customerswhere c.City == "London"select c.CompanyName;

IQueryable<IQueryable<T>T>

SELECT CompanyNameFROM CustomerWHERE City = 'London'

SQL Query or SProcSQL Query or SProc ResultsetResultset

ObjectsObjects

db.Customers.InsertOnSubmit(c1);

c2.City = "Asten";

db.Customers.DeleteOnSubmit(c3);

SubmitChanges()SubmitChanges()

INSERT INTO Customer …UPDATE Customer …DELETE FROM Customer …

DML or SProcsDML or SProcs

ApplicationApplication

SQL Server

LINQ to SQLLINQ to SQL

Page 31: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

31

{ LINQ to Objects, LINQ to SQL }

Page 32: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

32

Summary

Visual Studio 2008Great for Windows Vista DevelopmentGreat for Client DevelopmentGreat for Web DevelopmentGreat for Database Applications DevelopmentGreat for .NET Framework v3.5

Service Pack 1 will add even more features

ADO.NET Entity FrameworkADO.NET Data ServicesASP.NET Dynamic Data

Page 33: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

33

Resources

http://msdn.microsoft.com/en-us/vstudio http://msdn.microsoft.com/en-us/sync http://msdn.microsoft.com/en-us/officehttp://windowsclient.net http://netfx3.com/content/WCFHome.aspxhttp://www.asp.nethttp://msdn.microsoft.com/en-us/vcsharphttp://www.datadeveloper.net

Visual Studio 2008 Upgrade Traininghttp://www.reflectionit.nl/Training/default.aspx#orcas

Page 34: 1 Visual Studio 2008 Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl .

34

Questions

mailto:[email protected] http://www.reflectionit.nl

http://www.objectmap.nl