The Artima Developer Community
Sponsored Link

.NET Buzz Forum
You Couldn't Before, But Now Yukon...

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Tim Sneath

Posts: 395
Nickname: timsneath
Registered: Aug, 2003

Tim Sneath is a .NET developer for Microsoft in the UK.
You Couldn't Before, But Now Yukon... Posted: Sep 23, 2003 11:34 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Tim Sneath.
Original Post: You Couldn't Before, But Now Yukon...
Feed Title: Tim Sneath's Blog
Feed URL: /msdnerror.htm?aspxerrorpath=/tims/Rss.aspx
Feed Description: Random mumblings on Microsoft, .NET, and other topics.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Tim Sneath
Latest Posts From Tim Sneath's Blog

Advertisement

(groan)

I'm away this week in the south of France attending an internal briefing on Yukon / CLR integration prior to the PDC. Whilst the tools themselves have still got a little way to go before they're mature enough for production use, I've picked up a lot of things that are not covered in the current documentation.

One particular feature I've been experimenting with is user-defined types (UDTs), which allow you to create a custom type in C# that can then be used from within Yukon - as a column type, a function return value, a stored procedure parameter, a variable etc. There are some great potential uses for this - a few that sprang to mind include:

  • A Currency type that handles both units (dollars, euros, pounds) and the value.
  • A PostalCode type that could do smart things like validation and even generate part of an address automatically using MapPoint(similarly, a TelephoneNo type).
  • Many custom structures such as complex numbers, grid co-ordinates, and so on.

What really makes this feature work for me is that a DataSet could retrieve UDT values out of the database, and the same Currency class used in the database could be used in an application's business logic to manipulate it. This way, you always deal with the object in the same way, using the same methods whether you're using T-SQL or C#. In your database you can write:

        SELECT unitSKU, quantity, price::ToString() FROM Orders
    

In your code you can write:

        Label1.Text = price.ToString();
    

It's the same either way. You can even do things like operator overloading to ease usage of the class in C# and attribute that same function to make it more accessible from T-SQL. For instance:

        [SqlFunc("AddCurrency")] 
        public static override operator +(Currency c1, Currency c2) 
        { 
           // do stuff 
        } 
    

Lots more to say about Yukon - I'll start saving up some stuff to post during the PDC.

Now off to file some bugs...

Read: You Couldn't Before, But Now Yukon...

Topic: Fantasy vs reality Previous Topic   Next Topic Topic: RSS as a conversation mechanism

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use