fun with ●net (what is.net anyway?) dr. bernie domanski the city university of new york / csi

28
Fun With Fun With ●NET ●NET (What is .NET anyway?) (What is .NET anyway?) Dr. Bernie Domanski Dr. Bernie Domanski The City University of New York / The City University of New York / CSI CSI

Upload: dale-edwards

Post on 27-Dec-2015

221 views

Category:

Documents


0 download

TRANSCRIPT

Fun WithFun With ●NET●NET

(What is .NET anyway?)(What is .NET anyway?)

Dr. Bernie DomanskiDr. Bernie DomanskiThe City University of New York / The City University of New York /

CSICSI

(c)Domanski, 2002-3. All Rights Reserved 2

Vision StatementVision Statement

.NET affects individuals, businesses, & .NET affects individuals, businesses, & developersdevelopers

IndividualsIndividuals: a more personal integrated : a more personal integrated computing experiencecomputing experience

Businesses & DevelopersBusinesses & Developers: Changes the way : Changes the way software is built & how products are soldsoftware is built & how products are sold

PurposePurpose: to present .NET so YOU can : to present .NET so YOU can evaluate its impact on your organizationevaluate its impact on your organization

(c)Domanski, 2002-3. All Rights Reserved 3

How’d We Get HereHow’d We Get Here

People have been layingPeople have been laying fat pipesfat pipes Bandwidth is a lot less limited than in the Bandwidth is a lot less limited than in the

pastpast Combine with the Combine with the Moore's LawMoore's Law – –

power doubles every 18 months prices are halved

RealReal distributed computing for the first time: distributed computing for the first time: bandwidth is less expensive, so … you can do the processing wherever it is most

optimal.

(c)Domanski, 2002-3. All Rights Reserved 4

ExamplesExamples

Napster – Napster – Rich client talking to a directory service in

the cloud Instant Messaging – Instant Messaging –

Rich client talking to a buddy list in the cloud, and communicates with other rich clients in the network

(c)Domanski, 2002-3. All Rights Reserved 5

How to Make Distributed How to Make Distributed Computing Explode?Computing Explode?

Web servicesWeb services Everything needs to be a Web service. Applies to both pieces of software and resources

in the network like storage. Aggregation and integrationAggregation and integration

aggregate & integrate Web services in very simple easy ways.

Simple and compelling user experiencesSimple and compelling user experiences what some used to call killer applications - that

cannot be ignored.

(c)Domanski, 2002-3. All Rights Reserved 6

Introduction to .NETIntroduction to .NET

StrategyStrategy:: independence from a specific language

or platform. developers can create a .NET application

in any .NET-compatible language. Programmers contribute to the same

software project, writing code in the .NET languages

Visual Basic, Visual C++, C#

(c)Domanski, 2002-3. All Rights Reserved 7

. NET Architecture. NET Architecture

Multiple platforms = Multiple platforms = PortabilityPortability

Web ServicesWeb Services Re-useable building blocks Example: Dollar-Rent-a-Car

(c)Domanski, 2002-3. All Rights Reserved 8

Dollar Rent-A-CarDollar Rent-A-Car

Airline partner wants to Airline partner wants to enable its customersenable its customers to to access Dollars’ reservation system from its own access Dollars’ reservation system from its own websitewebsite

Dollar Dollar allows the airline to access it's databaseallows the airline to access it's database and and make reservationsmake reservations

Provides Provides access via a Palmaccess via a Palm PDA too PDA too Web services enable Web services enable

Communication over the Web, even though the airline uses UNIX and Dollar uses Windows 2000.

By creating a web service as opposed to a By creating a web service as opposed to a customized service specifically for the airline, …customized service specifically for the airline, …

… … Other airlines or hotels can use Dollars’ system Other airlines or hotels can use Dollars’ system without additional workwithout additional work..

(c)Domanski, 2002-3. All Rights Reserved 9

Software Reuse on the Software Reuse on the InternetInternet

.NET programmers concentrate on their own .NET programmers concentrate on their own codecode

Don’t have to implement Don’t have to implement everyevery component of component of every every applicationapplication

They’ll concentrate on their own developmentThey’ll concentrate on their own development Companies will buy Web services for Companies will buy Web services for

db’s, security, authentication, data storage, language translation

(c)Domanski, 2002-3. All Rights Reserved 10

Lets Play a LittleLets Play a Little

Please forgive my Please forgive my typing skills!!typing skills!!

A look at the A look at the development development environment and a environment and a bit of codebit of code

(c)Domanski, 2002-3. All Rights Reserved 11

The Glue: XML and SOAPThe Glue: XML and SOAP

SOAP:SOAP: Simple Object Access Protocol Enables web services to communicate

XMLXML eXtended Markup Language Gives meaning to data

Universal Data AccessUniversal Data Access Data resides centrally as opposed to de-centralized With security, any device could see & edit No complex synchronization of multiple copies

(c)Domanski, 2002-3. All Rights Reserved 12

XMLXML

<?xml version="1.0"><Library> <Book> <Title>Green Eggs and Ham</Title> <Author>Dr. Seuss</Author> </Book> <Book> <Title>Windows Shell Programming</Title> <Author>Scott Seely</Author> </Book> <Picture> <Title>American Gothic</Title> <Artist>Grant Wood</Artist> </Picture></Library>

Matching tags required

(c)Domanski, 2002-3. All Rights Reserved 13

SOAPSOAP

Lightweight protocol for a decentralized, Lightweight protocol for a decentralized, distributed environmentdistributed environment

XML-based with XML-based with 33 parts: parts: Envelope – describes message & how to process

it Rules for expressing application data-types Convention for representing Remote Procedure

Calls and responses

(c)Domanski, 2002-3. All Rights Reserved 14

SOAP Message Embedded in HTTP RequestSOAP Message Embedded in HTTP Request

POST /StockQuote HTTP/1.1Host: www.stockquoteserver.comContent-Type: text/xml; charset="utf-8"Content-Length: nnnnSOAPAction: "Some-URI"

<SOAP-ENV:Envelope  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">   <SOAP-ENV:Body>       <m:GetLastTradePrice xmlns:m="Some-URL">           <symbol>DIS</symbol>       </m:GetLastTradePrice>   </SOAP-ENV:Body></SOAP-ENV:Envelope>

(c)Domanski, 2002-3. All Rights Reserved 15

SOAP Message Embedded in HTTP SOAP Message Embedded in HTTP ResponseResponse

HTTP/1.1 200 OKContent-Type: text/xml; charset="utf-8"Content-Length: nnnn

<SOAP-ENV:Envelope  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>   <SOAP-ENV:Body>       <m:GetLastTradePriceResponse xmlns:m="Some-URL">           <Price>34.5</Price>       </m:GetLastTradePriceResponse>   </SOAP-ENV:Body></SOAP-ENV:Envelope>

(c)Domanski, 2002-3. All Rights Reserved 16

.NET Framework and the .NET Framework and the Common Language Common Language

Runtime Runtime .NET Framework

IBM SUN

COM+/MTS Services

Web Services

Common Language Runtime (CLR) powers .NET Framework. The framework supports Microsoft Legacy enterprise services (COM+ formerly MTS), and also supports Web services, enabling cross-platform integration within and across enterprises.

CLR

(c)Domanski, 2002-3. All Rights Reserved 17

.NET Framework.NET Framework

Manages & executes appl’s & Web servicesManages & executes appl’s & Web services Framework Class LibraryFramework Class Library enforces security enforces security

& other programming capabilities& other programming capabilities analogous to the Java/J2EE class libraries

CLR is the CLR is the Virtual Machine –Virtual Machine – Language- neutral Component-oriented

Modules are Modules are componentscomponents and are packaged and are packaged for execution in DLL’sfor execution in DLL’s

(c)Domanski, 2002-3. All Rights Reserved 18

LanguagesLanguages

VB compilation:VB compilation: VB to MSIL (Microsoft

Intermediate Language)

Contains instructions for CLR

CLR weaves code from all languages together

MSIL to platform-specific machine language

APL Fortran Python Mercury

C# J# RPG VB .NET

COBOL Oberon SchemeVC+

+ .NET

Component Pascal

Oz SmallTalk

Curriculum PascalStandard

ML

Eiffel Perl JScript

(c)Domanski, 2002-3. All Rights Reserved 19

BenefitsBenefits

With .NET Framework installed on a With .NET Framework installed on a platform, that platform can run platform, that platform can run anyany .NET .NET programprogram

Code is Code is written once and executable on any written once and executable on any .NET platform.NET platform -> no porting -> no porting

CLR manages memoryCLR manages memory C++: new and delete -> orphans!

FCL has reusable componentsFCL has reusable components

(c)Domanski, 2002-3. All Rights Reserved 20

What Stays the SameWhat Stays the Same

Individuals will still work with familiar interfacesIndividuals will still work with familiar interfaces Hardware will still run operating systems like Hardware will still run operating systems like

Windows, UNIX, Windows CE, PalmOSWindows, UNIX, Windows CE, PalmOS Developers will still use their preferred languageDevelopers will still use their preferred language Legacy systems do not need to be replaced – newly Legacy systems do not need to be replaced – newly

available Web services :available Web services : Microsoft Host Integration Server - simplified access to

mainframes Microsoft BizTalk™ Server - makes necessary

automated conversions of data to XML. Next generation of distributed computing via .NET Next generation of distributed computing via .NET

builds on the current generationbuilds on the current generation Collaboration / Interoperability / Technology IslandsCollaboration / Interoperability / Technology Islands

(c)Domanski, 2002-3. All Rights Reserved 21

What .NET What .NET Might Mean to BusinessMight Mean to Business

Hope ofHope of easier integration within & between businesses More engaging consumer applications Reduced development time & costs Easier maintenance Empowering employees with data access from

any smart device Exposing information from different departments

as XML, sharing information to create a new application

(c)Domanski, 2002-3. All Rights Reserved 22

Will .NET and Web Services Will .NET and Web Services Find Acceptance in the Find Acceptance in the

Enterprise?Enterprise?

You don’t use Microsoft's stuff? You don’t use Microsoft's stuff? (highly unlikely)(highly unlikely) You probably still need to interoperate with it!You probably still need to interoperate with it! Enables Enables interoperability on the corporate intranetinteroperability on the corporate intranet

UNIX, Windows, mainframe is the norm Enables Enables collaboration across the internetcollaboration across the internet

VPN-like XML exchanges among companies, and .NET Web services standardize transactions using SOAP

XML is the XML is the magic ingredientmagic ingredient describes both procedural interfaces and data formats. describes complexity in a way that machines can process

more accurately

(c)Domanski, 2002-3. All Rights Reserved 23

RealityReality

80-20 Rule80-20 Rule .NET delivers 80% of programming’s best

practices Requires 20% of the knowledge and effort Should help managers as well -

Those who haven't coded in years become comfortable

They may sketch out prototypes using .NET rather than a whiteboard

(c)Domanski, 2002-3. All Rights Reserved 24

.NET vs J2EE ??.NET vs J2EE ??

Portability?Portability? Port to LINUX underway

Cost?Cost? a .NET unit of work will be less than the

equivalent J2EE unit of work Performance?Performance?

existing benchmarks appear to favor the Microsoft platform

(c)Domanski, 2002-3. All Rights Reserved 25

BenchmarksBenchmarks

simple timing comparison simple timing comparison of the double-loop codeof the double-loop code

100,000,000 type double floating point operations (multiply, square root, addition).

compare a very specific compare a very specific type of compute-intensive type of compute-intensive numeric calculation withnumeric calculation with no I/O, No file or network

functionality,

not meant to suggest not meant to suggest overall performanceoverall performance

Useful starting point for Useful starting point for evaluating scientific-evaluating scientific-computation based computation based performance performance

tends to be numeric-compute intensive.

double x1, x2, x3=0;

for (x1=1; x1<=10000; x1++) for(x2=1; x2<=10000; x2++) x3 += Math.Sqrt(x1*x2);

(c)Domanski, 2002-3. All Rights Reserved 26

ResultsResults

C# (.NET Framework SDK) source 6.8 sec

C# (execution versus JIT + execution) source 6.78 vs 7.00 sec

JScript.net (.NET Framework SDK) source 6.8 sec

C (VC++6 Standard) source 10.4 sec

Java (Sun j2se v1.3.1) source 6.8 sec

Java (Sun j2se v1.4.0-rc) source 6.8 sec

Java (Sun MS JVM) source 12.6 sec

JScript (WSH host, uncompiled) source 410 sec

Pentium III 848 MHz, 512 Mb RAM,

OS: Win2000 SP2

(c)Domanski, 2002-3. All Rights Reserved 27

Conclusions and FuturesConclusions and Futures

Could .NET change the way we think of and Could .NET change the way we think of and use computing devices?use computing devices?

TodayToday: server and client: server and client .NET.NET: loosely coupled services on server, : loosely coupled services on server,

PC, handheld, any smart devicePC, handheld, any smart device StrategyStrategy

Componentization Access XML representation of data

(c)Domanski, 2002-3. All Rights Reserved 28

Questions?Questions?

Dr. Bernie DomanskiDr. Bernie Domanski Cell: Cell: 908-415-6105908-415-6105 Email: Email:

[email protected]@optonline.net Website: Website:

http://domanski.cs.csi.cuny.http://domanski.cs.csi.cuny.edu/edu/