Thursday, May 15, 2008

WCF for Web Developers

with Jean-Luc David

Definitions

·WCF - Windows Communication Foundation

·REST - Representation State Transfer

·RSS/ATOM - Syndication standards

·POX - Plain Old XML

Web Dev Challenges

·Pace of change

·Social networking and content syndication

·Ramp up time

·What format to use at what time

    • SOAP, RSS, REST, XML, etc.

WCF

·One communication API

·Highly customizable

·Partial trust support

·WebScriptServiceHostFactory

    • Don't need a config file

·You can use various locations for your service

    • Console, WinForm, Web, IIS, Windows Activation SErvice

Notes

·Use sniffer to see what's being put on the wire

·With WCF you have to add the attributes to the entities

·There is a WCF performance White Paper

Day 4

This ends the last full day of sessions. Tomorrow will just be one big write up on SilverLight. Hurrah!

Wednesday, May 14, 2008

Planned Agility

Come soonish!

Using Excel, the BDC, Dashboard Web Parts, and TFS

with Joel Semeniuk

Definitions

  • BDC - Business Data Connection
  • MOSS - Microsoft Office SharePoint Server
  • OLAP Cube - a data structure that allows fast analysis of data

Team System Reports aren't always enough

  • People are using Excel to do fun Excel stuff
    • But this is using files
  • How to we move this back into TFS?

TS has a very rich data architecture

  • Stores source code and auditing information
  • Has automated build engine and keeps statistics
  • Work Item tracking (Bug, requirement, feature, etc.)
    • Can embed rules and details in work items
    • Stores change information
  • 3rd Party can add additional data stores and tehy can link to each other
    • Checkins can be associated with a bug, for example
    • Each has its own data store and is aggregated into one database
  • We can now build big picture analytics
  • MS ships a number of reports that run on the OLAP cube
    • OLAP cube can be exposed to external sources such as Excel

Excel can point to the VSTS data store

  • Can do cross project reporting. TFS doesn't have these reports
  • Excel reports aren't static
  • Can display reports without Excel
  • MOSS can handle data connections!

Getting data from Excel to SP

  • EWA - Excel Web Access
  • EWS - Excel Web Service
  • ES - Excel Services
    • Lot's of configuration options through SP
    • Fine grain security
  • You can publish your reports to SP
    • You can name everything such as graphs
  • Create a Dashboard
    • Dashboards hold webparts
    • Create a PMO dashboard to give a good perspective on your projects
    • Can expose information to the Client
  • Create Web Parts

The BDC

  • Data brought into SP in an abstracted manor
  • Allow your to search your data like a SP search
  • Not part of the base MOSS. You need to pay more for this, of course.
  • Difficult to set up
    • Don't build this by hand!
    • There are rough tools to do this
  • Can set permissions
  • You can then hook them up within a web part

Summary

  • TFS maintains a lot of data about your projects
  • You can expose that data through SP using Excel and BDC, etc.

Notes

  • Web Parts can have relationships
  • You can use BDC to import project name, etc from FTS into SP
    • You can tag files with the same tags in SP as in TFS
    • Add a new project to TFS, then you can tag the associated files in SP wit the same name

Tools

  • Worldwide telescope

Parachute into Brownfield Development

What is?

  • Not legacy but not a brand new app
    • PCL for example
  • Possibly gone stale
  • You have access to the code you are able to change it
  • Not in obsolete technology
    • RBRS would not get BF

Where to start

  • Documentation
    • Rarely up to date
  • Meetings
    • Gives you the feel of the team
  • Look at the code
    • Our natural instinct
  • Solve a defect
    • Start with a bug fix
    • might help to find your way around
    • really hard
  • Knowledge transfer
    • peer programming so get social and guidance
    • semi-productive right from the start
  • Analyse build process
    • Might not always exist
    • Shows you the release/code structure
    • PCL has a build script, but I can't get it to work
    • You learn the 3rd party reliabilities
  • Ask, why are you there.
    • What happened so bad that I'm here

First steps

  • Automate the build / deploy
  • Should I jump into the code now?
    • Probably not
  • Check on the Version Control System
    • Is it being used, is it good, can it be improved, how's the structure
  • CI
    • Make sure it Compiles
    • Make sure it Executes
    • Then orchestrate Release Management
    • You want something you can instantly see
    • Only need a Bare minimum box
  • Code
    • Pair program is the best start
    • Path trace
    • New feature creation
    • Probably just going to end up thrashing
    • Style
      • Don't worry about changing standards
        • Standards are for consistency
    • worry about code flexibility
      • SRP, SoC, Coupling, Cohesion, Contracts
    • Automated testing
      • Was it TDD?
      • How do they run? Are they good?
      • Are they real unit tests
    • Take into account your release schedule before you start ripping apart the code
    • Goals
      • Be nimble, be quick, be agile

Social aspects

  • Dev team
  • Tech team
  • Testing/QA
  • BAs
  • Management
  • Clients! >:(
  • You can't force it down someones throat. They have to buy in.

Book

  • Brownfield Application Development in .NET

Notes

  • Remember the ramp up time
  • If your BAs know how brittle a piece of code is, you have a huge problem
  • If you are using DI then you have already broken your dependencies
    • Windsor on Unity
  • Enforce policies through culture
    • Sell people on the why
  • Working on code includes Unit Tests and Integration Tests
  • It's going to take you the same amount of time regardless of fixed budget / fixed time
  • Keep people apprised of where you are and if you're on time

Taming Software Dependencies with DI and IoC

with James Kovacs

Concepts

  • Dependency Inversion (IoC)
    • Higher levels should not rely on lower levels
    • Abstraction
    • Both should depend on something else (contract)
  • Dependency Injection
    • supply your dependencies to your objects
      • Through the constructor or through setters
      • Mandatory in constructor and optional in setters
  • Problem:The presenter needs too know about the dependencies below
    • Solution 1
      • Write a default constructor that sets up the dependencies
    • Solution 2
      • Use and IoC Container
        • At the core a dictionary
        • Static gateway from JP is a basic example of this
      • Windsor
        • Does dependency resolution
          • Autowiring
        • Lifetime management
        • Multiconfig options
          • Run-time config
        • Plug-ins

Dependencies

  • If you pull out a class, how many other classes do you have to copy over too

Notes

  • Don't fear the code
  • Wizards constrain you
    • MVC wizards is a good example
  • .Net Pet Has a lot of coupling
  • In DDD you use the language of the business
    • Use Submit instead of Save for example
  • Decorator Pattern
    • Add functionality on top of and existing class
      • such as logging
    • Could we have done WSDBLink as a decorator?
  • Use "`" in XML for Generics

Tools

  • MS Unity DI tool
  • Windsor - OSS DI Software
  • StructureMap
  • Spring.Net
  • Bindsor
    • Boo code to set up Windsor

AOP and IoC using Enterprise Library and Unity

with Erik Renaud and Francois Tanguay

Definitions

AOP - Aspect Oriented Programming
IoC - Inversion of Control
Enterprise Library - fills enterprise needs

IoC

  • Promotes SoC
  • Relies on external mechanism to do the injection
  • All about contracts (interfaces)
    • Between layers
  • Objects shouldn't know each other, just know about each other

AOP

  • Promotes SRP
  • Cross-cutting

Unity

  • Can do singleton with ContainerControlledLifetimeManage parameter
    • Thread safe
  • Can have multiple mappings with names instances
  • Can auto-wire construction dependencies and setter dependencies

PIAB

  • You have to be careful with the execution of attributes

EFPRS

  • Use DI for wiring
  • Use AOP for security and logging

Notes

  • Unit Tests
    • Arraign, Act, Assert
  • Ctrl+E+D - Reformat everything

Tools

  • Unity for IoC
  • PIAB for AOP