# Friday, March 7, 2008

Next week I will be in Lisbon, Portugal speaking at Techdays 2008.All my stuff is listed in Portuguese, I hope they realize I don’t speak Portuguese. :)

Will be doing three sessions:

posted on Friday, March 7, 2008 5:43:57 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1] Trackback
# Thursday, March 6, 2008

I am on .NET Rocks today talking about distributed teams. Enjoy.

posted on Thursday, March 6, 2008 9:44:58 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] Trackback
# Wednesday, March 5, 2008

I have been working with web technology since the earliest days of the commercial web. I remember back about 15 years ago learning HTML and basically making a fool of myself with my personal home page and talking myself into a job at Fidelity Investments in 1994 saying I knew this thing called HTML. I remember about 13 years ago using raw ODBC via CGI scripts to make data from a database appear on a web page. Then came OLE ISAPI and life got a little easier-but you had to code the page yourself (like do all the response.* stuff that ASPx does automatically for you today).

What I remember for most of my time as a developer is how hard the web was to code for. Around 1995 I tried to tell customers (I was construing then) that the web was a passing fad to avoid building web apps. (they did not believe me.) The tools were immature (Visual Notepad 1.0) the IDEs just sucked (remember HotDog?) and all the APIs were out of process. Then along came a beta for IIS 1.0 sometime I think 12 years ago. I still remember where I was when I first saw it. I was in Chicago at a developer conference. Things started to get easier.

Back around 1996 programming for the web was better but still quite a challenge. At the same time, Java was threatening Microsoft. Netscape was the darling of Wall Street and the geeks. Microsoft's back was against the wall. There was an anti-trust lawsuit. People said that they were big and mean (and they were mean at times!) and could not adapt to the Internet. The Internet would make Microsoft unimportant.

Microsoft responded. Code named Denali, Active Server Pages and ActiveX Data Objects gave us an in-process way to code pages with a framework on top of ISAPI, gone were the days of having to write the pluming. Tools started to come along, Visual InterDev was a good first attempt and then the evolution of Visual Studio. The Java folkes were jealous of the MS IDEs. Coding for the web just got way easier.

This helped fuel the .COM boom. IIS was so innovative (the only web server at the time to be out of process), the IDEs were so much easier, and scaling to a web farm was so cost efficient, Microsoft set a new standard in web development. Microsoft technology lead the way during the boom, others were big players but by 2001 people were actually starting to play catch up to Microsoft when they put .NET to beta. How about that for not being unimportant?

Well fast forward 7 or 8 years.  I was at the New York Windows Server 2008, Visual Studio 2008, and SQL Server 2008 launch today and headed to Mix 2008 tomorrow. I look at the way we code web pages today and it is 10 times easier than the .com era! Maybe more!

The likes of Google and open source-ers have claimed that Microsoft is again unimportant. Goolge is the darling of Wall Street and the geeks. Linux and open source have their religious zeal. Microsoft faces anti-trust in Europe. Sure Google owns the online ad space. Great, they can have it. Wall Street and the lay press have stated that Microsoft is behind Google because it is in third place for Ads on the Web. They say that Microsoft was asleep behind the wheel. I beg to differ. Let's take a look at some of the technology that the boys and girls from Redmond have produced in recent months:

  • The .NET Framework and the 3.5 extensions (WF, WCF, ASP Ajax, and ASP.NET MVC Framework)
  • Visual Studio 2008, the slickest IDE out there
  • SharePoint
  • Silverlight

Not to mention all of the back end stuff like Windows Server 2008 and SQL Server 2008 all with supporting technology like LINQ and XLINQ.

Holy cow is developing for the web easy! Not only easier, but developers have more unprecedented power. When you compare the Java and Open Source offerings of .NET, Visual Studio, SharePoint, Windows, SQL Server, and Silverlight, there is no stack that even comes close in power and productivity. Not bad for the "unimportant" Microsoft.

Case in point. I started a new business in December. Something very speculative and it needed a large data driven user interactive transactional web site. Back 10 years ago, I would have had to make up some PowerPoint slides and beg angel investors for a few hundred thousand dollars to build out a proof of concept. It would then take six months to get to an alpha since debugging would consist of CTRL+G and counting down to the response.write("strSQL"). The UI was painful for users and very static.

Now due to infrastructure reasons like cheap bandwidth, outsourcing, and tools like Skype and IM, you can do this much cheaper. But Microsoft has made the development light years ahead of the .com era.

Remember my new startup? We have an Ajax enabled Microsoft .NET 3.5 ASPx site up and in customer ready beta today, in only two months. One architect, one developer, and one tester. That is 200% faster than my last startup Corzen which was built on top of the .NET 1.0 stack 6 years ago and 500% faster than a comparable web site build in the .com era for Zagat on the last ASP stack. All that and no begging any Angel investors, it was so cheap we paid for it ourselves!

Google may own Sillicon Valley and Wall Street, but Microsoft owns the majority of developers hearts and minds. They own it because they make our life so damn easy. Microsoft has thrown the web wide open to everyone. If you can get a new business started in 2 months on the Microsoft stack, think about all the great things that people will do!

Looking forward to the next stack in a few years from Microsoft and looking back at this current stack as slow and out of date like I do the .NET 1.0 stack. Maybe it will only take me 1 month to start a new business. :)

posted on Wednesday, March 5, 2008 1:01:06 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] Trackback
# Monday, March 3, 2008

I just got a new tablet PC and am loading it up for my upcoming trips to MIX, and TechDays in Lisbon, Portugal. When you load up a new computer you realize what you really need. So I figured that I would list them here, besides the common denominator of Windows, Office, Visual Studio, and SQL Server, here are the five pieces of software that I can't live without, software that I use on a daily basis:

1. Skype. I use Skype daily to drive the evil telcos out of business. For example I just loaded up Skype on my new computer today and had two conversations with people overseas for over an hour all for free. I pay for SkypeIn and SkypeOut and SkypePro, very valuable tools when I travel.

2. Netvibes. I use Netvibes to create a custom home page as my start page. It aggregates all of my RSS feeds as well as the typical sports, news, stocks, and weather.

3. Trillian. I use Trillian to have 1 IM client for all of my accounts: MSN, Yahoo, AOL, etc.

4. Snagit. Great for screen captures, great for telling developers what is wrong with their pages.

5. SQL Data Compare and SQL Compare. These tools from Red Gate software keep your SQL Server databases in sync. Invaluable!

posted on Monday, March 3, 2008 3:12:06 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] Trackback
# Saturday, March 1, 2008

Venue

Albany Marriott Hotel

189 Wolf Road

Albany, NY 12205  

Date & Time

March 12, 2008 9:00AM – 4:00 PM EST 

Registration Information: Click here

 

About the Conference

We invite you to join us for a day of developer-oriented technical sessions, featuring Application Lifecycle Management, Microsoft Silver Light 2.0, Building mobile applications with Visual Studio 2008, Windows Workflow Foundation (WF) and Windows Communication Foundation. These exciting technologies enable entirely new types of applications to be built in record time. With interoperability now available in today’s software development tools and platforms, understanding how to weave the various products and processes into a manageable and cost effective platform can be challenging. The session on Application Lifecycle management will tackle the licensing and process-centric questions that often arise in considering Visual Studio Team System 2008 for the first time, or integrating it into an existing Java or multi-platform environment. This session will also provide some best practices around developer desktop inventory management, integrating .NET and non-Microsoft toolsets; demystifying the decision-making process of Visual Studio Team System 2008. The session on building mobile applications with Visual Studio 2008 will explore the productive integration offered by VS2008 to enable product development and testing of mobile applications as well as exploring new additions to the mobile development platform. You will learn to create and integrate workflows into everyday applications using Windows Workflow Foundation. Discover the ability to create rich, visually stunning, interactive content and applications that run on multiple browsers and operating systems with Microsoft Silverlight 2.0. You will also learn about the benefits of Microsoft Silverlight from a developer perspective and get an introduction to building Microsoft Silverlight applications using JavaScript and C# using Microsoft developer and designer tools.

These sessions will target Developers, Architects and Web Designers be very much demonstration oriented, and will be delivered by seasoned developers with experience in Government and Public Sector. Seize this opportunity to immerse yourself amidst these exciting new technologies!

Who Should Attend

Developers, Architects and technical managers who wish to get an early look at the next advancement in Software Development. 

The Agenda

 

Time

Topic

08:30-09:00

Registration

09:00-10:15

Demystifying the Microsoft Application Lifecycle Management Platform

10:15-10:30

Break

10:30-12:00

Building Rich Internet Applications Using Microsoft Silverlight 2.0

12:00-13:00

Lunch

13:00-14:30

Building Mobile Applications with Visual Studio 2008

14:30–16:00

What's New in Windows Communication Foundation (WCF) and Windows Workflow (WF) in Visual Studio 2008 & the .NET Framework 3.5

posted on Saturday, March 1, 2008 3:00:07 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] Trackback
# Friday, February 29, 2008

Yesterday we discussed the changes to XQuery by allowing LET statements. Today the last XML enhancement is an "enhancement" to XML DML.

XML Data Manipulation Language (DML) is specific to MS SQL Server 2005 and 2008. It is a very useful feature that allows you to insert nodes to an existing XML instance, delete an element, or replace the value of (sort of an edit.) It works like this:

First let's create a table with an XML data type and insert a piece of XML into it:

Create table XMLTest1
    (
    Speaker_ID int primary key,
    SpeakerXML xml not null
    )

GO

Insert into XMLTest1
Values
(
    1,
    '
    <classes>
        <class name="Writing Secure Code for ASP .NET " />
        <class name="Using XQuery in SQL Server 2008" />
        <class name="SQL Server and Oracle Working Together" />
    </classes>
    '
    )

Now to insert an element into this table it is pretty easy, just use the XML modify method of the XML data type. Since our XML instance is in a SQL Server table we have to use the standard SQL UPDATE and SET syntax with a WHERE clause to get to the piece of XML in our table we are concerned with. You can see how easy it is to add an element to the table here:

Update XMLTest1
Set SpeakerXML.modify(
'insert
<class name="Using Linq to SQL" />
into /classes[1]'
)
Where Speaker_ID=1

If we select * from XMLTest1 WHERE Speaker_ID=1 the XML column looks like this now:

<classes>
  <class name="Writing Secure Code for ASP .NET " />
  <class name="Using XQuery in SQL Server 2008" />
  <class name="SQL Server and Oracle Working Together" />
  <class name="Using Linq to SQL" />
</classes>

SQL Server 2008 has an enhancement to this. You can substitute the XML element with a variable. For example let's create a variable here:

DECLARE @newElement xml
Set @newElement='<class name="ASP.NET Scalability"/>'

Now let's do the same insert as before, however, we will use the @newElement variable. This will enable you to select XML from other areas and stick it into a variable and then insert it into another XML instance. Here is the final piece:

Update XMLTest1
Set SpeakerXML.modify(
'insert
sql:variable("@newElement") 
into /classes[1]'
)
Where Speaker_ID=1

If we select * from XMLTest1 WHERE Speaker_ID=1 the XML column looks like this now:

<classes>
  <class name="Writing Secure Code for ASP .NET " />
  <class name="Using XQuery in SQL Server 2008" />
  <class name="SQL Server and Oracle Working Together" />
  <class name="Using Linq to SQL" />
  <class name="ASP.NET Scalability" />
</classes>

Not the greatest of new features, but a handy dandy feature to say the least.

posted on Friday, February 29, 2008 12:00:54 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1] Trackback
# Thursday, February 28, 2008

Continuing our discussion of XML in SQL Server 2008, SQL Server 2005 alowed us to use XQuery to query XML data in an XML data type.  You can use the FLWOR statements of for, where, order by, and retun, but not LET. SQL Server 2008 now has support for LET, which is used to assign values to variables in an XQuery expression. For example we are going to take the XML below and count the number of sessions per speaker using the count XQuery expression and assign it to a variable via LET.

declare @xml xml
set @xml=
'
<Speakers>
    <Speaker name="Stephen Forte">
        <classes>
            <class name="Writing Secure Code for ASP .NET "/>
            <class name="Using XQuery in SQL Server 2008"/>
            <class name="SQL Server and Oracle Working Together"/>
        </classes>
    </Speaker>
    <Speaker name="Richard Campbell">
        <classes>
            <class name="SQL Server Profiler"/>
            <class name="Advanced SQL Querying Techniques"/>
            <class name="SQL Server and Oracle Working Together"/>
            <class name="From 1 Server to 2"/>
        </classes>
    </Speaker>
</Speakers>
'
SELECT @xml.query(
'<Speakers>
{
for $Speaker in /Speakers/Speaker
let $count :=count($Speaker/classes/class)
order by $count descending
return
<Speaker>
{$Speaker/@name}
{$Speaker/count}
<SessionCount>{$count}</SessionCount>
</Speaker>
}
</Speakers>')

The result is shown here, notice that Richard sorts on top since we used the descending order to our order by and ordered by the expression we created via the LET statement. This is very helpful if you are manipulating simple XML and need to do a mini-transform via XQuery. I used to use the RETURN statement all the time to make slight manipulations to my XML, so I was waiting for LET. While this is the only addition to XQuery, it is a much needed and welcome one.

<Speakers>
  <Speaker name="Richard Campbell">
    <SessionCount>4</SessionCount>
  </Speaker>
  <Speaker name="Stephen Forte">
    <SessionCount>3</SessionCount>
  </Speaker>
</Speakers>

posted on Thursday, February 28, 2008 12:00:35 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1] Trackback
# Wednesday, February 27, 2008

Continuing our discussion from yesterday on SQL Server 2008 XML Enhancements, let's take a look at the XSD enhancement of Union and List types. In SQL Server 2005 you could define a simple type of xsd:list with an enumeration to require items in a list for any element that inherits that type. For example our XSD below will allow FedEx, DHL, and UPS for a shipping.

create XML SCHEMA COLLECTION dbo.order_xsd
AS
'<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <xsd:simpleType name="orderAmt" >
     <xsd:restriction base="xsd:int" >
       <xsd:maxInclusive value="5000" />
       <xsd:minExclusive value="1" />
     </xsd:restriction>
   </xsd:simpleType>
   <xsd:simpleType name="shiptypeList">
    <xsd:list>
        <xsd:simpleType>
          <xsd:restriction base="xsd:string">
            <xsd:enumeration value="FexEx"/>
            <xsd:enumeration value="DHL"/>
            <xsd:enumeration value="UPS"/>
          </xsd:restriction>
        </xsd:simpleType>
    </xsd:list>
    </xsd:simpleType>
   <xsd:element name="Order">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="CustomerName" type="xsd:string" />
        <xsd:element name="OrderDate" type="xsd:dateTime"/>
        <xsd:element name="OrderAmt" type="orderAmt"/>
        <xsd:element name="ShipType" type="shiptypeList"/>   
      </xsd:sequence>
    </xsd:complexType>
   </xsd:element> 
</xsd:schema>'
GO

DECLARE @xml XML(dbo.order_xsd)
SET @xml =
'<Order>  
    <CustomerName>Bill Gates</CustomerName>
    <OrderDate>2008-10-10T14:22:27.25-05:00</OrderDate>
    <OrderAmt>100</OrderAmt>
    <ShipType>DHL</ShipType>
</Order>'
GO

So this is cool, gives you some database lookup functionality, kind of third normal form Clemens Vasters style. With the new support for union of lists in SQL Server 2008 with xsd:union, you can combine multiple lists to one simple type. For example in our XSD below we allow the same strings as FedEx, etc, but also numerical values.

My example below is pretty basic, but this is useful if you have more than one way to describe something and need two lists to do so. One thing that comes to mind is units of measurement, metric and English measurements, so shoe sizes, US and Italian, etc.  This is very useful when you need to restrict items and are writing them from a database, etc.

Take a look at the demo for SQL 2008 below, notice that I changed the data to 1 from FedEx:

create XML SCHEMA COLLECTION dbo.order_xsd
AS
'<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <xsd:simpleType name="orderAmt" >
     <xsd:restriction base="xsd:int" >
       <xsd:maxInclusive value="5000" />
       <xsd:minExclusive value="1" />
     </xsd:restriction>
   </xsd:simpleType>
    <xsd:simpleType name="shiptypeList">
        <xsd:union>
            <xsd:simpleType>
              <xsd:list>
                <xsd:simpleType>
                  <xsd:restriction base="xsd:integer">
                    <xsd:enumeration value="1"/>
                    <xsd:enumeration value="2"/>
                    <xsd:enumeration value="3"/>
                  </xsd:restriction>
                </xsd:simpleType>
              </xsd:list>
            </xsd:simpleType>
            <xsd:simpleType>
              <xsd:list>
                <xsd:simpleType>
                  <xsd:restriction base="xsd:string">
                    <xsd:enumeration value="FedEx"/>
                    <xsd:enumeration value="DHL"/>
                    <xsd:enumeration value="UPS"/>
                  </xsd:restriction>
                </xsd:simpleType>
              </xsd:list>
            </xsd:simpleType>
        </xsd:union>
    </xsd:simpleType>

   <xsd:element name="Order">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="CustomerName" type="xsd:string" />
        <xsd:element name="OrderDate" type="xsd:dateTime"/>
        <xsd:element name="OrderAmt" type="orderAmt"/>   
        <xsd:element name="ShipType" type="shiptypeList"/>
        <xsd:any namespace="##other" processContents="lax"/>   
      </xsd:sequence>
    </xsd:complexType>
   </xsd:element> 
</xsd:schema>'
GO

DECLARE @xml XML(dbo.order_xsd)
SET @xml =
'<Order>  
    <CustomerName>Bill Gates</CustomerName>
    <OrderDate>2008-10-10T14:22:27.25-05:00</OrderDate>
    <OrderAmt>100</OrderAmt>
    <ShipType>1</ShipType>
    <Notes xmlns="sf">Steve Test 1</Notes>
</Order>'
GO

posted on Wednesday, February 27, 2008 12:00:16 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] Trackback