Joel's SharePoint Architect Blog

SharePoint 2013 Training, Architecture, Administration and Development

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

Posts Tagged ‘TechEd 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*

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

Making Phones Ring with One Line of Code – Tim Stevens

Wed, 14 Nov 2007 13:54:27 GMT

Tim Stevens

BT Web21C

Web 21 C from British Telecom is an interesting entity. As you can see from http://web21c.bt.com, they’ve been busy building Web 2.0 telephony technology.

What is It?

The package is a services plus services offering: they host the telephony infrastructure to perform conference calling, SMS messaging, hooking phones together, and they also host web services you can invoke to make it happen.

In fact, BT is touting this service as “Make Phones Ring with One Line of Code.”

Platform

The developer client libraries target .NET, Java, PHP and a bundle of others. Additionally you can have access to the raw SOAP services if you can role your own WS-*.

The .NET side requires a few other things to be installed to work, which brings me to the point of this blog entry.

Making Phones Ring…

This bit works. You can write very simple code to start hooking phones together. If you want to implement a Web 2.0, call-me-back, call-centre type scenario, then it’s a very simple matter of invoking an API method and supplying it with a couple of phone numbers. Both phones ring, and when they pick up, the Carbon Units at the end of the phone lines are able to talk to each other. Also, SMS and conference calling all works a treat.

…with One Line of Code

This is where the promise falls down.

Yes, I can hook my stuff together with 1 line of code. Procedural code, that is.

The sales pitch makes no mention of how much declarative code you have to write. Yes, I count configuration as declarative code. So… How far away from “one line” of code are we?

  1. Register your new application with BT – i.e. submit a web for tell them that you want to use their service (OK, at some point you’ve got to pay per click, so this is reasonable)
  2. Step 1 will result in you receiving a new application certificate (.PFX file) – you need to register this on your machine (and possibly your production machines too)
    1. Double click the PFX file
    2. Follow the 4 step wizard
  3. Download the BT SDK
  4. Install the SDK certificates on your dev (and therefore production) machines – there are 3 of them:
    1. cacert.cer – to Trusted Root Certification Authority
    2. btsdkservercert-acorn.cer – to Trusted People
    3. btsdkservercert-oaktree.cer – to Trusted People
  5. Install the BT libraries and reference them in your application
  6. Create a WSE Policy file using the BT SDK – run WSE3PolicyGenerationWizard.exe which comes with the SDK
  7. Configure your application for WSE 3 – apply settings and point WSE at the policy file “wse3policyCache.config) we created in step 5

    Edit app.config like this:

    <configSections>

    <section name=”microsoft.web.services3″ type=”Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ />

    </configSections>

    <microsoft.web.services3>

    <security>

    <x509 storeLocation=”CurrentUser” />

    </security>

    <policy fileName=”wse3policyCache.config” />

    </microsoft.web.services3>

  8. Install Web Service E
    xtensions 3

  9. Now you’re getting ready to write code

Show Me the Code!

So after this 9 step process (more like 20-or-so if you count them properly), you can start writing code properly. The code snatch below is my little wrapper to their API. It shows one tiny part of the API – how to send a text message.

public static string SendSMS(string recipient, string from, string message)

{

MessagingOneWayManager manager = new MessagingOneWayManager();

Message messageObject = manager.SendMessage(“tel:” + recipient, from, message);

// not sure if we actually need this Sleep(), but it’s in the sample!

Thread.Sleep(2000);

// Check the status of the sent message

Collection<MessageDeliveryStatus> statuses =

manager.GetMessageDeliveryStatuses(messageObject.MessageId);

if (statuses.Count > 0)

return statuses[0].MessageStatus.ToString();

else

return “”;

}

Summary

It’s nice, but it’s not really nice. The amount of extra faff you have to do means you can’t just start hitting their web services. BT ran a little competition during TechEd 2007 this week to drum up some developer enthusiasm over this offering. I knocked together a little app to pull all my contacts with mobile phone numbers from Outlook, populate a .NET listview, double click to select, then fill in a form to send a text message to the selected contact. The coding took 15 minutes. The setup took 2 hours to get just right – the supplied SDK help is a little terse.

SMS is obviously a trivial example, and their platform is capable of a lot more. However, here’s how to do it with a random SMS provider I found of the Interweb, 10 seconds ago:

http://www.tmcsms.co.uk/api/SendService.aspx?

method=SendMessage&email=[email]&pwd=[pwd]&recipients=[recipients]

&body=[body]&reference=[reference]&source=[source]&confirm=[confirm]

Now, I have no idea who these guys are, but their API is much better documented and really obvious.

I’m sure the BT offering has a compelling story, but that story isn’t the developer one.

[DISCLOSURE: My app won a prize from BT :)]

Technorati Profile

Technorati Tags: SaaS, TechEd 2007, Telephony