March 3, 2008 spout writing

Programming WPF: “Programming Book of the Decade”

February 21, 2008 spout writing

Programming WPF enters 2nd printing!

Wahoo! You love us, you really love us! : )

When a book goes to another printing, 100% of the time, there’s a list of errata” (aka mistakes”) that are fixed in the new printing. In this case, neither Ian nor I have any fixes to apply. So, it’s official — the book is perfect! : )

Thanks for reading.

February 20, 2008 spout writing

Bridging object models: the faux-object idiom

My 1997 master’s thesis came online today (he says, trying not to flinch). Here’s the abstract:

Microsoft’s Component Object Model (COM) is the dominant object model for the Microsoft Windows family of operating systems. COM encourages each object to support several views of itself, i.e. interfaces. Each interface represents a collection of logically related functions. A COM object is not allowed to expose multiple interfaces using multiple inheritance, however, as some languages do not support it and those that do are not guaranteed to do so in a binary-compatible way. Instead, an object exposes interfaces via a function called QueryInterface(). An object implements QueryInterface() to allow a client to ask what other interfaces the object supports at run-time.

This run-time type discovery scheme has three important characteristics. One, it allows an object to add additional functionality at a later date without disturbing functionality expected by an existing client. Two, it provides for language-independent polymorphism. Any object that supports a required interface can be used in a context that expects that interface. Three, it provides an opportunity for the client to degrade gracefully should an object not support requested functionality. For example, the client may request an alternate interface, ask for guidance from the user or simply continue without the requested functionality.

COM attempts to provide its services in as efficient a means as possible. For example, when an object server shares the same address space as its client, the client calls the functions of the object directly with no third-party intervention and no more overhead than calling a virtual function in C+ +. However, when using COM with some programming languages, this efficiency has a price: language integration. COM does not integrate well with a close-to-the-metal language like C+ +. In many ways COM was designed to look and act just like C + + , but C + + provides its own model of polymorphism, object lifetime control, object identity and type discovery. Of course: since C+ + is not language-independent or location transparent. it was designed differently. Because of these contrasting design goals, a C+ + programmer using COM often has a hard time reconciling the differences between the two object models.

To bridge the two object models, I have developed an abstraction for this purpose that I call a faux-object class. In this thesis, I illustrate the use of a specific instance of the faux-object idiom to provide an object model bridge for COM that more closely integrates with C+ +. By bundling several required interfaces together on the client side, a faux-object class provides the union of the operations of those interfaces, just as if we were allowed to use multiple inheritance in COM. By managing the lifetime of the COM object in the faux-object’s constructor and destructor, it maps the lifetime control scheme of C+ + onto COM. And by using C+ + inline functions, a faux-object can provide most of these advantages with little or no additional run-time or memory overhead.

COM provides a standard Interface Definition Language (IDL) to unambiguously describe COM interfaces. Because IDL is such a rich description language, and because faux-object classes are well defined, I was able to build a tool to automate the generation of faux-object classes for the purpose of bridging the object models of COM and C+ +. This tool was used to generate several faux-object classes to test the usefulness of the faux-object idiom.

Enjoy.

February 6, 2008 .net

.NET Source Code Mass Downloader

On 1/16/08, Microsoft announced the ability to download some of the .NET Framework source code for debugging. This download process was only supported inside of a properly configured Visual Studio 2008.

21 Days Later: Kerem Kusmezer and John Robbins released a tool to download the source code en mass. Frankly, I’m surprised it took so long. : )

February 1, 2008 fun

I woke up today and decided to win the lottery

And so I did the only thing I could to do increase my odds — I actually played the lottery. (I blame my inability to apply this strategy for my lottery losings in the past.)

I did a little research and then went to two local Plaid Pantries to purchase the Oregon Lottery Trio.”

At the first Plaid Pantry, an thin, stringy haired older lady behind the counter blinked in surprise when she saw me and then laughed to herself.

I just saw your geek pin. It’s so subtle… geek…” she said. I wish I would’ve paid more attention to geeks when I was growing up. I only paid attention to the rockers.”

Well, that’s pretty common,” I said.

But they’re dumb and self-centered!”

Yeah, but they get all the girls…”

Well, I’m not a girl anymore and I prefer nerds. They’re more stimulating!”

Well,” I said. On behalf of the geek community, thank you.”

She smiled, handed me my tickets and I left proud of my geek heritage.

At the second Plaid Pantry, a crowd had formed at the front desk. I got to the front of the line and a little old lady with a plastic tiara was cutting into a homemade chocolate fudge cake. The lady behind the counter said, It’s her birthday! And we love her!”

Your birthday!” I said.

The birthday girl said, Yep, don’t you see my 65-year-old birthday crown?”

Lovely,” I said. Happy birthday!”

The lady behind the counter said, Well, no one was going to make a cake, so I did. That oughta be against the law.”

I agreed and placed my Trio order. On the way out, I was happy to have been even a short part of that woman’s birthday at the local convenience store where she was loved.

I decided to walk across the street to the locally owned coffee shop, tucked away off the main streets, fighting for survival against the Starbucks juggernaut. I walked in, said good morning to Ju, the owner and proprietor, who immediate started making my standard order. I haven’t been there for months, but he still remembered what I wanted.

It’s already been a good day. Think how much better it’ll be after they announce my winning numbers? : )

January 30, 2008 fun

Poetry Proclivities

I’m not a big poetry fan in general, but notable exceptions are Poe’s The Raven (especially the Simpson’s version), Dr. Seuss and Shel Silverstein.

However, I have to admit a certain fondness for the lowly limerick. I’ve done some composing, but the subject matter is often not something I’d want to post on my blog (“Hi, Mom!“), so when I ran into the rare clean one, I had to share:

A Limerick packs laughs anatomical
In a space that is quite economical
But the good ones we’ve seen
Very seldom are clean
And the clean ones so seldom are comical

I’ve seen geek poetry, geek activities as song parodies, programs as songs (genius!), but I’ve never seen a geek limerick. Got any?

January 18, 2008 tools

Configuring VS08 to Debug .NET Framework Source

Shawn Burke has released the details to set up VS08 to debug into the .NET Framework source code, including the following assemblies:

  • mscorlib.DLL
  • System.DLL
  • System.Data.DLL
  • System.Drawing.DLL
  • System.Web.DLL
  • System.Web.Extensions.DLL
  • System.Windows.Forms.DLL
  • System.XML.DLL
  • WPF (UIAutomation*.dll, System.Windows.DLL, System.Printing.DLL, System.Speech.DLL, WindowsBase.DLL, WindowsFormsIntegration.DLL, Presentation*.dll, some others)
  • Microsoft.VisualBasic.DLL

Others are coming. Thanks, Shawn!

January 17, 2008 spout writing

Bookscan says “Programming WPF” is #3 .NET book!


← Newer Entries Older Entries →