vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… ·...

34
Mitchell Bosecke, Greg Burlet, David Dietrich, Peter Lorimer, Robin Miller

Transcript of vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… ·...

Page 1: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

MitchellBosecke,GregBurlet,DavidDietrich,PeterLorimer,RobinMiller

Page 2: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

0 Introduction0 ASP.NET0 WebServicesandCommunication0 MicrosoftVisualStudio20100 Mono0 SupportandUsageMetrics

Page 3: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

.NETWhatis.NET?0 FrameworkfordevelopingsoftwareinMicrosoftWindows

0 Largelibrary0 Severallanguagessupported,allowslanguageinteroperability

0 InitialRelease:February,20020 CurrentVersion:.NET4.0

Page 4: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

C#andVB.NETC#0 SyntaxextremelysimilartoJavaandC0 ExtremelycommonlanguageforWindowsdevelopment

VB.NET0 Relativelyeasytolearn0 Friendlyfornon‐developerstouse

Page 5: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

LambdaExpressions0 Greatlyreducetheamountofcodeneeded0 Supportedstartingin.NET3.50 CustomSorting!(a,b)=>a.Length.CompareTo(b.Length);

NothinglikeitinJava,plannedforJDK8,notuntillate2012

Page 6: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

0 Introduction0 ASP.NET0 WebServicesandCommunication0 MicrosoftVisualStudio20100 Mono0 SupportandUsageMetrics

Page 7: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

ASP.NETWhatisit?0 Webapplicationframework0 Supportsdynamicwebsites,webapplications,andwebservices

0 Developercanuseany.NETlanguage

Page 8: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

ASP.NET

Browserrequests

ASP.NET`ile

IIS1passesrequesttoASP.NETengineontheserver

Enginereadsthe`ilelinebylineand

executesthescriptsinthe`ile

ASP.NET`ileisreturnedtobrowserasplainHTML

1IIS–InternetInformationServices

Page 9: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

ASP.NETPros0 CanprograminVB.NET,C#,Delphi.NET,Chrome,etc.0 Canevenusemultiplelanguagesinoneapplication

0 Objectorientedprogrammingapproach0 Supportforwebservices0 VeryeasytouseXMLsupport0 Easymigrationforwindowsdeveloperstoswitchtowebdevelopment

Page 10: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

ASP.NETCons0 Microsoftplatformneededfordeployment0 Notopensource0 Possiblysteeplearningcurve

Page 11: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

ASP.NETASP.NETvs.PHP0 ASP.NETiscompiledwherePHPisscripted0 Roomforbetterperformancewithcompilation

0 UpdatestoASP.NETaremuchmoredrasticthanPHPsomoreeffortisneededtokeepup

0 UseASP.NETifdevelopersalreadyhaveexperiencewithWindows

Page 12: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

0 Introduction0 ASP.NET0 WebServicesandCommunication0 MicrosoftVisualStudio20100 Mono0 SupportandUsageMetrics

Page 13: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

WebServicesandCommunication

0 Manymodernwebapplicationsrequiretheabilitytointerfacewithotherapplications0  SOAP(SimpleObjectAccessProtocol)0 SendscommandstoasingleserverviaPOSTinXMLdocuments

0 Singleendpoint0 REST(RepresentationalStateTransfer)0 Usestheweb'sinfrastructure(likeURLs)tosendcommands

0 Distributableendpoint

Page 14: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

WebServicesandCommunication

0 (WCF)WindowsCommunicationFoundationAPI0  SupportsSOAPnativelyandRESTwithaddonpackage

0 Other3rdpartypackages0 XMLParsing(ex.Chilkat)

0 Canintegrateotherservices0  ex:GoogleMaps0  ex:AmazonStore

Page 15: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

0 Introduction0 ASP.NET0 WebServicesandCommunication0 MicrosoftVisualStudio20100 Mono0 SupportandUsageMetrics

Page 16: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

VisualStudio20100 Microsoft’sSolutiontoDevelopment0  Acollectionofproductsintegratedintooneenvironmentrangingfromdesigntodeployment.

0 DividedintopackagessuchasVisualStudioUltimate,Premium,ProfessionalandExpress.

Page 17: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

DevelopmentMadeEasyVisualStudio2010Pros0 Allowsfordevelopmentinmultiplelanguagesformultipleplatforms.i.e.PC,XBOXandWindows7phone

0 Easyprojectcreationandmanagement.0 EasydesignanddeploymentofASP.NETapplications0  Intellisense‐advancedcodecompletion.0 Easylayoutmanagement0 Greattechnicalsupport.

Page 18: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

MaybeNotThatEasyVisualStudio2010Cons0 Proprietary.0  It’snotcheapeitherrangesfrom$800‐$12000.0 Largeoverheadforsmallprojects.0 Heavyresourceconsumption.

Page 19: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

.NETandVisualStudio0  .NET4SDK‐developmentoptimizedinVisualStudio.0 VisualStudiohassupportforALL.NETlanguagesC#,ASP.NET,VB.NET,etc..

0 Microsoftproductsplaywelltogether.

Page 20: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

0 Introduction0 ASP.NET0 WebServicesandCommunication0 MicrosoftVisualStudio20100 Mono0 SupportandUsageMetrics

Page 21: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

HypotheticalSituation0 Economicrecessionforcesyourcompanytoreducecosts.YoulookintoLinuxbecausenotonlyisitfree,butithasfree,open‐sourcesoftwareleadingtosigni`icantcostreductions.

0 Yourcodebasecontainsvarious.NETapplicationscriticaltoyourbusiness.

0 Yourbusinessemploysdevelopersskilledin.NETandVS.Eitheremploynewdevelopers(costsgoup)orpushcurrentdevelopersoutoftheircomfortzoneleadingtoalearningcurve,initialmistakes(costsgoup)

0 Problem:.NETapplicationsdonotrunintheLinuxenvironment

Page 22: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

Anopensourceimplementationof.NETframework.Asoftwareplatformdesignedtopromoteeasydevelopmentofcross‐platform.NETapplications.

Page 23: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

Options,options,options

Portability Flexibility

0  Developandrun.NETapplicationsonLinux,MicrosoftWindows,MacOSX,BSD,SunSolaris,NintendoWii,SonyPlayStation3,AppleiPhone

0 Monoiscross‐platformitself.Itrunsontheaforementionedplatforms

0 WritecodeinyourfavouriteprogramminglanguagesupportedbyCLR(CommonLanguageRuntime).

0 CodeisinteroperablebetweenCLRlanguages.

Page 24: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

Hassle‐FreeInstallation0 Linux Distributionpackages(apt‐get)ormanualsource‐codecompilation

disclaimer:manualcompilationprobablyisn’thassle­free

0 Windows,OSX,BSD,SolarisAutomatedinstallers

Page 25: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

Compatibility

0 Nowsupportseverythingincludedin.NET4.0except:WindowsPresentationFoundation(WPF),WindowsCommunicationFoundation(WCF),andWindowsForms(WF)

0 ThesefeaturesareprojectedtobecompletedinMono3.0Olive

0 Aswellassupportingmostof.NET4.0features,Monoalsohasit’sownextendedframeworks

Page 26: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

MonoToolsforVisualStudio0 MicrosoftVisualStudiopluginallowsdeveloperstocreate.NETapplicationstodeployonmono‐enabledplatforms.

0 Setseverythingupforyou

Monocaterstowebaswellasdesktopapplications!

Page 27: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

MonofortheWeb

Apache/NginxWebServices/ConsumingDatabaseConnection

Page 28: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

Apache:Mod_Mono0 Mod_MonoisamoduleprovidingASP.NETsupportforthewidelyusedHTTPwebserverApache.

0 Mod_MonopassesASP.NETpagerequeststoexternalprogram,mod­mono­serverwhichhandlestherequestinsteadofapache.

Socket:TCP

hostmultipleindependentapplications

Page 29: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

Results0 Canroutespeci`icURL’stodifferentmod­mono­serverprocessesrunningunderonevirtualmachineExample:testingserverrunsexperimentalcodeapartfromproductioncode.

0 Setspeci`icquotas(CPU,disk,memory)todifferentserverprocesses

0 Mod_MonoCon`igurationTool–automaticallygeneratesconf.d`iletodeployapplicationimmediately

Con:workswellforsimpleapplications.Anythingmorecomplexrequiresextensivecon`igurationtext`iletweaking

Page 30: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

PortingApplicationsbetweenOS

0 WebapplicationseasiertoportthandesktopappsComplicationsmostlyarisewithdataaccess,authentication,andotherOSspeciQiccodeanddatabasemigration(i.e.MicrosoftSQLServer­>PostgreSQL)

MoMa(MonoMigrationAnalyzer)0 Toolthathelpsidentifyplatformspeci`iccalls

*MoMamightfailtoreportmorecomplexproblemsorreportproblemswhicharenotreallyissues.

0  UsefulmethodtoestimatetheeaseofportingyourcodebasetotheMonoframeworkbeforeinvestinglotsoftime.

Page 31: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

0 Introduction0 ASP.NET0 WebServicesandCommunication0 MicrosoftVisualStudio20100 Mono0 SupportandUsageMetrics

Page 32: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

SupportDocumentation• MSDNAPIReference•  OnlineTutorials&CodeSnippets

Community•  Blogs•  Forums/MailingLists•  Askadeveloper

Tracking• MicrosoftConnect:bugreportsandsuggestions•  Changelogs

Page 33: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

StackOver`lowTags

Page 34: vid Dietrich, obin Millerwebdocs.cs.ualberta.ca/~zaiane/courses/cmput410/W11/pres/C410… · ASP.NET ASP.NET vs. PHP 0 ASP.NET is compiled where PHP is scripted 0 Room for better

StackOver`lowTags