Close

Why Web Service Software Factory?

This blog entry is based on a conversation with Michelle Bustamante at the SoCal Code Camp.  She has announced doing a 15 part series of
web casts on WCF. All the links are on her blog WCF Webcast Series

Michelle has raised an important concern about web service software factory;
Why Web Service software factory? For someone who is skeptical of tools and
believes in the raw power of framework and associated IDE, this is a genuine
point of unease. Why use a fancy new piece of software which creates some
arbitrary code and projects while you can start from scratch in your favorite
IDE and do it all by yourself? What is the architectural and development
advantage of the prior approach?

Web Service
Software factory
is an integrated collection of tools, best practices,
design patterns, sample source code and guidance. Following are the five
key reasons I recommend usage of Web Service Software Factory in the enterprise
development.

  1. Service Orientation Comes Standard
  2. Executable Architectural Guidance
  3. Service Targeted Code Analysis
  4. UI Consoles for Housekeeping Chores
  5. Project Template – Avoid the blank page syndrome

 
1. Service Orientation Comes Standard

The templates generated by WSSF are built with SOA tenants
in mind. The template comes with separate projects and folders dedicated to project
entities such as business logic, resources, data access, service interfaces, data,
fault and service contracts, service host and client for self hosting. This
enforces the SOA design practices such as type separation, having contracts and
interfaces, separate service policy from implementation, keeping boundaries
explicit and schema enforcement. As a result, this becomes a better overall
design resulting in better compatibility and interoperability when the service
is published or modified at a later date.

Figure: Solution interactively creates the business logic and service interfaces.

Figure: The Project Structure after a solution is created.

 

2. Executable Architectural Guidance

In contemporary development, we developers heavily rely on
intellisense. We like IDE’s to do little syntax corrections for us and  press F1 to see a new class’s syntax;
Wouldn’t it be nice if one can see step by step instructions for basic things
like “How to create a Message contract” or for relatively advance things such
as “Decorate type as DataContract”. How about if you can “run a recipe” i.e.
have a built-in macro which would do all the underlying work for you. Sounds
interesting? WSSF provides both the documentation style and executable guidance
for Web Service developers. See it for yourself.

 

Figure: The architecutral guidance in the IDE. Click on the picture to enlarge.

3. Service Targeted Code Analysis

I’m sure you use FxCop as part of your daily continuous
integration process? No? ok, I didn’t hear that. Seriously, what is the better
way to enforce enterprise level coding conventions, security rules et al. Web
Services software factory comes with WCF Semantic code analyzer which uses the
FxCop engine to perform the semantic rules check and provide necessary
recommendations. Using service factory, you can easily create a code analysis
rule that will inspect service contract code and check code compliance with WCF
service model. See chapter 13 of hands on labs for further details.

 

Figure: Showing the code analysis engine. 


4. UI Consoles for Housekeeping Chores

This is your first WCF service and you want to expose it to
the world. What is the first error you get when you run it?

Metadata publishing for this service is currently disabled

Now you have to copy and paste few behavior attribute lines to the web.config.
No big deal but how about if you want to tweak with interop and communication? Would it be easy
if all these are part of a management console? Service factory team heard you.
These and many more attributes are now part of context menus for each and every
project. You can right click on the project and see how you can do general
maintenance tasks by few mouse clicks.

Figure: Context menu for exposing the service

 Figure: The dialog for exposing the meta-data extension and the service interop.

5. Project Template – Avoid the blank page
syndrome

Being an architect you want your development team to follow
an enterprise template for service orientation; They are free to innovate but
within boundaries so no one starts writing their ADO.NET code inside the web
service class file. Makes sense? Now apart from visual studio.NET enterprise
templates, you can do it now with service factory templates to enforce the
coding standards and provide a good starting point for your developers.

 

Figure: Context menu for exposing the project template.

Figure: Template Export Dialog

Like WCF itself, the service factory also greatly helps
developer to stay focused on business logic programming, service versioning,
service, data and message contracts, the core concepts instead of doing the repetitive
tasks and plumbing work. I’m not sure how many would actually buy into it but
for what it’s worth, treating WSSF even as an SOA learning tool would be quite effective.
 

Happy 4th of July; now I’m going out to enjoy
some fireworks.

Share