Taking Control of WCF Jay Hill Patrick Roeper Presentation Goals Take the most common WCF experience and make it better – Leverage OO design principles;

Slides:



Advertisements
Similar presentations
18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
Advertisements

Michael S. Chan xLM Solutions, LLC
video Asian Option 20 periods’ pay-off stock’s up/down determined by mean and volatility u – up price jump d - down price jump Asian Option Pricing.
Futures – Alpha Cloud Deployment and Application Management.
Zoiner Tejada Hershey Technologies. About Zoiner Tejada.
“It’s going to take a month to get a proof of concept going.” “I know VMM, but don’t know how it works with SPF and the Portal” “I know Azure, but.
Corporate Context: A SOA & BPM Alliance Via Business Data Management Amir Bahmanyari Architect.
A DAPT IST Replication Framework: Progress Report Vance Maverick University of Bologna Dec. 11, 2003.
1 Introduction to SOA. 2 The Service-Oriented Enterprise eXtensible Markup Language (XML) Web services XML-based technologies for messaging, service description,
MC365 Application Servers: Servlets. Today We Will Cover: What a servlet is The HTTPServlet and some of its more important methods How to configure the.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 42 Web Services.
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
Overview Of Microsoft New Technology ENTER. Processing....
Apache Axis: A Set of Java Tools for SOAP Web Services.
B. RAMAMURTHY Web services. Topics What is a web service? From OO to WS WS and the cloud WS code.
A Framework for Smart Proxies and Interceptors in RMI Nuno Santos P. Marques, L. Silva CISUC, University of Coimbra, Portugal
1 © Talend 2014 Service Locator Talend ESB Training 2014 Jan Bernhardt Zsolt Beothy-Elo
Building Offline/Cache Mode Web Apps Using Sync Framework Mike Clark Group Manager Cloud Data Services Team
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
ESB Guidance 2.0 Kevin Gock
© 2013 Cisco System Inc. All rights reserved Cisco Confidential 1 © 2013 Cisco System Inc. All rights reserved. 1 Allow System Distribution Lists to be.
XML Web Services in Visual Studio.NET Peter Ty Developer Evangelist.NET and Developer Group.
EJB Overview Celsina Bignoli Distributed Business Applications Server DB Client DB Server DB.
“This presentation is for informational purposes only and may not be incorporated into a contract or agreement.”
1 3. Implementing Web Services 1.Create SOAP proxy interfaces and WSDL based service descriptions 2.Register/publish services 3.Stores service descriptions.
Brian Noyes Chief Architect IDesign Inc ( Session Code: SOA 305.
Enterprise Java Beans Part I Kyungmin Cho 2001/04/10.
Extending ArcGIS for Server
VBUG Talks in Bristol Coordinators David Ringsell Steve Hallam
Chapter 6 Server-side Programming: Java Servlets
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
AUTHORS: MIKE P. PAPAZOGLOU WILLEM-JAN VAN DEN HEUVEL PRESENTED BY: MARGARETA VAMOS Service oriented architectures: approaches, technologies and research.
Office Business Applications Workshop Defining Business Process and Workflows.
Page 1 © 2001, Epicentric - All Rights Reserved Epicentric Modular Web Services Alan Kropp Web Services Architect WSRP Technical Committee – March 18,
Service Oriented Architecture CCT355H5 Professor Michael Jones Suezan Makkar.
Ready Marjan Nikolovski Father, Dev, CEO/Emit Knowledge Down the rabbit hole Error handling examined try { } // // Blog: emitknowledge.com/research-labs.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Spring Remoting Simplifying.
Windows Role-Based Access Control Longhorn Update
Distribution and components. 2 What is the problem? Enterprise computing is Large scale & complex: It supports large scale and complex organisations Spanning.
Magnus
Server-side Programming The combination of –HTML –JavaScript –DOM is sometimes referred to as Dynamic HTML (DHTML) Web pages that include scripting are.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Spring MVC Essentials Getting started.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Mach II at Macromedia Sean Corfield Director, Architecture An introduction to Mach II and its use on macromedia.com.
04 |Sharing Code Between Windows 8 and Windows Phone 8 in Visual Studio Ben Riga
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
1 Service Oriented Architecture SOA. 2 Service Oriented Architecture (SOA) Definition  SOA is an architecture paradigm that is gaining recently a significant.
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
Modern Development Technologies in SharePoint SHAREPOINT SATURDAY OMAHA APRIL, 2016.
In this session, you will learn to: Understand managed code Create managed database objects Define the Hypertext Transfer Protocol endpoints Implement.
Aaron Corso COSC Spring What is LAMP?  A ‘solution stack’, or package of an OS and software consisting of:  Linux  Apache  MySQL  PHP.
350 parts. i-bank functional structure ▪technical modules – authentication – auditing – user profile – OTP functionality – notifications – push.
The best of WF 4.0 and AppFabric Damir Dobric MVP-Connected System Developer Microsoft Connected System Division Advisor Visual Studio Inner Circle member.
De Rigueur - Adding Process to Your Business Analytics Environment Diane Hatcher, SAS Institute Inc, Cary, NC Falko Schulz, SAS Institute Australia., Brisbane,
Convert generic gUSE Portal into a science gateway Akos Balasko.
Introduction to .NET Florin Olariu
Integrating Enterprise Applications Into SharePoint® Portal Server
Improving searches through community clustering of information
Configuring and Hosting WCF Services
DotNetNuke® Web Application Framework
Partnership.
Inventory of Distributed Computing Concepts
Serverless Architecture in the Cloud
Saravana Kumar CEO/Founder - Kovai Atomic Scope – Product Update.
Introduction to Web Services
Distributed System using Web Services
Introduction to SOA and Web Services
Distributed System using Web Services
06 | SQL Server and the Cloud
Presentation transcript:

Taking Control of WCF Jay Hill Patrick Roeper

Presentation Goals Take the most common WCF experience and make it better – Leverage OO design principles; improve extensibility, maintainability, testability – Reduce repetition Demonstrate techniques when playing role of: – Publisher – Consumer – Publisher and Consumer

Demo Jay is recovering from star-trek-hand syndrome Occasional accidental- reboot while typing

Horizontal API MethodA(ReqA req) { Logger.Log(“Handling ReqA”); try { var result = new ResultA(); result.Name = GetName(req.Id); result. = Get (req.Id); return result; } catch (Exception ex) { Logger.LogError(ex); throw; } MethodB(ReqB req) { Logger.Log(“Handling ReqB”); try { return req.Role == GetRole(req.Id) ? new ResponseB(true) : new ResponseB(false); } catch (Exception ex) { Logger.LogError(ex); throw; } MethodC(ReqC req) { Logger.Log(“Handling ReqC”); try { using(var db = new Ctx()) { return db.Contacts; } catch (Exception ex) { Logger.LogError(ex); throw; } var result = new ResultA(); result.Name = GetName(req.Id); result. = Get (req.Id); return result; return req.Role == GetRole(req.Id) ? new ResponseB(true) : new ResponseB(false); using(var db = new Ctx()) { return db.Contacts; }

Horizontal API var result = new ResultA(); result.Name = GetName(req.Id); result. = Get (req.Id); return result; return req.Role == GetRole(req.Id) ? new ResponseB(true) : new ResponseB(false); using(var db = new Ctx()) { return db.Contacts; } Exception Handling Caching Logging

What we don’t like WCF services have many responsibilities;.svc file makes it hard to modularize operation handling Generated client code is clunky and is a duplication of server-side contracts; easy to get out of sync Client endpoints scale in parallel to server endpoints

Step 1 – Modularizing Operations Move to request/response Re-imagine each operation’s code as a separate class – MessageHandler<> – One-to-One with request Provide a hook into WCF internals that will instantiate and invoke a MessageHandler<> instead of a service instance (.svc) Identify and isolate infrastructural concerns from MessageHandler<> implementations

Demo

Recap Each operation is handled in its own class – Extensible – Maintainable – Testable.svc File Message Handler Invoker

What we don’t like WCF services have many responsibilities;.svc file makes it hard to modularize operation handling Generated client code is clunky and is a duplication of server-side contracts; easy to get out of sync Client endpoints scale in parallel to server endpoints

Step 2 – Deploy an API Goodbye “Add Service Reference” Move service definition and data contract components to a separate assembly Package a client wrapper for invoking a service with the contract assembly Open doors to build integration between products

Demo

Recap Contracts moved to separate assembly and shared with consumers (possibly through build integration) Client API packaged with contracts – DRY – Single LOC invocation – KISS – Hide IDisposable from consumer

Web Host Server Logic Contracts Client App Client Logic Contracts (Build) Shared Contracts Server.slnClient.sln

What we don’t like WCF services have many responsibilities;.svc file makes it hard to modularize operation handling Generated client code is clunky and is a duplication of server-side contracts; easy to get out of sync Client endpoints scale in parallel to server endpoints

Authentication Service Financial Service Search Service Administration Service Authentication Client Financial Client Search Client Administration Client

Step 3 – Create a single gateway Create another service (“Portal”) with a single operation that will process any request Uses the same invoker as all other services to call a MessageHandler for the request Include a client API that will accept any request Add “facilities” under the covers – Compression

Demo

Recap DB Authentication Customer MH 1 MH 3 MH 2 MH 4 … … Portal Byte[] …Request SOA N-Tier

Nitpicker Corner Async Reuse requests for > 1 operations Auditing vs. Tracing Decorator vs. IErrorHandler.Svc exception smell Portal in distributed environment Horizontal APIs enable discoverability