MAGAZINE SOFTWARE DEVELOPMENT NETWORK



Vergelijkbare documenten
Firewall van de Speedtouch 789wl volledig uitschakelen?

MyDHL+ Van Non-Corporate naar Corporate

ANGSTSTOORNISSEN EN HYPOCHONDRIE: DIAGNOSTIEK EN BEHANDELING (DUTCH EDITION) FROM BOHN STAFLEU VAN LOGHUM

General info on using shopping carts with Ingenico epayments

2019 SUNEXCHANGE USER GUIDE LAST UPDATED

Settings for the C100BRS4 MAC Address Spoofing with cable Internet.

RECEPTEERKUNDE: PRODUCTZORG EN BEREIDING VAN GENEESMIDDELEN (DUTCH EDITION) FROM BOHN STAFLEU VAN LOGHUM

Handleiding Zuludesk Parent

Activant Prophet 21. Prophet 21 Version 12.0 Upgrade Information

Het beheren van mijn Tungsten Network Portal account NL 1 Manage my Tungsten Network Portal account EN 14

SAMPLE 11 = + 11 = + + Exploring Combinations of Ten + + = = + + = + = = + = = 11. Step Up. Step Ahead

Introductie in flowcharts

De grondbeginselen der Nederlandsche spelling / Regeling der spelling voor het woordenboek der Nederlandsche taal (Dutch Edition)

Handleiding Installatie ADS

B1 Woordkennis: Spelling

Hoe met Windows 8 te verbinden met NDI Remote Office (NDIRO) How to connect With Windows 8 to NDI Remote Office (NDIRO

Installatie instructies

MyDHL+ ProView activeren in MyDHL+

Taco Schallenberg Acorel

ETS 4.1 Beveiliging & ETS app concept

EM7680 Firmware Update by OTA

Puzzle. Fais ft. Afrojack Niveau 3a Song 6 Lesson A Worksheet. a Lees de omschrijvingen. Zet de Engelse woorden in de puzzel.

EM6250 Firmware update V030507

BISL EEN FRAMEWORK VOOR BUSINESS INFORMATIEMANAGEMENT (DUTCH LANGUAGE) (GERMAN EDITION) (DUTCH EDITION) BY REMKO VAN DER POLS, RALPH DONA

Understanding and being understood begins with speaking Dutch

S e v e n P h o t o s f o r O A S E. K r i j n d e K o n i n g

(1) De hoofdfunctie van ons gezelschap is het aanbieden van onderwijs. (2) Ons gezelschap is er om kunsteducatie te verbeteren

HANDBOEK HARTFALEN (DUTCH EDITION) FROM BOHN STAFLEU VAN LOGHUM

Shipment Centre EU Quick Print Client handleiding [NL]

Add the standing fingers to get the tens and multiply the closed fingers to get the units.

Group work to study a new subject.

Vertaling Engels Gedicht / songteksten

Preschool Kindergarten

Intermax backup exclusion files

/ /

CTI SUITE TSP DETAILS

The first line of the input contains an integer $t \in \mathbb{n}$. This is followed by $t$ lines of text. This text consists of:

150 ECG-problemen (Dutch Edition)

FOD VOLKSGEZONDHEID, VEILIGHEID VAN DE VOEDSELKETEN EN LEEFMILIEU 25/2/2016. Biocide CLOSED CIRCUIT

Registratie- en activeringsproces voor de Factuurstatus Service NL 1 Registration and activation process for the Invoice Status Service EN 10

!!!! Wild!Peacock!Omslagdoek!! Vertaling!door!Eerlijke!Wol.!! Het!garen!voor!dit!patroon!is!te!verkrijgen!op! Benodigdheden:!!

Interaction Design for the Semantic Web

Read this story in English. My personal story

1. Voor het installeren wordt geadviseerd een backup te maken van uw database en bestanden.

Appendix A: List of variables with corresponding questionnaire items (in English) used in chapter 2

voltooid tegenwoordige tijd

Engels op Niveau A2 Workshops Woordkennis 1

L.Net s88sd16-n aansluitingen en programmering.

DALISOFT. 33. Configuring DALI ballasts with the TDS20620V2 DALI Tool. Connect the TDS20620V2. Start DALISOFT

LDAP Server on Yeastar MyPBX & tiptel 31xx/32xx series

Hoe te verbinden met NDI Remote Office (NDIRO): Apple OS X How to connect to NDI Remote Office (NDIRO): Apple OS X

Borstkanker: Stichting tegen Kanker (Dutch Edition)

Stars FILE 7 STARS BK 2

EM7680 Firmware Auto-Update for Kodi 17.2

Leeftijdcheck (NL) Age Check (EN)

Registratie- en activeringsproces voor de Factuurstatus Service NL 1 Registration and activation process for the Invoice Status Service EN 11

Een vrouw, een kind en azijn (Dutch Edition)

Luister alsjeblieft naar een opname als je de vragen beantwoordt of speel de stukken zelf!

Archief Voor Kerkelijke Geschiedenis, Inzonderheid Van Nederland, Volume 8... (Romanian Edition)

Cambridge Assessment International Education Cambridge International General Certificate of Secondary Education. Published

open standaard hypertext markup language internetprotocol transmission control protocol internet relay chat office open xml

[BP-ebMS-H-000] Welke versie van Hermes moet er gebruikt worden?

Duurzaam projectmanagement - De nieuwe realiteit van de projectmanager (Dutch Edition)

My Inspiration I got my inspiration from a lamp that I already had made 2 years ago. The lamp is the you can see on the right.

Concept of Feedback. P.S. Gandhi Mechanical Engineering IIT Bombay

What is the advantage of using expression language instead of JSP scriptlets and JSP expressions?

Een vrouw, een kind en azijn (Dutch Edition)

EM4594 Firmware update

MyDHL+ Tarief berekenen

SEO Content. Creditcard aanvragen? Dé beste creditcards vergelijken.

GS1 Data Source. Guide to the management of digital files for data suppliers and recipients

Bijlage 2: Informatie met betrekking tot goede praktijkvoorbeelden in Londen, het Verenigd Koninkrijk en Queensland

Website review kamernet.nl

WEGWIJZER VOOR METHODEN BIJ PROJECTMANAGEMENT (PROJECT MANAGEMENT) (DUTCH EDITION) BY EDWIN BAARDMAN, GERARD BAKKER, JAN VAN BEIJNHEM, FR

Standard Parts Installatie Solid Edge ST3

Tentamen Objectgeorienteerd Programmeren

MyDHL+ Uw accountnummer(s) delen

Tim Akkerman - Head of Mobile

Love & Like FILE 2 LOVE & LIKE BK 2

Cameramanager LSU Installation Guide

Ius Commune Training Programme Amsterdam Masterclass 15 June 2018

Main language Dit is de basiswoordenschat. Deze woorden moeten de leerlingen zowel passief als actief kennen.

How to install and use dictionaries on the ICARUS Illumina HD (E652BK)

Win a meet and greet with Adam Young from the band Owl City!

Lists of words from the books, and feedback from the sessions, are on

Vergaderen in het Engels

Model driven Application Delivery

It s all about the money Group work

beginnen met bloggen (kleine workshop Wordpress)

L.Net s88sd16-n aansluitingen en programmering.

Zo werkt het in de apotheek (Basiswerk AG) (Dutch Edition)

VERPLEEGKUNDIGE INTERVENTIES: VERTALING VAN NURSING INTERVENTIONS CLASSIFICATION (NIC) (DUTCH EDITION) FROM BOHN STAFLEU VAN LOGHUM

Y.S. Lubbers en W. Witvoet

EM7580 Firmware Update by Micro SD card

Disclosure belofte. Ik stel het belang van de patiënt voorop en eerbiedig zijn opvattingen. Doel van de patient staat centraal

A2 Workshops Grammatica Heden

Duurzaam projectmanagement - De nieuwe realiteit van de projectmanager (Dutch Edition)

Comics FILE 4 COMICS BK 2

Transcriptie:

MAGAZINE SOFTWARE DEVELOPMENT NETWORK 19 & 20 OKTOBER A.S. SDN CONFERENCE Papendal, Arnhem SCHRIJF NU IN! IN DIT NUMMER O.A.: Azure.Net Services < HierarchyID in SQL Server 2008 < Introduction to Language Integrated Query with Delphi Prism < Windows Sidebar Gadgets Ontwikkelen met Silverlight 2.0 < Spell Check in SharePoint 2007 < Nummer 102 september 2009 SDN Magazine verschijnt elk kwartaal en is een uitgave van Software Development Network 102 www.sdn.nl

Advertentie Macaw

Colofon Uitgave: Software Development Network Zeventiende jaargang No. 102 september 2009 voorwoord Bestuur van SDN: Remi Caron, voorzitter Rob Suurland, penningmeester Joop Pecht, secretaris Mark Vroom, vice-voorzitter Redactie: Rob Willemsen (rob.willemsen@sdn.nl) Aan dit magazine werd meegewerkt door: Maurice de Beijer, Rolf Craenen, Anko Duizer, Marcel van Kalken, Stefan Kamphuis, Marcel Meijer, Mirjam van Olst, Johan Parent, Joop Pecht, Sandra de Ridder, Maarten van Stam, Bob Swart, Marianne van Wanrooij, Rob Willemsen en natuurlijk alle auteurs! Listings: Zie de website www.sdn.nl voor eventuele source files uit deze uitgave. Vormgeving en opmaak: Reclamebureau Bij Dageraad, Winterswijk www.bijdageraad.nl 2009 Alle rechten voorbehouden. Niets uit deze uitgave mag worden overgenomen op welke wijze dan ook zonder voorafgaande schriftelijke toestemming van SDN. Tenzij anders vermeld zijn artikelen op persoonlijke titel geschreven en verwoorden zij dus niet noodzakelijkerwijs de mening van het bestuur en/of de redactie. Alle in dit magazine genoemde handelsmerken zijn het eigendom van hun respectievelijke eigenaren. Adverteerders Macaw 2 VNU 20 Barnsten/Embarcadero 27 Bergler 28 Microsoft 36-37 Alladdin 41 Sybase ianywhere 45 4DotNet 52 Sogeti 63 Avanade 71 Bridge Incubation Group b.v. 72 De zomereditie van het SDN-magazine ligt voor je: klaar voor gebruik en je hebt vast voldoende tijd om het tot de laatste letter door te nemen. B.v. omdat je vakantie hebt en na het eten lekker in de tuin van het zonnetje zit te genieten of op het strand zit of op je bootje ronddobbert op het strakblauwe water. Of omdat het op kantoor toch een fractie minder druk is dan een jaar geleden en je die tijd goed kunt gebruiken om je kennis weer helemaal up-todate te brengen. In beide gevallen vind je genoeg van je gading om weer helemaal mee te gaan tellen. Er wordt een groot aantal nieuwe versies, functionaliteiten en zelfs talen voorgesteld. Van SQL Server 2008 worden b.v. de nieuwe HierarchyID en de Sparse columns voorgesteld. De Azure.Net Services worden voorgesteld. Hiermee krijg je een omgeving tot je beschikking voor het draaien van applicaties en het opslaan van gegevens in Microsoft data centra, die zich overal ter wereld kunnen bevinden. Je kunt applicaties maken die je daar laat hosten, maar je kunt er ook voor kiezen bestaande applicaties te verrijken met individuele services die en let op, daar komt een modern toverwoord - in de Cloud draaien. Delphi Prism krijgt ook uitgebreid aandacht. Eerst presenteert Bob Swart nieuwe features als Asyncs, Futures & Parallels, waarmee hij maar wil laten zien dat Delphi for.net niet langer achterloopt op het gebied van.net features, maar juist nu al gebruik maakt van functionaliteit die nog niet eens (volledig) beschikbaar is in.net. Een geluid dat ook wel eens gehoord mag worden! En we hebben een artikel van de hand van Cary Jensen waarin hij een introductie van LINQ de Language Integrated Query in Delphi Prism geeft, iets dat we in.net al langer kennen. Nog meer nieuwigheden in een artikel over F#, een nieuwe taal uit de Microsoft-stal. Aardig om te lezen - maar ook wel even wennen! over een functionele taal als tegenhanger voor de imperatieve talen waar de meesten van ons gewend zullen zijn om mee te werken. Overigens gebiedt de eerlijkheid om te zeggen dat F# eigenlijk van beide walletjes snoept En last but not least wil ik nog een artikel uit de User Experience hoek vernoemen dat een onderwerp behandelt waar vast ook nog niet iedereen zijn handen aan gebrand heeft, nl. hoe je Windows Sidebar Gadgets kunt ontwikkelen die met Silverlight 2.0 werken, incl. het uitrollen daarvan. Al met al genoeg nieuws en dan hebben we nog een stuk of 8 (!) artikelen onvernoemd gelaten. Niemand hoeft zich dus te vervelen in de zomer van 2009. Wat je in dit magazine ook terugvindt is de blik op de aankomende SDN Conference die 19 & 20 oktober gehouden wordt op Papendal (Arnhem), tegelijk met de DotNetNuke Open- Force '09 Europe conferentie. Je kunt er in dit magazine haast niet om heen: het programma, voor zover bekend op het moment van drukken, wordt gepresenteerd, maar via talloze postits proberen we het event en de datum in je geheugen te prenten. Want als je dit jaar dan toch wilt gebruiken om weer helemaal up-to-date te geraken, dan moet je naar de SDN Conference 2009 komen natuurlijk! Veel leesplezier! Rob Willemsen, redactie@sdn.nl PS: Wellicht ten overvloede vermeld ik nog even dat we in dit magazine de lijn doortrekken die in de vorige editie- de WIT-special: Women In Technology wel heel expliciet gemaakt is, nl. dat vrouwen ook heel goed in de IT uit de voeten kunnen of liever artikelen van hun hand kunnen laten zien. We presenteren opnieuw een (flink aantal) artikelen van vrouwelijke hand; niet allemaal, zoals vorige keer, maar we hebben toch weer 4 vrouwelijke auteurs die acte de présence geven! Adverteren? Informatie over adverteren en de advertentietarieven kunt u vinden op www.sdn.nl onder de rubriek Magazine. magazine voor software development 3

SDN CONFERENCE 2 DAYS SOFTWARE DEVELOPER CONFERENCE 19 & 20 OKTOBER 2009 PAPENDAL, ARNHEM Inhoud 03 Voorwoord Rob Willemsen 04 Inhoudsopgave 05 Azure.Net Services Jacqueline van der Holst 09 DevTweet Marianne van Wanrooij en Sander Hoogendoorn 10 SDN Conference 14 The WebHub Way of Thinking Ann Lynnworth 21 Silverlight en Open Source Koen Zwikstra 24 HierarchyID in SQL Server 2008 André van t Hoog en Arjan Pot 29 FloraHolland Moderniseert Hart IT Norbert Mimpen 31 Under the Hood: Provider-Based Authorization in DotNetNuke 5.1 Brandon Haynes 34 Delphi Prism: Async, Futures en Parallele Mogelijkheden Bob Swart 38 Spell Check in SharePoint 2007 Gustavo Velez 42 Fun met Webparts in ASP.Net - Deel 2 User Controls en Webparts Bert Dingemans 46 Introduction to Language Integrated Query with Delphi Prism: Part 1 Cary Jensen 49 Interesting Things: Creative Plumbing Sander Hoogendoorn 50 Sparse Columns in SQL Server 2008 Bert Dingemans 53 De Kick Ass Development Reeks Freek Leemhuis en Maarten Metz 57 Agenda 58 ASP.NET onder de Motorkap: Ben jij al AJAX supporter? Michiel van Otegem 59 Requirements Management voor Software Architecten Marion Verwey en Nienke van de Brink 64 F#: Een Functionele Oplossing binnen een Imperatieve Wereld Laurens Ruijtenberg 67 Windows Sidebar Gadgets Ontwikkelen met Silverlight 2.0 Fons Sonnemans

.NET C# Jacqueline van der Holst Azure.Net Services De Microsoft.Net Service Bus en de Microsoft Access Control Service gecombineerd Afgelopen jaar kondigde Ray Ozzie op de Professional Developer Conference het Windows Azure Services Platform aan. Het Azure Services Platform is een omgeving voor het draaien van applicaties en het opslaan van gegevens in Microsoft data centra, die zich overal ter wereld bevinden. Bedrijven kunnen ervoor kiezen om daar nieuwe applicaties te hosten, maar je kan er ook voor kiezen bestaande applicaties te verrijken met individuele services die in de Cloud draaien. Microsoft.Net services bestaan uit een set services voor developers en een SDK om.net applicaties in de Cloud te kunnen draaien. Je kunt aan.net services denken als een nieuw.net framework maar dan specifiek voor dit type applicaties. Dit framework bestaat uit services, die gebaseerd zijn op standaard protocollen, zodat elk service platform erop kan aanhaken. Denk daarbij aan SOAP, REST en WS* technieken. Wanneer je als developer gewend bent om te werken met Windows Workflow Foundation en Windows Communication Foundation, dan zul je het niet moeilijk vinden om met de.net services SDK te werken. Wil je er direct mee aan de slag? Je kunt dan de SDK downloaden van http://www.microsoft.com/azure en een code aanvragen om je eigen solution aan te kunnen maken. Op dit moment bestaan de.net services uit een drietal services voor het regelen van connectiviteit, toegang en workflow, te weten: Microsoft.Net Service Bus: een netwerk infrastructuur voor het verbinden van applicaties over het Internet; Microsoft.Net Access Control Service: op claims gebaseerde toegang waarbij het kan werken met identity providers als Active Directory en Windows Live ID; Microsoft.Net Workflow Service: een infrastructuur voor het managen en hosten van workflows. Dit artikel beschrijft de Microsoft.Net Service Bus in combinatie met de Microsoft.Net Access Control Service. Figuur 1 Om een applicatie in de Cloud te laten draaien moet je een nieuwe Azure solution aanmaken op http://www.microsoft.com/azure. Voor dit artikel heb ik de solution AzureExample aangemaakt (zie figuur 2). Microsoft.Net Service Bus In de praktijk zien we dat het nog steeds een uitdaging is om applicaties met elkaar te verbinden. Om dit mogelijk te maken gebruiken organisaties een Enterprise Service Bus (ESB). De Microsoft.Net Service Bus heeft een gelijkwaardige architectuur. Het verschil zit hem in het blikveld en de probleemstelling. Immers de.net Service Bus moet op een globaal internet niveau kunnen draaien en dat ook nog eens met hoge inzet. Met de Microsoft.Net Service Bus kun je je huidige ESB verbinden met services die in de Cloud draaien, maar je kunt de.net Service Bus ook inzetten om applicaties met elkaar te verbinden die zich op verschillende fysieke locaties achter een firewall bevinden. Architectuur Om beter te kunnen begrijpen hoe de Microsoft.Net Service Bus werkt, is de architectuur ervan te zien in figuur 1. Hieronder worden verschillende onderdelen van de architectuur besproken aan de hand van een listing. Figuur 2 In het voorbeeld gebruiken we een client project en een service project. Listing 1 toont het service contract en een operatie die twee integers verwacht. Listing 2 definieert de service die twee getallen met elkaar vermenigvuldigt. Hieronder wordt besproken hoe we deze magazine voor software development 5

.NET C# service via de servicebus beschikbaar gaan maken en hoe we hem kunnen gaan gebruiken. namespace Services { [ServiceContract (Name="SampleContract", Namespace= "http://azureexample.microsoft.com/servicemodel/relay") ] interface ISampleContract { [OperationContract] int Sample(int getal, int multiplier); } } Listing1 namespace Services { [ServiceBehavior(Name="SampleService", Namespace= "http://azureexample.microsoft.com/servicemodel/relay/") ] public class SampleService: ISampleContract { public int Sample(int getal, int multiplier) { return getal * multiplier; } } } Listing2 Naamgeving Laten we allereerst eens naar de naamgevingstrategie kijken. De basis van het naamgevingsysteem is oplosbaar met traditionele DNS technieken. Het is aan de eigenaar van de solution om de hiërarchische namespace te controleren. De manier waarop je het moet indelen is als volgt: //Definieer credentials. Username en //password van de solution. TransportClientEndpointBehavior usernamepasswordservicebuscredential = new TransportClientEndpointBehavior(); usernamepasswordservicebuscredential.credentialtype = TransportClientCredentialType.UserNamePassword; usernamepasswordservicebuscredential.credentials. UserName.UserName = solutionname; usernamepasswordservicebuscredential.credentials. UserName.Password = solutionpassword; //Endpoint adres Uri address = new Uri( String.Format("sb://{0}/services/{1}/SampleService/", ServiceBusEnvironment.DefaultRelayHostName, "AzureExample")); ServiceHost host = new ServiceHost(typeof(SampleService), address); // Voeg de credentials aan alle endpoints toe foreach (ServiceEndpoint endpoint in host.description.endpoints) { endpoint.behaviors.add (usernamepasswordservicebuscredential); } // Open de host host.open(); Console.WriteLine("Service address: " + address); Console.WriteLine("Press [Enter] to exit"); Console.ReadLine(); host.close(); Listing 3 [scheme]://[solution-naming-scope]/[name]/[name] De naamgeving van de URI is onder te verdelen in een drietal onderdelen. De CTP release van november ondersteunt de schemes SB en HTTP, waarbij je HTTP gebruikt voor de op HTTP gebaseerde endpoints en SB voor alles wat anders is (bijvoorbeeld TCP). De solution-naming-scope beschrijft de solution binnen het Azure platform en bestaat uit In listing 3 is te zien hoe we een endpoint adres aanmaken voor onze SampleService. Voor authenticatie met de Service Bus worden de username en het password gebruikt die je hebt opgegeven bij het aanmaken van de solution in Azure. Op basis van de configuratie (listing 4) maken we een host aan. De credentials worden aan elk endpoint toegevoegd. In dit geval is dat er maar een, namelijk SampleService. Vervolgens wordt de host geopend (figuur 3). servicebus.windows.net/services/[solution] Als laatste definieer je de endpoint namen. Alles wat na [solution] komt in het pad is onderdeel van de door de gebruiker gedefinieerde namespace. Je kunt een onbeperkte hoeveelheid endpoint namen opgeven door een hiërarchie van namen achter [solution] te plakken in het pad. Voor het listing in dit artikel ziet de uri er als volgt uit: sb://servicebus.windows.net/services/azureexample/ SampleService Twee verschillende services binnen de solution hoeven niet op dezelfde machine of in hetzelfde netwerk te worden gehost. Het is de taak van de Service Bus om te bepalen waar de endpoints zich bevinden. Service Registry Naast de naming convention biedt de Service Bus een Service Registry voor het publiceren en ontdekken van service endpoints binnen een solution. Dit kan zowel automatisch als handmatig. Het handigst is om dit automatisch door de Service Bus te laten regelen. Figuur 3 <?xml version="1.0" encoding="utf-8"?> <configuration> <system.servicemodel> <bindings> <nettcprelaybinding> <binding name="default" /> </nettcprelaybinding> </bindings> <services> 6 MAGAZINE

.NET C# <service name="services.sampleservice"> <endpoint name="relayendpoint" contract="services.isamplecontract" binding="nettcprelaybinding" bindingconfiguration="default" address="" /> </service> </services> </system.servicemodel> </configuration> Listing 4 De client applicatie is op een zelfde wijze geconfigureerd (listing 5) als de service applicatie. <?xml version="1.0" encoding="utf-8"?> <configuration> <system.servicemodel> <bindings> <nettcprelaybinding> <binding name="default" /> </nettcprelaybinding> </bindings> <client> <endpoint name="relayendpoint" contract="azuresample.isamplecontract" binding="nettcprelaybinding" bindingconfiguration="default" address="" /> </client> </system.servicemodel> </configuration> Listing 5 Relay In het hart van de Service Bus bevindt zich de Relay Service (figuur 4) om door firewalls en NAT heen te kunnen communiceren. De relay maakt het mogelijk voor een zender om met een ontvanger te communiceren door middel van een adres. In het code voorbeeld is dat Connection-oriented bi-directional socket communication. Wanneer je gebruik maakt van de Relay Service leg je de luisterverantwoordelijkheid bij de Relay Service. Om gebruik te kunnen maken van de Relay Service leg je een connectie tussen je lokale service en de Relay Service. Binnen.Net doe je dit door het WCF programmeermodel en -bindings die in de SDK zitten te gebruiken. Deze bindings worden dan omgezet naar nieuwe transport bindings om WCF listeners te maken die met de Relay Service integreren. Voor de Relay Service is het nodig dat een aantal outbound poorten open staan, te weten 808 (TCP connecties), 828 (TCP/SSL connecties) en poorten 818 en 819 voor geavanceerde TCP connecties. Wanneer je binnen een omgeving werkt die alle outbound connecties blokkeert, behalve diegene die gebruikt worden door HTTP/HTTPS, dan kun je een speciale HTTP gebaseerde verbindingsoptie gebruiken. De listing gebruikt de binding NetTCPRelayBinding aangezien Microsoft deze binding als default aanraadt. Hij is zeer efficiënt en maakt een publiekelijk te bereiken endpoint aan in de Relay Service. Client applicaties moeten geconfigureerd worden met dezelfde binding. Deze binding ondersteunt drie soorten verbindingen: Relay: alle communicatie gaat via de relay service; Hybride: de initiële communicatie gaat via de relay service waarna zender en ontvanger een directie communicatie met elkaar hebben. Deze communicatie wordt wel gecoördineerd door de relay service; Direct: zonder relay service. In de CTP werkt dit nog hetzelfde als de hybride connectie. Naast de binding getoond in bovenstaand voorbeeld, zijn er nog de volgende mogelijkheden: Standaard WCF Binding BasicHttpBinding WebHttpBinding WSHttpBinding WS2007HttpBinding Vergelijkbare Relay Binding BasicHttpRelayBinding WebHttpRelayBinding WSHttpRelayBinding WS2007HttpRelayBinding [sb://servicebus.microsoft.net/services/azureexample/ SampleService] WSHttpContextBinding WS2007HttpFederationBinding NetTcpBinding NetTcpContextBinding N/A N/A WSHttpRelayContextBinding WS2007HttpRelayFederationBinding NetTcpRelayBinding NetTcpRelayContextBinding NetOnewayRelayBinding NetEventRelayBinding Tabel 1: Relay bindings Figuur 4 De ontvanger is door middel van een naar buiten openstaande poort verbonden met de Relay Service en specificeert het adres waarnaar hij wil luisteren. De zender kan dan een bericht verzenden door hetzelfde adres te specificeren. Vervolgens kan de Relay Service het bericht doorgeven aan de ontvanger die op hetzelfde adres zit. De ontvanger hoeft geen inbound poorten open te hebben staan. De Relay Service ondersteunt de volgende messaging patronen: One-way Request/response Peer-to-peer Publish/subscribe scenarios De relay bindings werken ongeveer identiek aan de WCF bindings. Het is een uitdaging om te weten welke binding je exact nodig hebt. De NetTcpRelayBinding wordt als default aangeraden, maar je zou je kunnen voorstellen dat deze wellicht niet zou volstaan omdat outbound TCP poorten nodig zijn voor de luisteraar. Je zou dan bijvoorbeeld de NetOnewayRelayBinding kunnen gebruiken. Deze is wat agressiever en maakt gebruik van HTTP poorten 80/443 die meestal open staan. Een Relay Service werkt als een omgeving die compleet los staat van de lokale omgeving, wat het mogelijk maakt om ongewild verkeer tegen te houden voordat het bij je service-omgeving uitkomt. Het verbergt ook alle informatie over de netwerklocatie. Het idee van een Relay Service is niet nieuw. Ook Groove gebruikt een Relay Service voor het uitwisselen van documenten. Authenticatie en autorisatie De Microsoft.Net Service Bus vraagt van elke ontvanger om geauthenticeerd en geautoriseerd te zijn voor een specifieke URI, magazine voor software development 7

.NET C# voordat het een listener maakt voor die ontvanger. Dit geldt ook voor clients die willen dat de Service Bus berichten voor hen relayt, al kun je dat voor de client wel uitzetten wanneer je je endpoints configureert. Authenticatie kun je laten regelen door de Access Control Service. Vervolgens is het dan aan de Access Control Service om de claims aan de.net Service Bus te produceren voor autorisatie. Het verschil tussen authenticatie en autorisatie zit hem in wie je bent en wat je mag doen. De Service Bus is zo ontworpen dat het de Access Control Service vertrouwt. De Service Bus zoekt naar claims in de security tokens die meegegeven worden door zenders en ontvangers. Er zijn maar twee claims waarnaar gezocht wordt, namelijk #send en #listen. Wanneer die gevonden zijn en er is niet gerommeld met het securitytoken dan wordt toegang gegeven. Wanneer een zender of ontvanger met solution credentials of met een security-token op de proppen komt dan maakt de.net Access Control Service een rules gedreven beslissing of een autorisatie-token wordt afgegeven aan in dit geval de Microsoft.Net Service bus. De Access Control Service signt en encrypt het security-token zodat de claims alleen gelezen kunnen worden door de.net Service Bus. Alleen de Service Bus kan de informatie decrypten en lezen. Wanneer het bericht richting de ontvanger gaat wordt het autorisatie-token verwijderd. Dit heeft de ontvanger immers niet nodig. De listing maakt gebruik van een managed card van de Security Token Service, welke bekend staat als Microsoft Identity Lab (https://ipsts.federatedidentity.net/mgmtconsole/default.aspx), waar een account is aangemaakt. Daarnaast moeten we voor de Access Control Service nog wat aanpassingen maken aan de solution in Azure (http://portal.ex.azure.microsoft.com/default.aspx). Allereerst moeten we de scope toevoegen aan de solution, waarbij je kiest voor de Service Bus. Vervolgens klik je op identity issuer en voeg je https://ipsts.federatedidentity.net toe. Binnen het lab is een account aangemaakt onder de groep Domain Users. Daarom wordt ook een claim type toegevoegd met de naam Group en de waarde Domain Users. Wanneer je dan naar Rules gaat dan zie je dat er al een Send en Listen rule is aangemaakt. Daar maak je nog een extra rule aan om aan te geven dat de receiver tot de groep Domain Users moet behoren. De servicebus authentiseert in listing 6 de client door Windows Cardspace informatie te geven. Hier kun je aangeven, dat je verwacht dat het token een claimtype group heeft. Vervolgens wordt een channel geopend en kan de service geconsumeerd worden. Tijdens het draaien van de code wordt om je credentials gevraagd (figuur 5). string serviceusername = Console.ReadLine(); //Adres Uri serviceuri = new Uri( String.Format("sb://{0}/services/{1}/SampleService/", ServiceBusEnvironment.DefaultRelayHostName, serviceusername)); //Federatie via cardspace TransportClientEndpointBehavior behavior = new TransportClientEndpointBehavior(); behavior.credentialtype = TransportClientCredentialType.FederationViaCardSpace; behavior.credentials.federationviacardspace. ClaimTypeRequirements.Add(new ClaimTypeRequirement ("http://ipsts.federatedidentity.net/group")); EndpointAddress address = new EndpointAddress(serviceUri); //Channel ChannelFactory<ISampleChannel> channelfactory = new ChannelFactory<ISampleChannel>("RelayEndpoint", new EndpointAddress(serviceUri)); channelfactory.endpoint.behaviors.add(behavior); ISampleChannel channel = channelfactory.createchannel(); channel.open(); Listing 6 Conclusie De.Net Service Bus is een veilige, op standaarden gebaseerde manier van het verbinden van applicaties over het internet..net Developers kunnen hun voordeel doen met de Service Bus door simpelweg te kiezen uit een geheel nieuwe set WCF-bindings. De rest van de WCF-code blijft eigenlijk hetzelfde. Op security vlak verbergt de Service Bus alle informatie over de netwerklocatie en biedt het een omgeving die compleet los staat van de lokale omgeving. Op deze manier kunnen kwaadwillenden door de Service Bus worden gestopt voordat het te laat is. Door de Microsoft.Net Service Bus en de Microsoft Access Control Service te combineren is het mogelijk om op een makkelijke en veilige manier applicaties met elkaar te verbinden. Zelfs door firewalls heen. Links Je kunt alles vinden over dit onderwerp op http://www.microsoft.com/azure. Bekijk tevens alle presentaties over Azure op http://www.microsoft.com/pdc. Jacqueline van der Holst Jacqueline van der Holst (j.van.der. holst@avanade.com) is als consultant werkzaam bij Avanade, een samenwerkingsverband tussen Micro soft en Accenture. Zij houdt zich bezig met onderwerpen als Share- Point, Azure, LINQ, Patterns and practices. Figuur 5 8 MAGAZINE

DevTweet: Software Development with a wink DevTweet s zijn de conversaties tussen Marianne van Wanrooij en Sander Hoogendoorn over de (on)zin die IT-ers bezig houdt: Software-ontwikkeling met een knipoog. Regelmatig zullen ook gasten worden uitgenodigd. Volg ze ook op Twitter via @mariannerd en @aahoogendoorn! Highway to hell? @mariannerd and @aahoogendoorn reviewing code of the boys Listening to Black Sabbath's Master of Reality. @aahoogendoorn Look at you... new avatar! Is that an AC/DC shirt? @mariannerd Howdy partner! It is AC/DC all right. Your avatar new too? Something wrong with the old one? @aahoogendoorn Nope, just a change in scenery! Like the project I'm doing. I'm asked to do a code review. @mariannerd Cool! Whenever I'm asked to do a code review, the client always knows, or at least suspects, something's terribly wrong. @aahoogendoorn Oh yes... We have the suspect... Now it's a case of getting the evidence... I feel like Columbo.. @aahoogendoorn You know the suspects from the beginning, but you still have to look for the evidence for conviction! @aahoogendoorn So when you are asked to do a code review, what is the first thing you do? @mariannerd The first thing I do? Ask the client what they're hoping to achieve: do they actually want to know how deep the rabbit hole goes? @mariannerd Next, I make a list of all things I should look at during the review. Architecture, domain, data access, layers, extensibility.. @mariannerd Security, authorization, reuse, code copying (especially in VB), way of working, documentation, design, quality of coding. @aahoogendoorn So far so good! @mariannerd Rule #1 in code reviews: more time means more detail. @aahoogendoorn Code Reviews are fun! No deadlines. just looking at somebody else s code. @aahoogendoorn... Oh and telling what's wrong with it... I must say this is the first time I get such an assignment. @mariannerd You know, there's so much horrible code out there, we could do code reviews for the rest of our lives. @aahoogendoorn Well, a lot of this stuff is subject to opinion... 100 developers, 100x different code for the same functionality... @mariannerd Yes true, but some code is definitely worse than other code. And believe me, I've seen some bad coding in my time. @aahoogendoorn Any examples? @mariannerd Examples of bad code? How many do you need. Check out this old blog post of mine (in Dutch). http://htxt.it/revb @mariannerd Think of SQL statement in web pages, or of a single class that handles 50% of all functionality. @mariannerd Or think of the same business rule implemented multiple times on different locations, in different ways. @aahoogendoorn One of the things I came across: internal web application: authentication by doing a LDAP query to see if the user exists. @aahoogendoorn Haven't they heard of Windows Authentication in IIS? They didn't even check if the user was enabled or disabled... :-S @mariannerd Haha, nice one. I once audited the enterprise web portal for a very large international company where ALL communication... @mariannerd between front end and back end went through one single class. Imagine the effect of a single change.. @mariannerd Sometimes, it gets really bad. Code a whole company depends on, which is so bad, that productivity will definitely be below zero soon. @mariannerd Anyway, I love being asked for code reviews. It gives the opportunity to help improve the quality of applications. @mariannerd That is, if they follow up on your advice from your code review. Unfortunately, that is not always the case. @aahoogendoorn Well maybe it's not needed... Or they just want to know the risks and are happy to take them! @aahoogendoorn Which could be the outcome of a code review. It's not good, but far from worse And it may be fixed with a couple of quick wins. @mariannerd Well yes, that could be the outcome. Maybe I'm to idealistic about writing good code. If it ain't broken, don't fix it. @mariannerd But I just love clean code... @aahoogendoorn... But even bad code can function. @mariannerd My favorite example: an ASP.NET web site that was never compiled by the developers. They just ran it from the browser. Great stuff! @mariannerd As a consequence, of the over 40 pages in the application, only 6 compiled (the ones they visited running it in the browser)... @aahoogendoorn LOL "we got a live one here!". This business application compiled at runtime? No test cases, just put it in production! @mariannerd And then things can get pretty messy. Especially when your poor company lives of this software. @aahoogendoorn That is the whole point isn't it Developers just start coding without a plan, or knowing best practices. @mariannerd Yes, a lot of developers code without having a decent architecture, without patterns, without layers - but with best intentions. @aahoogendoorn Oh yes, best intentions... The road to hell is paved with good intentions... @mariannerd No stop signs, speed limits. Nobody's gonna slow me down. Highway to hell. AC/DC#? @aahoogendoorn Nope... 4 minutes by Madonna LOL. @mariannerd Madonna? Girl you need a music review instead of a code review! @aahoogendoorn...i guess even bad music can function. ;-) magazine voor software development 9

.NET (C#, VB, etc.) User experience (ASP.Net, Silverlight, Expressions, Flash, etc.) Information Worker (MOSS, BizTalk, OBA, etc.) DotNetNuke (OpenForce Europe 09 Conference) Delphi Core Systems Databases Architecture General topics 2 DAYS SOFTWARE DEVELOPMENT CONFERENCE 2009 19 EN 20 OKTOBER 2009 PAPENDAL, ARNHEM Also included:. 19 & 20 OKTOBER A.S. SDN CONFERENCE Papendal, Arnhem SCHRIJF NU IN!

Daarom is er het Software Development Network! EEN ALL-IN PRIJS Het SDN is een No Nonsense Club, dus geen verrassingen achteraf. De prijs is duidelijk en All-In, dus mét consumpties in de pauzes, mét lunch (2x) en mét diner op maandagavond. Zelfs het parkeren is inbegrepen! Wie wil overnachten in het hotel van Papendal (een aanrader!) kan bij het aanmelden meteen een hotelkamer boeken. Wees er wel snel bij want het aantal beschikbare kamers is beperkt. SDN leden betalen 595,- voor deelname, niet-leden betalen 695,- Software Development Network, Postbus 506, 7100 AM Winterswijk Tel: 0543-518058 www.sdn.nl

overzicht sprekers en sessies.net Richard Campbell CAN Performance Tuning ASP.NET (Understanding Performance Tuning) Stephen Forte USA Building RESTful Applications with Microsoft Tools Data Access Hacks and Shortcuts Robert Green USA WCF and WF: Two Great Technologies That Go Well Together An Introduction to Windows Communication Foundation Windows Communication Foundation Security Fundamentals Chad Hower CYP ADO.Net Entity Framework ASP.Net MVC Framework Nik Kalyani USA Hands-on Windows Azure: Building a Twitter Clone Beth Massi USA Future Directions for Microsoft Visual Basic and C# Taking Advantage of LINQ and XML in Office 2007 Ted Neward USA The Busy.NET Developer's Guide to DSLs in Oslo Dennis van der Stelt NL Velocity Shawn Wildermuth USA Building your first MGrammar Data Validation in Silverlight 3 Why Oslo Matters Architecture Kent Alstad CAN Queuing with Azure The Great Database in the Sky From iphone to Azure Richard Campbell CAN From One Web Server to Two: Making the Leap Udi Dahan IL Intentions & Interfaces - Making Patterns Concrete Avoid a Failed SOA - Business & Autonomous Components to the Rescue Designing High Performance, Persistent Domain Models Sander Hoogendoorn NL Modeling services using smart use cases Applying model driven development in developing Silverlight 2.0 applications Michael Stiefel USA How To Partition and Layer a Software Application Claims Based Security: What it is and Why it will be in your Future Does the Relational Database Make Sense in the Cloud? Architecting Software as a Service Delphi Marco Cantù I Creating Windows 7 Applications in Delphi Multi-Threading in Delphi Domain Specific Languages in Delphi Pawel Glowacki NL Delphi Natural Input Hadi Hariri SP ASP.NET MVC in Delphi Prism Advanced ASP.NET MVC in Delphi Prism Chad Hower CYP Connecting to.net with CrossTalk IntraWeb: Then, Now, and Future Cary Jensen USA Introduction to WPF Development with Delphi Prism An Introduction to LINQ in Delphi Prism 9 Thread Synchronization Options in Delphi Compared Barry Kelly USA Delphi Compiler RTTI Enhancements Design of a combined garbage-collection and serialization mechanism Bob Swart NL Delphi 2010 DataSnap Enhancements User experience Nik Kalyani USA Raising the UX Bar with ASP.NET MVC and jquery Don Kiely USA AJAX 4.0: Rich Internet Applications Come of Age Revenge of the Client: AJAX 4.0 Data Binding Joost Nuijten NL De ultieme gebruikerservaring Rich Internet Applications Klaasjan Tukker NL Building rich internet applications with Flash Builder and.net Interactive video expierences Shawn Wildermuth USA Building Behaviors in Silverlight 3 MAGAZINE

overzicht sprekers en sessies Information Worker / SharePoint Nick Boumans NL Social Networking in SharePoint E-Commerce using SharePoint and Commerce Server 2009 Donald Hessing NL SharePoint and Jquery Integratie Silverlight en SharePoint Beth Massi USA Building Office Business Applications with Visual Studio Dick Moffat CAN Excel Development - Rules of Engagement Wouter van Vugt NL Localizing SharePoint Solutions Developing SharePoint Workflows Core Systems Scott Ambler USA RUP: Agile Development Agile Development Workshop Martin Knobloch NL Security Advanced The Secure development lifecycle Ted Neward USA Effective Enterprise Java A Tour of the Open Source Java Community Database Cary Jensen USA Advantage Database Server and Delphi: A Perfect Match Don Kiely USA SQL Server 2008 Security for Developers User-Defined Types and Aggregates in SQL Server 2008 Dick Moffat CAN Using Microsoft Access 2010 With SharePoint The new features of Microsoft Access 2010 General Richard Campbell CAN Death of a Web Server: Crisis in Caching Sander Hoogendoorn NL Do s and don t in implementing and applying extension methods Dennis van der Stelt NL Introduction into the TDD Mantra Making sense of the buzz words DotNetNuke OpenForce 09 Europe Erik van Ballegoij NL Leverage the DotNetNuke framework for your own application Cathal Connolly UK DotNetNuke performance tips & tricks DotNetNuke and Dynamic Data Auditing and logging - Who, what and when? Peter Donker NL Advanced Module Development Extension software protection in DNN Steve Fabian USA WCF and DotNetNuke Windows Workflow and DotNetNuke Templating : User-Controlled Output Nik Kalyani USA Advanced Skinning with DotNetNuke 5 Using and Extending the DotNetNuke Widget Framework Stefan Kamphuis NL DotNetNuke 101 for ASP.NET Developers Vicenç Masanas SP Using MSBuild to automate building and packaging Creating a SiteMap provider for DotNetNuke Charles Nurse CAN DotNetNuke in the Cloud DNN and.net v4 Module Development Chalk and Talk Shaun Walker USA DotNetNuke Localization DotNetNuke Professional DotNetNuke State of the union

DELPHI Ann Lynnworth The WebHub Way of Thinking This is part 2 of the article published in magazine 101. How Exactly does a Team Cooperate? The user manual for the WebHub extension for Dreamweaver discusses the topic of team cooperation in great detail, and includes best-practice advice for file organization, naming conventions, and so on (see http://www.href.com/edeliver:whdw). Nonetheless, I can give you an overview here now. We have already talked about the fact that the WHTEKO files are kept separate from the WebHub application. Generally, a graphic design person would be given access to those files, plus the images, css and javascript files. All such files can be easily maintained in version control. Refreshing when files change If the designer changes an image or a CSS file, reloading the web page in the browser should be enough to see the change. If the designer changes a WHTEKO file and wants to see the effect in a web browser (without using Dreamweaver), he or she needs to get the WebHub application to refresh. There are many ways to do this, including using WebHubAdmin on the server, right-clicking and selecting Refresh from the tray menu of the running app on the server, or using a browser to trigger a special page with a refresh command for this purpose. I find that using the browser is usually quickest. The special page would be declared as shown in listing 1, <whpage pageid="remoterefresh"> (~app.refresh~) </whpage> Listing 1: A page used to tell the app to reload WHTEKO and config details and called from Firefox or IE using http://www.mydomain.com/scripts/runisa.dll?appid:remoterefresh Of course, you might add security to make sure the remoterefresh page was only called from certain ip numbers or only on a restricted subdomain. From sketch to actual A designer often needs to put in some placeholder content, before the Delphi programmer can create a perfect web action to generate the content dynamically. WebHub supports this process with a <whsketch_tag>. Listing 2 shows an example, where part of a page banner is built. <whsketch show="yes"> <table id="banner"> <tr> <td><img src="/sitedesign/abccompanylogo.png" /></td> <td>a.b.c Company the best, since 1885 </td> </tr> </table> </whsketch> Listing 2: A sketch, showing sample data in position, for design purposes When the developer sees the sketch, he or she could realize that only two variables are needed to make that section work for any company. At that point, the sketch would be copied to a droplet, expecting two parameters, as shown in Listing 3: <whdroplet name="drbanner"> <whdoc for="drbanner"> DYN1 name of image used for the logo DYN2 company slogan/text Usage: call via web action named 'wabanner' </whdoc> <table id="banner"> <tr> <td><img src="/sitedesign/(~dyn1~)" /></td> <td>(~dyn2~)</td> </tr> </table> </whdroplet> Listing 3: A droplet, expecting two parameters to fill in variable data The developer could then make a web action to find the data and display it. There are many approaches. Listing 4 shows how it can be done by calling the PARAMS command, which runs a droplet, passing in parameters. uses webapp; procedure TForm1.waBannerExecute(Sender: TObject); var OrgImageFilename: string; OrgSlogan: string; begin // do some database lookup to find these values OrgImageFilename := 'abc.jpg'; OrgSlogan := 'A.B.C. Company, the best since 1885'; pwebapp.sendmacro(format('params drbanner %s,%s', [OrgImageFilename, OrgSlogan])); end; Listing 4: Web action component loads data then calls the drbanner droplet, passing two parameters which become available as DYN1 and DYN2) When that was in place, most likely the Delphi programmer would disable the sketch by changing show="yes" to show="no", and adding (~wabanner.execute ~) 14 MAGAZINE

DELPHI Once that was in place, the designer could make further adjustments to the drbanner droplet (listing 3) to add CSS tags, etc., independently from the Delphi programmer. The <whdoc_tag> in listing 2 is optional. We recommend using it whenever droplets expect parameters, so that everyone knows what is required. In some future version of WebHub, we hope to make the web action components more self-documenting, so that they could report their usage automatically. For now, coders should use the <whdoc_tag> or a WebHub comment to annotate tricky sections of the file. Text Substitution Macros WebHub supports unlimited text substitution macros. The restrictions on macros is that each must fit on one line (but that can be a long line). A droplet, by contrast, can include unlimited lines. Listing 5 shows imaginary macros. <whmacros> mcassetroot=/files/ mclegaldir=(~mcassetroot~)/misc/legal/ mctrademarkpic=<img src="(~mclegaldir~)trademark.jpg" alt="tm" /> </whmacros> Listing 5: Text substitution macros can be defined in any WHTEKO file. You may have already realized that calling a macro is accomplished in W-HTML by putting its name inside parentils: (~mclegaldir~) Page Settings Internally, WebHub has an object for each page in the application, a TwhPage component. Each page can carry some configuration detail, known as Page Settings. That is basically a TStringList that can be used to write generic code. The following example (listing 6) shows how page settings can be used to enter details which are later used to generate a Google sitemap file. (The Google sitemap feature is included as a standard module in Web- Hub. It works as-is for sites where every page has its own PageID. It requires modification for sites that use WebHub pages as templates and need Google to a wide range of database-driven content.) <whpage pageid="login" desc="customer Login"> <whpagesettings> googlesitemap=include_all_lingvo googlechangefreq=monthly googlepriority=0.7 metarobot=index,nofollow metadescription=customers may login here. metakeywords=login; interactive; dynamic </whpagesettings> </whpage> <whpage pageid="homepage" desc="distribution"> <whpagesettings> googlesitemap=include_all_lingvo googlechangefreq=monthly googlepriority=1.0 metarobot=index,follow metadescription=full service east-coast distribution metakeywords=courier service; trucking; </whpagesettings> <whoutput> (~mcdoctype2006~) <html> <head> <title>(~pagedesc~)</title> (~drhead~) </head> </whoutput> </whpage> <whdroplet name="drhead"> (~HEADER Content-Type: text/html; charset=utf-8~)(~walingvo.execute~) <meta name="robots" content="(~pagesetting.metarobot~)" /> <meta name="description" content="(~pagesetting.metadescription~)" /> <meta name="keywords" content="(~pagesetting.metakeywords~)" /> <link rel="stylesheet" type="text/css" href="/css/common.css" /> </whdroplet> Listing 6: Page settings defined, then used to generate sitemap and shared header tags Application Configuration You may be wondering about custom settings needed for the application as a whole, such as a database name or the path to some utility used during processing. This is handled through the applicationlevel configuration file. In that file, you can have settings which are again basically a stringlist, although they are stored in XML format. Listing 7 shows a few sample settings and how they could be referenced in Delphi and in WebHub-HTML. In XML: <AppSettings> <AppSetting name="demographic" value="yes" /> <AppSetting name="dbname" value="alias123" /> </AppSettings> In PAS: ShowMessage(pWebApp.AppSetting['DemoGraphic']); ShowMessage(pWebApp.AppSetting['DBName']); In WHTEKO: (~AppSetting.DemoGraphic~) (~AppSetting.DBName~) Listing 7: Application settings in the config file; used in Delphi; used in WHTEKO Dozens of aspects of the application can be configured. Some people like to use Notepad to edit the XML file directly. Beginners will find that the configuration utility, ZMAdmin.exe, is very convenient for exploring and changing settings. Figure 1 shows AppSettings as they look in ZMAdmin. Fig. 1: ZMAdmin provides the GUI for configuring the application; hints are often more detailed! Live Content in Dreamweaver If the page layout expert on your team uses Dreamweaver, I highly magazine voor software development 15

DELPHI recommend that you look through the user guide for the WebHub Extension for Dreamweaver. That manual contains many screen shots showing exactly how it works. Remember, the big difference between WebHub's live content and that from ASP, PHP, etc., is that the Web- Hub content is generated specifically for Dreamweaver and provides 100% of the HTML for each WebHub expression. Other plug-ins use approximations for many of their dynamic pieces, especially for database content. If you are not a Dreamweaver fan, do not despair! People have built extreme sites using the WHTEKO editor provided with WebHub, or even their favorite text editor. Content Management Straight "out of the box," WebHub supports simplistic content management. A WebHub site is easier to maintain than a static web site because one usually shares all the headers and footers across the pages. However, if you want to use a database to store content, and manage users and permissions, you need to build something for that purpose. One of the demos provides a simple example for doing so. One of our customers, www.netcat.com.au, has built a full-featured CMS using WebHub. Another customer, www.webcentre.co.nz, built a CMS specifically for magazine and "news" content, and that is used on the award-winning site, www.scitechdaily.com. Web Apps that look like Delphi Apps Do you want your web application to look and act exactly like an existing Delphi application? WebHub includes a fancy component nicknamed "F2H" meaning "form to html converter". This component can take any Delphi container, such as a form or a groupbox, and convert it to HTML. This content can be used as the basis for any page, such that the surfer looks at something which looks like a Windows application. Whether this is desirable or not, depends on the target market and the type of application. You may know that IntraWeb specializes in this type of web application, and uses AJAX in creative ways to make web applications operate like Delphi applications. There was an excellent presentation about this at CodeRage 2008, and if you missed it, I recommend you find the recorded session. Look for "Rich User Interfaces with IntraWeb" by Olaf Monien at http://conferences.codegear.com/coderage08/sessions. WebHub supports AJAX and includes three general-purpose commands to make AJAX features extremely easy to use. A Delphi developer in Florida has used the WebHub AJAX commands to create a web version of his proprietary application. So if you want your web application to look and act like a Windows application, you certainly can. If you want **all** your web applications to look and act like your Delphi application, IntraWeb will be a better product for you than WebHub. WebHub developers often build an application with the idea of "skinning" it for multiple customers Apps with Skins; Re-use Would you agree that developers are most profitable when they can build something and then re-use it two or more times? WebHub developers often build an application with the idea of "skinning" it for multiple customers. This can be done in many ways. The simplest is to use an AppSetting to define the values that need to change for each customer, and use a different configuration file for each customer. Whatever technique you use, the key is to use macros and droplets for each piece of the design that will be swapped out. If you have an extra-talented CSS person on your team, you might not have to vary much more than the path to the CSS file. If you want to skin your web app for two or more purposes, WebHub will probably be a better product for you than IntraWeb. Techniques inside Delphi There are a few innovations inside Delphi which make WebHub applications unique and fun. MultiTypeApp; TtpProject MultiTypeApp is the name of a unit which, when included in your DPR instead of Forms, makes your application compile easily as a normal Windows app, a Windows service, or as a console application. Because most WebHub developers eventually deploy their app as a Windows service, that is the default behavior. However by adding the PREVENTGUI compiler directive, you eliminate the as-service feature (and overhead). TtpProject is the name of a component which we use to organize and sequence all the CreateForm statements relating to forms and datamodules, plus any initialization. When combining standard WebHub datamodules and forms with custom units, an ordinary DPR can become quite messy, and often only the original developer understands the required sequence. TtpProject has a series of events which offer a place to put the nuts and bolts of project startup that would normally be in the DPR. It includes some features which are especially helpful to WebHub coders and can be ignored in other types of projects. The use of TtpProject is always combined with the use of MultiType- App. Both are part of TPack and available with full source. Let's look at one real-world example, keeping in mind two goals: 1. Create objects in the correct order to avoid referencing something which is still nil; 2. Enable easy compilation of the app with zero GUI in case that is needed later. Fig. 2: Delphi Object Inspector with all the events on TtpProject (in Delphi 7) Each event is called in the order shown. Thus all the datamodules are created FIRST (over 3 steps, as needed for WebHub); then any Init methods are called on those datamodules in order to run code which cannot run inside OnCreate due to interdependencies among modules; then the GUI is created; then the GUI is initialized. Listing 8 shows the code inside those events for an app in production named CSShop, from the DMForCSShopPR.pas unit: 16 MAGAZINE

DELPHI procedure TDMforCSShopPM.ProjMgrDataModulesCreate1( Sender: TtpProject; var ErrorText: String; var Continue: Boolean); begin CreateCoreWebHubDataModule; // includes TwhApplication end; procedure TDMforCSShopPM.ProjMgrDataModulesCreate2( Sender: TtpProject; const SuggestedAppID: String; var ErrorText: String; var Continue: Boolean); begin if SuggestedAppID = '' then begin ErrorText := 'Usage: csshop.exe /ID=shopname'; Continue := False; Exit; end; if AppIDToConfigFilespec(SuggestedAppID) = '' then begin ErrorText := Format( 'WebHub Configuration Error in WHCentralInfo.xml%s' + 'No configuration file for AppID "%s".', [slinebreak, SuggestedAppID]); Continue := False; Exit; end; with pwebapp do begin AppID := SuggestedAppID; Refresh; // load all config and WHTEKO information end; // provide notice to use while the rest is loaded CoverApp(SuggestedAppID, 2, 'reloading application', False, ACoverPageFilespec); end; procedure TDMforCSShopPM.ProjMgrDataModulesCreate3( Sender: TtpProject; var ErrorText: String; var Continue: Boolean); begin try // uses MultiTypeApp, not Forms Application.CreateForm(TdmCommon, dmcommon); Application.CreateForm(Tdmdb, db); Application.CreateForm(TdmFastTax, dmfasttax); Application.CreateForm(TdmAccount, dmaccount); Application.CreateForm(TdmCart, dmcart); Application.CreateForm(TdmVersionControl, dmversioncontrol); Application.CreateForm(TdmPlaceLookup, dmplacelookup); Application.CreateForm(TdmAS400, dmas400); CreateStandardWHModules; // based on app config Application.CreateForm(TdmwhNavigation, dmwhnavigation); Application.CreateForm(TDataModuleProductPhotos, DataModuleProductPhotos); except on E: Exception do begin ErrorText := E.Message; Continue := False; end; end; end; procedure TDMforCSShopPM.ProjMgrDataModulesInit( Sender: TtpProject; var ErrorText: String; var Continue: Boolean); begin try db.init; dmfasttax.init; dmaccount.init; dmcart.init; dmversioncontrol.init; dmas400.init(dmcommon.cn1, dmcommon.tr1); InitCoreWebHubDataModule; // TwhApplication InitStandardWHModules; // based on app-config dmwhnavigation.init; DataModuleProductPhotos.Init; except on E: Exception do begin ErrorText := E.Message; Continue := False; end; end; end; procedure TDMforCSShopPM.ProjMgrGUICreate( Sender: TtpProject; const ShouldEnableGUI: Boolean; var ErrorText: String; var Continue: Boolean); begin if ShouldEnableGUI then try Application.CreateForm(TfmWebHubMainForm, fmwebhubmainform); CreateStandardWHModulesGUI; // based on app-config Application.CreateForm(TfmwhSponsor, fmwhsponsor); Application.CreateForm(TfmMemory, fmmemory); Application.CreateForm(TfmAS400, fmas400); except on E: Exception do begin ErrorText := E.Message; Continue := False; end; end; end; procedure TDMforCSShopPM.ProjMgrGUIInit(Sender: TtpProject; const ShouldEnableGUI: Boolean; var ErrorText: String; var Continue: Boolean); begin if ShouldEnableGUI then try InitCoreWebHubDataModuleGUI; InitStandardWHModulesGUI; fmwhsponsor.init; Application.MainForm.Caption := pwebapp.appid; UncoverApp(ACoverPageFilespec); WebMessage(''); // clear splash screen except on E: Exception do begin ErrorText := E.Message; Continue := False; end; end; end; end. Listing 8: Delphi code linked to the events shown in figure 2 To understand why all this is necessary, you need to think about how objects are created and initialized. Getting the sequence correct is essential. For a WebHub application, you must instantiate a TwhApplication (OnDataModulesCreate1), set its AppID property and refresh it (OnDataModulesCreate2), and then create other non-gui modules which work once the TwhApplication is ready (OnData - ModulesCreate3). After all of those have been instantiated, we do another pass to call an Init procedure on any datamodule which needs to do something special. For example, it's usually better to connect to a database in the Init method, in case one needs to use any properties on other datamodules. The GUI forms are created and initialized completely separately. While the GUI is great during development and testing, it is often undesirable during production. By isolating the CreateForm statements for forms in OnCreateGUI, the whole project can quickly be compiled as a non-gui edition when needed (by adding the PREVENTGUI directive). It is possible to build WebHub apps without MultiTypeApp or TtpProject. However we recommend using them because the resulting code is more self-documenting. magazine voor software development 17

DELPHI Too difficult? Talk to the Wizard! We built a few wizards to help you get your files started. They are accessible inside the Delphi IDE. 1. New AppID - creates the XML and WHTEKO files needed for a new application - do this first! Use the menu: Project > WebHub > New AppID 2. New Project - create the DPR and the unit containing TtpProject, with the events all coded for you. Use the menu: File > New > Other > Projects > WebHub Application and reference http://webhub.com/dynhelp:alias::newprojwizhowto for detailed steps for creating your first hello-world app. 3. New Form use this to add a module into an existing project. File > New > Form > WebHub Form Modules aka Panelware When Delphi first came out with form inheritance, TPack started leveraging inheritance to allow for user interfaces that would snap together in a way that was suitable for prototyping and testing. As WebHub applications on production servers usually prefer a minimalist GUI, this made sense. At first, we called these snap-together forms "panelware". WebHub panels were often re-used in multiple projects. More recently, we have been talking about standard and custom "modules", where the GUI is optional. Let's illustrate this by reworking the banner idea we worked with earlier in listing 3. Of course, you would want that triggered from a web page through a TwhWebAction component. In addition, for testing, you might want the feature triggered by a button click. Ideally, you would create two new units, a datamodule and a form. You would do this using the New Form Wizard. You would put the non-visual functionality into the datamodule (i.e. the TwhWebAction), and you would put the visual button into the form. Now the form would be a special form, descending from TutParentForm in TPack. This type of form automatically adds itself as a "panel" into the WebHub GUI. If that form is created first, it will be the first panel. If it is created third, it will be the third panel. For advanced WebHubbers who want extra credit, it is possible to invent a keyword to associate with the new feature, say "banner". (This is worth doing if you intend to on-sell your module to other WebHub programmers.) You could then add a bit of code to your TtpProject events such that the core code in the datamodule and the GUI would be brought in based on configuration entries in your application-level config file. The custom configuration is shown in figure 3. Notice that the banner feature is "Enabled with GUI" by default, yet it is "Enabled" on a server which has been labeled as "production." The Delphi code which makes the feature come and go based on the configuration is shown in listing 9. procedure TDMSampleForWHProject.ProjMgrDataModulesCreate3( Sender: TtpProject; var ErrorText: String; var Continue: Boolean); begin CreateStandardWHModules; if (pwebapp.startup.custommodulestatus('banner') <> mstatusdisabled) then Application.CreateForm(TDM001, DM001); { Special Comment for DataModules - do not delete! This comment is used by the WebHub Wizard to position non-gui CreateForm statements for you, just above here. You may add your own CreateForm statements as well, either above or below this comment, as you wish. } end; procedure TDMSampleForWHProject.ProjMgrDataModulesInit( Sender: TtpProject; var ErrorText: String; var Continue: Boolean); begin InitCoreWebHubDataModule; InitStandardWHModules; if (pwebapp.startup.custommodulestatus('banner') <> mstatusdisabled) then DM001.Init; end; procedure TDMSampleForWHProject.ProjMgrGUICreate( Sender: TtpProject; const ShouldEnableGUI: Boolean; var ErrorText: String; var Continue: Boolean); begin {$IFNDEF PREVENTGUI} if ShouldEnableGUI then begin Application.CreateForm(TfmWebHubMainForm, fmwebhubmainform); CreateStandardWHModulesGUI; if pwebapp.startup.custommodulestatus('banner') = mstatusenabledwithgui then Application.CreateForm(TfmAppPanel, fmapppanel); { Special Comment for Forms - do not delete! This comment is used by the WebHub Wizard} end; {$ENDIF} end; Listing 9: Creating modules based on status in application-level config file When you are in a rush, you probably would not take the time to separate the GUI, give the feature a name, and load it conditionally based on configuration entries. However, if you wanted to develop a module to sell to other WebHub developers, or if you wanted to compile one large application for multiple purposes and needed to be able to turn major features on and off for various customers, you might take advantage of this approach. Any WebHub application can surface some or all of its features via the standard SOAP interface Fig. 3: ZMAdmin, used to vary the use of the banner feature for development vs production. SOAP Any WebHub application can surface some or all of its features via the standard SOAP interface, and we definitely recommend this. Precisely, any TwhWebAction derivative can be SOAP enabled by toggling the SOAPCallOk property from False to True. This is demonstrated in the "spam aversion" demo, http://demos.href.com/htun. If you click into that demo, you can see how SOAP documentation is generated automatically, both human-readable and 18 MAGAZINE

DELPHI everything needed for software interfacing. In that demo, use the [Source] link to see all the Delphi code, especially the whstop- Spam_fmWh.pas file which shows how to add a custom method with in and out parameters. Customer Comments I thought you might like to hear from "ordinary" Delphi programmers have to say about WebHub. The following two comments are from people who have built significant ventures using WebHub and Delphi. The first operates in Germany and the second in the USA. We have been working with WebHub since March 2000. At that time, we intensively evaluated web development options: Java, PHP, ASP, diverse frameworks in each of these languages. Even at that time, none of these evaluated tools impressed us with their performance. Also, the cost effectiveness and usability was often unbelievably lacking. Whoever has even once labored with Java and Struts and their XML will understand exactly what I am talking about. After months of searching and evaluating, I found href.com. It was like a miracle. We could finally develop our real estate portal in Delphi, logically and consistently. It was wonderful. The performance, the stability, the ease of use, the simplicity -- all this was, and still is today, the basis for us to say that the WebHub framework is the number 1 choice for anyone who wants to develop a stable, high-traffic, modular, high-performance web application. We know Java, we know PHP, we know Ruby and Ruby on Rails. Yet, if we were to build our real estate portal again, starting today, we would do it with 100%-awareness with the friendly WebHub. If it were possible to give 5 stars to WebHub, we would give it 6 stars. At this point, many, many thanks to Ann, for the always-friendly, high quality technical support, the quick clarification of ideas and quite simply for the best web tool which I use daily. -- Andreas Orth, www.my-next-home.de, customer from 2000 to 2009 We have had several iterations of migrating to ASP.Net and all have failed in matching or even approaching the performance and the productivity of Delphi + WebHub. All of these attempts have been by professional ASP.Net developers. Our competition (using ASP.Net, ASP, PHP, Java) have not been able to approach the complexities, performance, etc., we have attained on our site -- regardless of the number of developers they commit. -- John Correa, www.res.net, customer from 1997 to 2009 Licensing and Source Code Availability We have a fine-grained way of providing source code. We recommend that you start with a free evaluation license (www.href.com/trywhub) and make sure that you are in love with WebHub. The latest prices are always available at http://www.href.com/hrefshop. WebHub is available for Delphi 6 and above; Delphi 2009 is recommended. TNativeXml, ZaphosdMap and most of TPack also compile in Kylix 3 and Delphi for Dot Net through D2007. TNativeXml additionally compiles under FreePascal. Conclusion In these articles, I've walked you through the facets of WebHub which contribute to its unique level of power and flexibility. I invite you to use this knowledge -- in Delphi, with WebHub -- or otherwise. Who should build apps with WebHub? Ideally, WebHub is for programmers who love expressing themselves in Object Pascal, who are interested in skinning their web application for multiple audiences, who need to translate their site content into two or more lingvos, who see advantages in partnering with a web artist, and who want to build something long-lasting. Fig. 4:. Once more where we started off at the cables suspending the Brooklyn Bridge, April 2004. I have been very quiet about WebHub since 2002; we were consumed with extensive refactoring. We are now officially open again for new customers, and I look forward to hearing from readers with questions or comments. Reach me through our site, http://www.href.com/ contact. Ann Lynnworth Ann Lynnworth was born near Boston, Massachusetts USA at the right time to catch the information technology wave. In 1978, she found she could not resist learning to program fancy macros for Word- Perfect, and she has never been afraid to pick up a manual and/or guess her way into a new technology. She started her "Software Doctor" consulting business in 1983 on Apple's early computers, published WordStar at Your Fingertips, wrote Situation Analyst for the IBM PC, helped create Ronstadt's Financials and then joined XL/Proteus to learn all about Paradox and a bit about SQL. Skipping ahead to 1994, Ann learned Delphi and soon co-founded HREF Tools and has worn many hats with the internet tools company, the most enjoyable of which was producing Tech Talk Radio for several years for WebHub customers. A dynamic speaker with an unusual point of view, Ann has had rave reviews from attendees in training seminars and at technical conferences. Ann holds an associate art's degree from Simon's Rock College and a bachelor s degree in psychology from Wellesley College, also in Massachusetts. magazine voor software development 19

Advertentie VNU