News, Keeping Up, and Work Bits

I finally listened to the keynote from PDC 2008. It was pretty good, nothing that I wasn’t really prepared for, but I’m sure a decent amount of cool things introduced for the Microsoft Developer out and about in the wild. I was glad to finally see the cloud computer official, etc. Overall I’m chomping at really getting into some of the other sessions related to the specific pieces of technology. Especially WCF, WF, and the whole middle tier pieces. I’m also keen to see what is done with the ASP.NET MVC Framework, and especially looking for to a real release finally.

Anyway, nothing I haven’t really blabbered on about before. In other efforts to keep up with technology and the architectural demands of the industry I often bounce over to InfoQ. One good listen recently was by Dan Pritchett of eBay. I’ll correct his title for him, “Designing for Latency“. Even though he’s one of those evil “architecting is a verb” people, he’s a good solid guy, and has some decent information to listen to and think through if you are building anything that might have latency involved. In other words, EVERYBODY!

In other news, Moore’s Law Has Changed, instead now we get cores instead of clock speed increases. While I’d still love some clock speed increases, it is nice to basically have a multi-core proc in every box these days.

PDC 2008 Kewl Bits

Check out this video. VSTS is going to rock a lot more. There are a few issues still that concern me, but the work flows and bug tracking are looking pretty good and improved!

At 28.00 minutes in they hit on how to prevent checking in a local change set that might break the build. Not like the “no you can’t check this in cuz you broke it” type of limitations, but it actually gives you information back on why it didn’t build correctly.

Other parts are the testing now automatically sends a video along with the bug, also a whole event log is sent along with the bug, and a whole bunch of other information pertinent to getting a bug fixed.

At 32.29, the “Layer Diagram” is shown. This is a new diagram and let me tell ya, that sucker will save some time in drawing out the dependencies! For debugging and presentation of an architecture. I’m digging this, all built into the TFS Toolset.

36.10 the Architecture Explorer is looking wicked too. This just brings home the idea that we developers are finally getting those promised 4th Generation Languages. Albeit they’re 5+ years behind, but they are arriving! The diagrams too, especially this layer diagram, is a beautiful thing to have that easily accessible. For a real kicker, check out the sequence diagram generated from code at 42:20.

For a real cool unit test bit, check out 46:10. That’s all I’m going to say about that…

Today’s Closing…

…That’s about it for today. I’m hoping tomorrow to have my Part 2 for the WCF known types & other bits finished and written up.

The Coolest Part of PDC 2008 So Far

I’ve been paying attention to the PDC 2008 Website and some interesting things, as one would guess, are coming out of the conference.  The two biggest pieces that I’m super stoked about are;  Microsoft is going to make Windows Live ID support Open ID, the other thing is this fancy spancy Windows Azure Cloud computer system.  This sounds like it could be pretty cool.  I’m not 100% sure I like it yet, but it does sound cool.

If you want to check out sessions, be sure to hit Channel 9.

Practices for WCF Data Contracts Part 1

Ok, now to the meaty section on WCF based Web Services.  This entry is about the data contracts that hold together and describe the data the web services offer across the wire.  These first few topics are solely on how to mark various classes, enumerations, and structures as a data contract.  In subsequent parts we’ll cover data sets, collections, and other ways to move sets of data across the wire.

The basic structure is like this:

   1:      [DataContract]
   2:      public class Note
   3:      {
   4:          [DataMember]
   5:          public string Body { get; set; }
   6:      }

.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, “Courier New”, courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

Pretty much any class that can be serialized or is serialized can be setup to move across the wire by this means.  Now what happens for some of the other types, such as a structure or a enumeration?  You can set those up like this:

   1:      [DataContract]
   2:      public enum Priority
   3:      {
   4:          [EnumMember]
   5:          Low,
   6:          [EnumMember]
   7:          Medium,
   8:          [EnumMember]
   9:          High
  10:      }

.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, “Courier New”, courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

and a structure:

   1:      [DataContract]
   2:      public struct TimeInfo
   3:      {
   4:          [DataMember]
   5:          public Int16 EstimatedHours { get; set; }
   6:
   7:          [DataMember]
   8:          public Int16 ActualHours { get; set; }
   9:
  10:          [DataMember]
  11:          public DateTime StartDate { get; set; }
  12:
  13:          [DataMember]
  14:          public DateTime EndDate { get; set; }
  15:
  16:          [DataMember]
  17:          public DateTime CompletionDate { get; set; }
  18:      }

.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, “Courier New”, courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

There are other properties of the attributes that can come in handy also.  Take this same Task Class as an example.

   1:      [DataContract(Name = "TaskItem")]
   2:      public class Task
   3:      {
   4:          [OnSerializing]
   5:          public void OnSerializing(StreamingContext context)
   6:          {
   7:              ClientKey = Guid.NewGuid().ToString();
   8:          }
   9:
  10:          [DataMember(IsRequired = true, Order = 1)]
  11:          public string ClientKey { get; private set; }
  12:
  13:          [DataMember(IsRequired = true, Order = 2)]
  14:          public string Title { get; set; }
  15:
  16:          [DataMember(Order = 3)]
  17:          public string Description { get; set; }
  18:
  19:          [DataMember(IsRequired = true, Order = 4)]
  20:          public Priority Priority { get; set; }
  21:
  22:          [DataMember(Order = 5)]
  23:          public TimeInfo TimeInformation { get; set; }
  24:
  25:          [DataMember(Order = 6)]
  26:          public Decimal Cost { get; set; }
  27:      }

.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, “Courier New”, courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

The Name Property replaces the class or member name and provides a name to use instead.  The others are IsRequired, which sets the property as required or not, obviously.  The Order Property sets the order in which the serialization will serialize the particular property.

In the above example there is also the [OnSerializing] attribute.  There are four events that occur during the serialization and deserialization processing of the object;  OnSerializing, Serialized, OnDeserializing, and OnDeserialized.  Any method tagged with the particular attribute of the same name, will allow the method to be triggered during that particular event.

Don't Get Shot by the Mac Bloods Yo!

Cuz u know, as pointed out here in the geek gang signs post, PCs are Crips yeah.

Needless to say I’m curious how things are going to go at PDC 08’, and definitely curious as to what all will be released or at least shown for the first time.  I know there is a ton of Cloud Computing stuff that will be talked about, also a ton of stuff related to the ASP.NET MVC.  The biggest things I’m curious about is how cloud computing and parallel processing will play into utilization in an SOA world.  Then of course, distributed Web Services are an interest of mine, so knowing how these things will play together makes me x-tra curious.

All have fun, and I’m looking forward to the reverberations, rumors, a random tidbits coming this way.

Code Paste Formatting Fixed With CSS

You’ll have to look back and check out my entry on how to get code displayed on a blog entry nice n’ smooth.  I did however add some CSS that cleaned up the display on the blog.  That snippet is below.

   1:  .csharpcode
   2:  {
   3:      padding: 5px;
   4:      margin: 5px;
   5:      border: medium solid #d0eb55;
   6:      overflow: scroll;
   7:  }
   8:  .csharpcode, .csharpcode pre
   9:  {
  10:      padding: 4px;
  11:      margin: 4px;
  12:      font-size: 1em;
  13:      color: #fff;
  14:      font-family: Consolas, "Courier New" , Courier, Monospace;
  15:      background-color: #414141;
  16:      line-height: 1.1em;
  17:      width: 720px;
  18:  }

.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, “Courier New”, courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }