21. The Microsoft Web PlatformMicrosoftWebPlatform
VisualStudio
ASP.NET Web
Forms
ADO.NET
SQL Server
Internet Information Services
ASP.NET MVC
Silverlight MsAjax jQuery
WCF
22. Address, Binding & Contract
Caller Service
MessageABC A B C
A B C
Address Binding Contract
(Where) (How) (What)
23. Address
public class Global : HttpApplication
{
void Application_Start(
object sender,
EventArgs e)
{
RouteTable.Routes.Add(
new ServiceRoute(
string.Empty,
new WebServiceHostFactory(),
typeof(SessionPlanerService)));
}
}
28. Extensibility
public class MyBehavior
: WebHttpBehavior
{
}
public class MyClientFormatter
: IClientMessageFormatter
{
}
public class MyDispatchFormatter
: IDispatchMessageFormatter
{
}
public class MyEndpointBehavior
: BehaviorExtensionElement
, IEndpointBehavior
{
}
33. The Microsoft Web PlatformMicrosoftWebPlatform
VisualStudio
ASP.NET Web
Forms
ADO.NET
SQL Server
Internet Information Services
ASP.NET MVC
Silverlight MsAjax jQuery
WCF
36. Uri
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new
{
controller = "Home", // if parameter not in URL
action = "Index", // if parameter not in URL
id = UrlParameter.Optional
} // Parameter defaults
);
}
39. Extensibility
public class MyFilterAttribute
: ActionFilterAttribute
{
public override void OnActionExecuting(
ActionExecutingContext filterContext)
{
// Before...
}
public override void OnActionExecuted(
ActionExecutedContext filterContext)
{
// After...
}
}
40. Extensibility
public class ModelResult<T>
: ActionResult
{
public override void ExecuteResult(
ControllerContext context)
{
var r = context.HttpContext.Response;
r.Write(…);
}
}
46. Extensibility
protected void Application_Start(object sender, EventArgs e)
{
var config =
HttpHostConfiguration.Create().
AddFormatters(new MyFormatter()).
AddMessageHandlers(typeof(MyChannel));
SetMappings();
RouteTable.Routes.MapServiceRoute<MyService>("Contact", config);
}
public void SetMappings()
{
var mappings = new List<UriExtensionMapping>();
mappings.AddMapping("xml", "application/xml");
SetUriExtensionMappings(mappings);
}
47.
48. Summary
• WCF 4.0 WebHTTP
– Released with the .NET Framework.
– Easy to start with REST, if you already have WCF
in the house.
– Advanced goals can be reached,but with high
effort.
– Distance to the Web can be felt.
49. Summary
• ASP.NET MVC
– Version 3.0 released as separate Product.
– Easy to start with REST, if you know any Web-
Platform.
– Advanced goals can be easily reached with small
effort.
– It's the raw Web.
50. Summary
• WCF 4.0 WebAPIHTTP
– Currently a Preview Release.
– Easy to adopt from the WCF perspective.
– Advanced goals can be reached, with less high
effort.
– Still Abstracted from the web.
51. Resources
• WCF 4.0 WebHTTP
– Part of the Platform
• http://www.microsoft.com/downloads/en/details.aspx?FamilyID=0a3
91abd-25c1-4fc0-919f-b21f31ab88b7
– Hotfix for jQuery
• http://wcf.codeplex.com/
• ASP.NET MVC 3.0
– Released Product
• http://www.asp.net/mvc
• WCF Web API
– CTP 4
• http://wcf.codeplex.com/releases/view/64449
Editor's Notes
Ich bin für die Firma devcoach unterwegs.
Devcoach berät und begleitet Kunden in Projekten, entwickelt Software und plant Architekturen, vermittelt Technologiewissen und Praxis-Know-how in Schulungen und Coachings.
Dabei fokussieren wir uns auf drei Themen: Services, Data & Web
Darunter fallen die folgenden Technologien:
Windows Communication Foundation – Microsofts einheitliche Programmier-Schnittstelle für verteilte Systeme
Windows Workflow – Die graphische Implementierung technischer Abläufe
ADO.NET – Die Datenzugriffs-Komponenten des .NET Frameworks
Entity Framework – Microsofts strategische Datenzugriffstechnologie
ASP.NET – Die Web-Anwendungs-Plattform des .NET Frameworks
Silverlight – Das X-Browser-Kompatible Plug-In für Rich-Internet-Applications
Unsere Kunden kommen aus verschiedensten Branchen von der One-Man-Show bis hin zum großen Konzern.
Mein Name ist Daniel Fisher.
Ich bin Mitgründer und Geschäftsführer der Firma devcoach.
Sowie Mitgründer und Vorstand des gemeinnützigen Vereins Just Community e.V..
Dieser ist seit 2005 Veranstalter NRWConf, eines der größten Software-Entwickler-Community-Events in Deutschland.
Ich bin Mitgründer und Leiter der .NET Developer User Group netug-niederrhein im Dreieck Düsseldorf-Wuppertal-Krefeld.
Für meine Aktivitäten in und für die Community bin ich von Microsoft als Community Leader und Insider ausgezeichnet worden.
Ich bin zertifiziert als Microsoft Certified Professional Developer für ASP.NET und Enterprise Applications.
Seit Einigen Jahren bin ich Business Technology Platform Advisor für Microsoft und unterstütze die Teams bei Entscheidungen zu neuen Technologien.
Mein Blog finden Sie unter lennybacon.com und können mir als @lennybacon auf Twitter folgen.