Joel's SharePoint Architect Blog

SharePoint 2010, MOSS & WSS Tips and Consultancy Tales

Subscribe Subscribe  View Joel Jeffery's profile on LinkedIn
joelblogs.co.uk | joelj.co.uk | joeljeffery.co.uk | jfdiphoenix.co.uk

Archive for November, 2007

Fri, 16 Nov 2007 10:30:51 GMT

Christoph Schittko

A good, thorough talk giving advice on when each of these products adds value. Straightforward, so I’ll cut to the chase:

Subtle point – Microsoft presenters keep mentioning how much effort their customers are wasting by hosting things themselves. How clients just don’t want to roll out a whole bunch of servers themselves; they just want the services. I get the feeling we’re being prepped to move towards SaaS and Software plus Services.

BizTalk – When?

  • System to System interactions
  • Long running, short running
  • ACID, Compensating
  • NOT Interactive applications

WF – When?

  • Intra – Application Communication
  • Customised Execution
  • Allowing Power Users to Create (some) Workflows
    • See the Workflow Designer of MOSS – hosts WF
  • NOT Heterogeneous, Multi-Party Processes
  • NOT Enterprise Features – Monitoring, Scale Out

MOSS – When?

  • User / Document Centric Process
  • User Self Service, End-Users, Power Users
  • Human Interaction – Web, Email, Outlook Tasks
  • Collaboration – Lists, Progress Tracking
  • NOT Integration – no orchestration engine, no rules engine, simple activity tracking only

Technorati Profile

Technorati Tags: BizTalk, TechEd 2007, WF

Thu, 15 Nov 2007 18:07:39 GMT

weblogs.asp.net/rhoward

An excellent session from another non-Microsoft presenter. Another one of these brain-the-size-of-a-planet guys who’s career seems to flit in and out of Microsoft. Rob worked at Microsoft on all versions of ASP.NET.

How the pieces fit together

ASP.NET is not just the page model we’re all used to. It’s also a complete request / response framework. You could implement php on it if you were that way inclined.

ISAPI extensions

ASP.NET under IIS6 is simply a single ISAPI extension dll. This means you can use multiple versions of the .NET Framework alongside each other without conflicts; each lives in its own worker process.

Under the ASP.NET wp, it creates the HttpRuntime. The separate wp gives us true independence between apps on the same box. IIS6 has a kernel-level driver called http.sys, and creates a worker process w3wp.exe.

Http.sys introduces a concept called Kernel Mode Caching. This takes page cached items and stores and retrieves it from the IIS level, without drilling into ASP.NET, which gives us a lot more performance.

Role of HttpRuntime

  • Customise and Extend ASP.NET
  • Perform special authentication
  • Take over .jpg extension
  • Provide developrs a great way to innovate

ASP.NET runtime infrastructure
ASP.NET doesn’t care where it’s hosted; that is completely abstracted. HttpContext is created on hitting a page, and is flowed throughout the page lifetime. HttpHaners include all the various extension type: .aspx, .asph, .asmx.

HttpRuntime is the Request / Response infrastructure. It has access to everything you have access to in normal pages, without the Page model.

HttpRuntime can be hosted outside ASP.NET. This means you can process pages and their events outside IIS. Example of this is the Cassini web server. Another possible use would be in a tool that mirrors and flattens web sites to stage as HTML.

Interception Events
Synonymous with ISAPI filters. Can be used for request participation or termination of events etc. Interception Events can be coded with either IHttpModule components or global.asax. You can specify the order of precedence is .config. ISVs writing pluggable components would use Modules. A single project would probably use global.asax. Both provide the same functionality, but Modules are pluggable.

Handler lifecycle
It’s good to get a canonical list of events in the right order. So here they are:

  1. BeginRequest
  2. AuthenticateRequest
  3. AuthorizeRequest
  4. ResolveRequestCache
  5. AcquireRequestState
  6. PreRequstHandlerExecute
  7. Target Handler Extension (e.g. Page /.aspx)
  8. PostRequstHandlerExecute
  9. ReleaseRequestData
  10. UpdateRequestCache
  11. EndRequest

SessionState Tips

  • Turn it off if you don’t need it
  • Set it to read-only if you can
  • Only set it to read-write where you’ll be updating it

HandlerFactory

A tool to help you create different Handlers for different request types.

HttpHandler

Enables processing of Urls. Similar to ISAPI filters.

HttpContext

Encapsulates all request information. One instance created for each request, flowed throughout request lifetime. Developers can extend HttpContext.

Page Lifecycle

For completeness, here is the canonical list of events that fire in the lifetime of a page.

  1. PreInit
  2. Init
  3. InitComplete
  4. PreLoad
  5. Load
  6. Target Control Events
  7. Load Complete
  8. PreRender
  9. SaveStateComplete
  10. Render
  11. Unload

Summary
The presentation was excellent. Some detailed info, some just old hat. The Handler and Module stuff, while not new techniques, are traditionally the domain of the more hardcore ASP.NET developers. The question is why this detail, and why now? Well, my take on this is that there is a feature uplift coming: modularised ASP.NET in IIS7. This will create a whole new space for developers to play and write Modules and Handlers as first class citizens of the IIS pipeline. Microsoft wants us to play in that space, so that means getting folks used to the existing concepts now.

Technorati Profile

Technorati Tags: ASP.NET, TechEd 2007

REST vs SOAP/WS-* – David Chappell

Thu, 15 Nov 2007 17:10:48 GMT

David Chappell

Chappell Associates

 

David gave a presentation in 2002 at TechEd EMEA comparing REST and SOAP. He made a mistake. He didn’t decry SOAP as devil-worship. The result was a mailboxful of hate from the REST clan. RESTaferians, David calls them. He decided that he’d just ignore the hell out of them. Which he did. For a few years.

 

But now…

 

Things are changing. The number of scenarios that REST may be the right choice is increasing.

 

Personal Experience

I first wrote a REST service back in 1998. It was a classic ASP page that took a query string argument that gave me different Xml data back based on that argument. I used this to fill a "data island" in an IE4 Html DOM. It was kind of cool then, but I could see the technique would have limitations. If I wanted to do more than just read data, how would I enforce what these arguments meant? Wasn’t until 1999 / 2000 that SOAP (which originally stood for Simple Object Access Protocol…) started appearing. I knew it was something more bullet-proof that my knocked-up, poxy ASP page.

 

REST and WCF

Using GET verbs, Uri notation

Example GET www.barclays.co.uk/Accounts/2

David compares this to a SOAP version of the same request, complete with <Account>2</Account> nodes in the request and SOAP payload excess baggage.

 

The Principles of REST

Two core principles:

  • Everything is accessed through a uniform interface
  • All data (resources) is identified with a Uri

Some secondary principles:

  • Be stateless
  • Be cacheable where possible

 

RESTful Web Services, by Leonard Richardson and Sam Ruby

 

WCF Access via REST

Here’s the REST equivalent in as a WCF interface:

[ServiceContract]

Interface Iaccount

{

[OperationContract]

[WebGet]

int GetBalance (string account);

 

[OperationContract]

[WebInvoke]

int UpdateBalance(string account, int amount);

}

 

WCF can also support sending binary, RSS, ATOM and JSON over a channel using the WebHttpBinding.

 

The Semantics of Http Verbs

 

A closer look shows that REST has got a few complications.

 

REST typically depends on Http’s verbs

  • Primarily PUT, GET, POST and DELETE

The semantics of GET are well defined

  • Http GET is idempotent… ?

 

However, the other Http verbs are not very well defined. And POST is just a big, undefined, black hole. WCF only supports [WebGet] (using Http GET) and [WebInvoke] (which defaults to POST but can be overridden).

 

Now, David contends that Http GET is idempotent. I take issue with this. Idempotency states that you can invoke an operation multiple times and it does the same thing and it should do this without side effects. Additionally, idempotency implies that each message should get there once and once only. It’s that last point that I don’t think GET can guarantee, thanks to the nature of TCP/IP, the Interweb and replays.

 

SOAP vs REST

 

SOAP

REST

Exposing operations

Exposing data

High barrier to entry

Low barrier to entry

 

RESTful Data Access: Example – Amazon S3

The complete interface to S3 is:

  • GET Object
  • GET Bucket
  • GET Service (your "root directory")
  • PUT Object
  • PUT Bucket
  • DELETE Object
  • DELETE Bucket
  • HEAD Object (modified date etc)

 

Problems with REST

In the banking example, you’ve got GET Account, GET (or POST) UpdateBalance. These are all about a single entity. What are you meant to do with TransferFunds()? This implies two resources, and Uri’s can’t stretch to this. Current practice is to have a Uri that represents the operation:

 

This is potentially a problem for anyone who wants to be religious about REST. Is this against their religion? Exposing an operation as a resource? I’m not sure, neither is David. But I’m not sure it’s important.

 

Bigger Problems

I have bigger issues with REST:

  • Contracts. Can we have one? Please? Not in REST.
  • Security infrastructure: no contracts, so this isn’t defined either.
  • Reliable transmission: no contracts, so this isn’t defined either.
  • Transactions: no contracts, so this isn’t defined either.
  • Policy: no contracts, so this isn’t defined either.
  • BUT…
  • …I still can’t believe HTTP GET is idempotent. At a TCP level, under extreme load conditions, I’ve heard of "ghost" GETs being received multiple times. OK – the mathematical definition of the word idempotent doesn’t include the "exactly one message" refinement, but it’s what the BizTalk guys mean by it, so it’s good enough for me.

 

In practice, to me this means REST is for data and browser-based mash-ups.

 

David argues that REST maybe be best for the Internet, but probably not for the enterprise. Problem is, if we’re moving to S plus S or SaaS, isn’t the enterprise moving to the Internet?

 

Technorati Profile

Technorati Tags: ReST, SOAP, TechEd 2007, Web Services, WS*

Thu, 15 Nov 2007 10:48:36 GMT

David Chappell

Chappell Associates

David presents his outsider’s point of view of Software plus Services. He says Software plus Services is coming, so we’d better get on the bus. Enterprises use a combination of in-house or locally installed software and SaaS (Software as a Service). David argues that both Ss in SaaS really stand for Software.

A current-day example would be Microsoft Exchange. Some run it locally. Some consume it over the Interweb hosted and managed by a third party. Some do both.

Another example is Dynamics CRM. Because it lends itself to the SaaS approach, CRM applications tend to be the leading edge in SaaS. Microsoft also offer Dynamics as a service under the guise of CRM Live.

S plus S in relation to SOA

If SOA applies only to stuff that happens inside the corporate firewall, then it encompasses the on-premises part of S plus S. If SOA applies to services wherever they are, then it applies to all of S plus S.

Mail and CRM are early adopters of the SaaS model.

It is possible that once Cloud Services have got proper traction, SaaS will become the default for new functionality.

Benefits of SaaS

SaaS is fashionable right now, and a lot of consultancy words have been written for and against it. Here are some of the oft touted benefits of SaaS:

  • Lower Costs – no up front license; transactional model; avoid writing stuff again.
  • Faster deployment – or no deployment
  • Less Financial Risk – no up front investment; try before you buy
  • More reliable – someone else’s SLA
  • Easier Upgrades – can be a con: uncontrolled new features

Potential Challenges of SaaS

It’s not all positive though:

  • Vendor trust – outsourcing everything is risky
  • Data safety – are they serving you competitors too?
  • Regulatory and compliance issues
  • Integration – can SaaS apps integrate with my other services?
  • Customisation – can services be customised enough?
  • Identity – supports federation?
  • Management – how can I manage and monitor?
  • Supporting users – someone else’s helpdesk?

Here’s a worry: Benefits accrue to the business users. Challenges accrue to the IT departments. Unfair, unbalanced. But that imbalance therefore almost guarantees this a move to SaaS is going to happen.

Differentiating Users

The marketplace has already started differentiating their users into two distinct groups. Both Microsoft and Google do this. The groups are: business vs consumer. The business versions are almost all pay per user. However, they also solve many of the problems above – or instance where the helpdesk lives.

Multi- vs Single-Tennant

Many providers of SaaS offer solutions that are available on a shared enviroment (with your potential competitors) and also as a single customer per instance model.

Vendor Benefits

SaaS is obviously also beneficial to the vendor. Consider rolling out new versions to a large customer base – frequently under conditions not under your control, versus updating one version of an online app fully under the vendor’s control.

Enterprises and SaaS

If it’s good enough for ISVs, then don’t the benefits also apply to enterprises?

Well, yes. It i
s only a matter of time before enterprise apps are built in The Cloud.

Application Platforms for S plus S

David predicts a battle for dominance in the Cloud space for the SaaS platform. Google, Amazon and Microsoft are all competing here. This is different to programmable applications hosted an accessible over the Internet. Instead, a SaaS platform is a computing platform that has various OS services upon which you can build your apps.

So what happens when OS, database and orchestration moves into the Cloud?

Example Platforms for SaaS

Examples are Amazon EC2; Salesforce.com’s Force.com; Microsoft’s BizTalk Services; Amazon’s S3.

Amazon EC2 – the Elastic Compute Cloud - a service without an SLA, allowing you to host (for pennies) farms of Linux VMs on demand. Without an SLA, this is not a viable platform for an enterprise organisation to use.

Amazon S3 – Simple Storage Service – a service with an SLA. For storing stuff, this is a RESTful service that allows developers to store objects in nested buckets. Once again, for pennies.

Salesforce.com’s Force.com – whilst writing their application, they build themselves a platform on which to run it. They packaged up the platform and turned out outwards, allowing developers to write CRMy applications and add-ins for Salesforce.com – using their own language called Apex. The smart business move here is then creating a marketplace for ISVs to sell their wares.

Microsoft Dynamics CRM in the Cloud – developers can write .NET code that hooks into Dynamics events, but it is not a full platform for arbitrary applications. Because Dynamics CRM is the same platform wherever it is hosted, your code can run wherever you host CRM. This is genuinely a platform to run .NET code in Cloud services.

Microsoft Oslo – a set of investments and secret projects in SaaS companies and products to run this next generation of applications.

Microsoft BizTalk Services – offers connectivity between apps in a firewall friendly way. This will soon have workflow. Microsoft is calling this an Internet Service Bus – an ESB in the Cloud. This platform is not yet a commercial offering, but it will be soon. BizTalk services has Service Provider, Workflow, Connectivity and Identity stacks. However, it shares not a single line of code with BizTalk Server.

Summary

I must admit, I’m with David on this one. He says SaaS is coming. I’d agree. Maybe not today, not tomorrow, but soon.

Technorati Profile

Technorati Tags: S+S, Software plus Services, Tech Ed 2007

Build Your Own Software Factory

Thu, 15 Nov 2007 10:19:39 GMT

Don Smith (although I think Jack Greenfield stood in for him)

Product Planner

Microsoft Corporation

 

The book "Software Factories," by Jack Greenfield, Keith Short says Software Factories are:

"…a software product line that configures extensible tools, processes and content… using a software factory template based on a software factory schema… automate the development and maintenance of variants of an archetypical product… assembling and configuring framework-based components"

 

The Software Factory team at Microsoft, makes a more concrete definition:

  • A tool to assemble a specific type of solution according to its domain
  • Runs within Visual Studio
  • Uses models, designers, editors, wizards, etc.
  • Outputs mostly generated solution (product)
  • Also contains: executables, guidance, reusable components

 

Return on Investment

I’ve built a number of software factories over the last decade. From V-Raptor on VB6 and Classic ASP – with my long standing colleague Jon Silver at Step One Technologies back in 1998, through ActivForms for .NET at Cassium Technologies (now NetStore) in 2002, all the way to the Capgemini Development and Architecture Framework (CDAF) with my good colleague Drew Jones in 2005/6.

 

When you build your own, you need to seriously consider at what point it’s more productive to write your application by hand, and from what point it becomes more cost effective to write an engine to write your code for you.

 

If you’re building one from scratch to help deliver software from rules-based and data-driven scenarios, the Microsoft guys estimate that you need to expect development to take 2-3 times longer than building a single product. If you’re expecting a return on investment (ROI), don’t expect economies of scale until you’ve sold more than about 5 instances of your product.

 

Personal Lessons

It seems there is now a groundswell of people doing things this way nowadays. I was never a thought leader back when I started writing these things, and other people who did things this way were few and far between. But the ideas I had were in the right direction.

 

My rule of thumb was "if you were building more than 20 data entry screens, write something to build the CRUD for you."

 

Working with Drew at Capgemini was a great experience. The CDAF took the Software Factory idea and added architecture and software engineering discipline to the mix. Check out my article on MSDN "Real Frameworks in a Service Oriented World". At Cap, I saw around 20 or so projects using CDAF before I left. This is why I’m surprised by the story of the software factory that never got used.

 

The New World

The new Microsoft product set in Visual Studio 2008 gives you everything you need baked in to make your own software factories. In fact, most of this functionality is available already  in the guise of the Web Services, Desktop Client, Web Client and Mobile Software Factories available on Codeplex.com. The new generation makes everything a lot more graphical and intuitive.

 

With the new tooling, it brings these timescales to build your factories right down. By using the supplied Software Factories and changing them, you can massively reduce the barrier to entry.

 

But when would you do this?

 

Mainly, when you’re a Systems Integrator

 

It’s really worth thinking about writing your own software factories when you have:

  • Build multiple product instances
  • Re-use assets from existing products
  • Convey guidance and architecture about their use
  • Increase productivity and product quality
  • Achieve consistency and predictability
  • Require less experienced people to build a product
    • BUT! Never to DUMB DOWN development

 

Here are some pre-requisites for building a software factory:

  • A well-understood, explored domain
  • Tried and tested solution-based assets
    • i.e. RIs, frameworks, class libraries, code templates, architectures & patterns, etc.
  • Required, dedicated skill-sets:
    • Business Domain Experts
    • Technical Domain Experts
    • Factory Platform Experts

 

And here’s some of the kind of things your factory would do for you:

  • Harvest and generalise solution assets, for reusability
  • Automate design/development tasks
  • Generate solution artefacts
  • Model a pattern, process or architecture

 

When to use discretion

When you write a software factory, you need to  write documentation, build tools to help you use it. One of the speakers in this presentation  spoke of having written a fantastic software factory at his previous company, well engineered, slick and lots of moving parts. However,  he went on to fess-up that his organisation hadn’t managed to use their factory even once.

 

This is something of a mystery to me. I’ve always found that the frameworks and the factories I’ve been involved with evolve out of existing projects. When your lead techies get the point of having built a DAL the same way on their 3 last projects or so, they usually come to the conclusion that "if only they’d had a tool, they could have saved a whole load of time."

 

And I guess that’s what the Practices and Patterns guys are saying at Microsoft. Don’t build a factory from scratch. Don’t attempt to build a factory for something you don’t have Subject Matter Experts for.

 

Building your own templates

It’s actually quite easy – even in VS.NET 2005. If you want to include some standard classes or projects into your Guidance Automation Extensions (GAX) recipes, you can write your classes as usual in VS.NET and export them simply using the File -> Export Template functionality. To add them to a GAX recipe, you need to hack some Xml around, which is not a perfect interface to do it, but it’s still usable.

 

When should you use what toolset?

To build an Automated Action, you’ll use the GAX/GAT Recipe with a wizard.

To build Code or Artefact Templates, you’ll use a text templating engine.

To build Project or Solution Templates, you’ll use Visual Studio templates with GAX/GAT Recipes.

To build a Domain Specific Language, you’ll use the DSL Toolkit.

To build Logical Application and System Design, you’ll need Visual Studio Team Edition for Architects, and the SDM Toolkit

 

GAX/GAT available from patterns & practices, and all other tools used are available in the Visual Studio SDK.

 

How do I Kick Off?

In practice, start by building – by hand – your Reference Implementation; this is a working instance of the kind of applications you want to build. From this you can create a Solution Template with a GAT Recipe; the template needs to include all parts of your Reference Implementation. After this you can install your first factory version, then you can start incrementally improving the factory, updating the Reference Implementation and building new applications with each new iteration of the factory.

 

Domain Specific Languages

The Domain Specific Language toolkit is part of the Visual Studio SDK. It gives us a visual design surface. Interestingly, the DSL UI uses a Domain Specific Language itself to build new DSLs.

 

This is uncanny. Every software factory I’ve ever built has eaten its own tail at one point. With forms renderers, it’s usually the design UI that runs out of budget first, so the industry tends to point these engines at their own metadata.

 

The syntax for the DSL code generator looks suspiciously like ASP.NET. Which is no surprise, except that good old CodeSmith (remember that?) also was suspiciously similar to ASP.NET too…

 

Tools to Help 

 

There are some cool tools that will help you out today – some from the community and some from Microsoft. Over the next few versions of VS, many of these features will be baked in to the IDE from the start. Here’s a shortlist of picks that you can start using right now:

 

Software Factories Toolkit - Clarius have an authoring toolkit for building DSLs and software factories. Check it out at http://softwarefactoriestoolkit.net.

 

VSSDK Assist -  A visual toolset of utilities for extending Visual Studio. Available at CodePlex http://www.codeplex.com/vssdkassist

 

DSL Editor PowerToy (DEPT)- specifically for Domain Specific Languages, provides the ability to expose multiple views of a domain each with their own windows. Available at CodePlex http://www.codeplex.com/dept

 

GAX Extension Library  - various utility classes to supplement those already included with the Guidance Automation Extensions (GAX) to Visual Studio 2005. Available at CodePlex http://www.codeplex.com/GEL

 

VS v.Next – Visual Studio codename Rosario will have all the GAX/GAT baked in. It will also come with Code Generation Framework, and DSL Validation Framework.

 

Technorati Profile

Technorati Tags: GAT, Software Architecture, Software Factories, TechEd 2007