Download presentation
Presentation is loading. Please wait.
1
Web Service Software Factory MSDN Webcast
Stan Schultes VBNetExpert.com June 21, 2007 The Web Service Software Factory (WSSF, or Service Factory) is a technology toolkit from the Microsoft Patterns & Practices group that focuses on building the server side of a web services infrastructure. WSSF takes advantage of several modules in the Microsoft Enterprise Library 2.0, and uses a software factory model to generate the application from database to service implementation through a set of wizards. WSSF comes in two flavors at the moment - one each for ASMX-based and WCF-based development. This session focuses on the ASMX technology which is in common use today.
2
Stan Schultes Enterprise Architect / Developer
Speaker, Author, Trainer, Mentor Contributing Editor, Visual Studio Magazine Microsoft MVP in Visual Basic Website: Download this slide deck from my Visual Studio 2005 download page
3
Agenda What is the Web Service Software Factory? Why use WSSF
WSSF Architecture, Layers & Relationships Getting Started & Using WSSF Application Development Process Demo – WSSF in Action Major Benefits of WSSF Current Release Status, Project Futures Tips & Tricks, Resources Slides will go quickly – a demo is the best way to get a feel for this awesome technology
4
What is the WSSF? Web Service Software Factory (Service Factory)
Collection of Software Assets That Helps Architects and Developers Efficiently Build Instances of Web Service Endpoints (both ASMX and WCF) Goal: Identify and Document Best Practices in Web Services Development Guidance Automation Packages Integrated collection of tools, patterms, source code, and prescription instructions that guide developers throughout the application development process. Includes: How-to topics (step-by-step instructions that describe how to implement recommended practices) Patterns (documented solutions to common architectural, design, and implementation challenges) Reference Implementations (Global Bank) Guidance Package (extensions to Visual Studio 2005 that automate common development activities)
5
Why Use WSSF? Focus development efforts on business logic
Generates consistent application infrastructure, style and logic Intrinsic separation of data, business logic, & service layers Incorporates common design patterns Eases migration to WCF through architecture, services Services are easily configured and managed Uses Enterprise Library modules WCF: Security & exception shielding mechanisms are built-in Assets can be customized and extended with GAT Patterns: Layered Apps – abstraction of an app into physical layers Service Interface –Services available and messages for interacting with the service Async Service – service calls use Begin/End operations with events Entity Translation – mapping of business objects to message contents & vice versa Repository – decouples business components from data access components Exception Shielding –exception detail is logged internally, sanitizes external exposure to details Transaction Script (Business Actions) – business operations are very granular (one call per operation) Talking points: Enables a process Enhances the relationship between Architects & Developers Infrastructure is created through templates & recipes EL modules: Exceptions, Logging, Data Access, Caching, Security
6
WSSF – Architecture See Aaron Skonnard’s Dec06 MSDN article for a great overview of the layers (p.4) Service Layer: Service Contract – defines operations, but doesn’t include behavior. Define interfaces, message types, and data types. Service Adapter – implements the service contract exposed on a endpoint, adapts the endpoint to the underlying business layer. Business Layer: Business entities – classes that model domain-specific objects, including behavior and state. Business logic – implements the actual business behavior. Business workflows – handle long-running processes, typically implemented in BPM systems such as BizTalk or WF Resource Access Layer: Data access logic – interact with the underlying data store Service Agents – interact with external web services Image from Microsoft Patterns & Practices
7
WSSF – Layers and Relationships
Compare this to the Reference Implementation to see where the components live. Image from Microsoft Patterns & Practices
8
Getting Started with WSSF
Install Visual Studio 2005 any except Express Edition SQL Server 2005 – Express or Developer Editions Install in the Following Order: Enterprise Library v2 (ELv2, Jan06) Guidance Automation Extensions (GAX, Jun06 or Feb07) Guidance Automation Toolkit (GAT, Jun06 or Feb07) Web Service Software Factory (WSSF, Jul06 or Dec06) VB = Jul06 (ASMX only), C# = Dec06 (also includes WCF) Unit testing: need VSTS or nUnit (v2.2.7) SQL Server – be sure to update connection strings for SQL 2005 (defaults to SQL Express) GAT only needed if you’ll be creating your own Guidance Packages GAX Implemented as an add-in to Visual Studio 2005.
9
Using the WSSF Reference Implementation, Hands-on Labs
Guidance Packages: Data Access – create CRUD SPs, business entities, repostories & factories ASMX – build the service interface, messages, & translators to domain entities Customize for your needs with GAT Recipes and Templates: Created/customized by Architects Developers run to automate processes Generates Service Host and Test Client HOL – Coho Winery (follow instructions carefully). Be sure to install with short paths Updated for WCF Originals required much forum support for correct operation. Reorganizes the project – I recommend you don’t RI (& enhanced version) – Global Bank Data access guidance: not O/R mapping, rather helps to reduce effort in DA implementation. Alternatives: CodeSmith, NetTiers Simple data relationships today. More complex coming in future, community.
10
Development Process Create Application from Template
Includes Host, Client Data Access guidance package: Add DB connection Create Business Entities (BEs) from database Create CRUD SPs Create Repositories from BEs ASMX guidance package: Define Data Types Map BEs to Data Types Define Message Types Define and Implement Service Contracts Expose Services Recipes notes: Create Data Types can use existing XML Schemas Expose Service – creates ASMX endpoint CRUD – Create, Read, Update, Delete
11
WSSF in Action Demo: HOL walkthrough (C#)
Scenario: Coho Winery’s wine club Service: membership database update Open StartHere.doc (HOL directory) – show Domain/Information model (p.3) Start menu items Guidance Package Manager Guidance Navigator Code structure walkthrough Generic classes for repositories/factories Reference Implementation, RI-enhanced Fiddler demo, \\localhost.:port
12
WSSF – Major Benefits Improve quality of implementation
Tested and reusable assets, unit testing, examples Increase predictability Best practices, ensures a migration path Enhance productivity Code generation, patterns, infrastructure More flexibility Customizable to your conventions & practices Ease of operation Enterprise Library Configuration Manager Major benefits: Reduce risk – baseline app is created for you Accelerated start – agile Quality – reusable assets Productivity – automation and patterns Adoption – extensible toolkit
13
Project Status & Futures
WSSF is currently “v2” and still at CTP status: VB, ASMX only: Jul06 CTP C#, ASMX & WCF: Dec06 CTP Jul07 “v3” release for VS 2005, Nov07 for Orcas: Themes: Modeling, Customization, Service Agents, Health & Instrumentation ELv2 today, ELv3 future Data Access – to be removed & released later: More complex data (relational) Migration to LINQ (VS Orcas) FW3 support, WF, etc. V3 Themes: Modeling – developer models the logical components of the app & services using designer. Code skeleton is generated from the model, business logic is still provided by the developer. Customization – enhancing the ability to customize the software factory. Service Agents – creating a higher level of abstraction around SAs, better handling of caching, offline awareness, type sharing, instance management, etc. Health & Instrumentation – better support of ws operations, such as the ability to track service levels.
14
WSSF – Tips & Tricks Initial learning curve is steep, payback comes with repeat usage P&P team webcasts & reference implem’s provide a great jumpstart Create a naming convention for classes & methods Wizards are ‘fire once’, then maintain manually BE wizards only create data classes from tables, no O/R mapping Wizards don’t create array/list types (ASMX) Wizards don’t handle parent/child data Handle Nulls in database SPs Output parameters on SPs aren’t handled, use multiple resultsets Delete the VS .suo file to reduce load times (examines all history) Manually add web method description attributes in SC Interface files Create XML output with XmlTextWriter vs. serializing structures Use Fiddler (HTTP proxy) to examine messages Customize guidance, recipes for your needs using GAT Install HOL using short paths
15
Resources Hands-on Lab, Webcast: Reference Implementations:
WSSF – C#, ASMX version from Dec 2006 CTP Service Factory Intro Webcast by Don Smith Reference Implementations: Best Practices Illustrated with Source Code WSSF & community enhanced version by Fidel Hobayan: Software Factories: Occasionally connected smart client (SCSF) Transactional web service (WSSF) Web client (WCSF) Mobile client (MCSF) Clarius Software Factories Toolkit - MSDN Articles (Service Station column by Aaron Skonnard) Web Service Software Factory (Dec. 2006) The Service Factory for WCF (Feb. 2007) Blogs: Don Smith, Pablo Galiano, Hernan de Lahitte
16
Learn More WSSF Overview: WSSF VB Download – ASMX (July 2006):
WSSF VB Download – ASMX (July 2006): WSSF C# Download – ASMX & WCF (Dec 2006): Hands On Labs (ASMX and WCF with C#): WSSF Intro Webcast: WSSF Communities – Service Factory project home: Microsoft Patterns & Practices: Web Services Developer Center: GuidanceAutomation.net
17
Contact Presentation downloads available from
VS 2005 page Web Site:
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.