Mike Swanson

November, 2004

  • Mike Swanson's Blog

    Book Review: Expert C# Business Objects


    A few weeks back, I was talking to a fellow member of the West Michigan .NET User Group board, and we were discussing the architectural model behind the business objects that we used on the NxOpinion project. The more we talked, the more he said that our approach sounded similar to a framework called CSLA that he was reading about in Rocky Lhotka’s book, Expert C# Business Objects. He showed me an application that he was building using the CSLA framework, and I was intrigued.

    I’m familiar with Rocky’s name, and I’ve run across his books for years, but I had never actually picked one up and thumbed through it. Even a quick glance through his latest book interested me enough to purchase a copy. It sounded so much like the approach we had taken that I had to read someone else’s perspective. Along the way, I hoped to pick up some tips about areas that we haven’t had the time to expand upon.

    First, let me say that the publisher, Apress, lists a user level of “advanced” on the back cover of the book. Although I mostly agree with that assessment, I also think that with enough dedication, this is a book that can be understood by an intermediate developer. And I think that most of the intermediate developers that I know who write business applications using .NET should read it.

    Rocky’s book covers so much good material in its 791 pages, that it would be tough to summarize it in a short review. If you follow him through the whole book, by the end, you’ll have a reusable framework for creating “undoable”, bindable business objects that know how to validate and persist themselves either on the local machine or across a network. Although you could cut-to-the-chase and simply download CSLA from his web site, the power of this book is in following his thought process through the planning, design, and implementation of the entire framework.

    I really like the way Rocky explains why object-orientation is so important to building good business objects. By creating objects that know how to defend themselves from bad data, persist themselves to a database or other storage system, track multiple versions for undo support, and make themselves easily remotable, he shows the reader the importance of encapsulation and its effect on the maintenance and extensibility of the entire system. In my time, I’ve seen way too many architectures that depend on strongly-typed datasets for their “business objects” with poorly factored business rules scattered throughout every application layer.

    If you’ve ever wondered about serialization, remoting, custom attributes, security, or reflection, Rocky does an excellent job putting these technologies in perspective and provides the reader with appropriate prescriptive guidance about how and when to use all of them. Of course, you could read entire books about each of these technologies, but the point is that Expert C# Business Objects relates all of this to a practical and useful framework that almost anyone can understand.

    Although .NET Remoting is currently a controversial subject when it comes to Microsoft technologies, the principals and considerations that Rocky discusses are still germane. Keep in mind that with all of the noise surrounding Service Oriented Architectures (SOA) and web services, at the end of the day, functionality that meets business objectives and provides customer value is all that matters. Fortunately for CSLA, remoting technology is still supported in Indigo. However, prepare yourself for a little controversy if you get into a technical discussion about remoting versus web services and this framework.

    The writing in Business Objects is very good, and Rocky takes his time to carefully explain all of the concepts. Years ago, I had a side job doing technical editing for upcoming books, and I often wrote little comments about related tidbits of information that would help complete a thought or section. While reading this book, It surprised me how frequently I thought about something that would be useful, only to find Rocky mentioning it in the next sentence.

    After building the CSLA framework in the first half of the book, the second half of the book goes on to show how to use the framework in sample Windows Forms and Web Forms (ASP.NET) applications, as well as exposing functionality through a web services interface. He closes out the book with a chapter on reporting and batch processing, two areas where object-oriented architectures have commonly had performance issues. Overall, the samples are very practical. It’s easy to see how they align with “real-world” applications.

    If you find yourself struggling with application layering, or if you’ve always wondered how to implement undo functionality in a deeply nested object graph, this book will provide a perspective on at least one approach that has been adapted to take advantage of .NET. It’s apparent that Rocky has been refining his framework over many years, and even a casual search of the internet will turn up a number of articles related to CSLA.

    As I mentioned earlier, I think that an intermediate developer can benefit greatly from this material. Even if you don’t end up using his framework, this is an excellent book with a lot of very good instruction on design decisions and related technologies. You may struggle through some of the more technical sections, but even if you only pick up 50% of the material, it is a worthwhile read. I highly recommend this book for anyone developing business applications in .NET…and that’s probably just about anyone reading this review. Thanks to Ray for pointing this out to me.

    For related material, check out Rocky’s most recent .NET Rocks! appearance where he discusses the content in this book. Or, read through David Hayden’s chapter-by-chapter review.

  • Mike Swanson's Blog

    Greater Lansing User Group .NET Presentation


    Last Thursday evening, I gave my presentation on Taming the Software Development Process: Tools, Tips, and Techniques to the Greater Lansing User Group .NET (GLUGnet). It was well-attended, and I'm guessing that there were around 50-60 people there. From what I could tell, there was a mix of students from Michigan State University (where the meeting was held), some hobbyists, and a good number of professionals. A quick, informal survey of the audience revealed that approximately 1/3 of them were lone developers, another 1/3 worked on small team sizes of 2-5, and the remainder worked on teams of more than 5.

    Due to a scheduling mishap, both Tom Barnaby (of INETA and Intertech Training) and I were slated to speak. Tom was gracious enough to trim his presentation on Indigo to 45 minutes, and although I tried to trim my talk, I think I still came in at just over an hour. As many who know me will attest, I have a hard time keeping my mouth shut, especially when it comes to technology. The user group seemed to be very interested in both of our discussions, and I stuck around for a healthy Q&A session afterwards. I think I was there for almost an hour talking to the members and students before we finally had to leave.

    It was a great evening, and I'd like to thank everyone involved for the opportunity to present. Although the slides aren't as useful out-of-context, you can download them here.

  • Mike Swanson's Blog

    Half-Life 2 Review


    Well, it's been almost one full week since I purchased Half-Life 2, and in that time, I've managed to set aside around 18 total hours to play this game from start to finish. Valve has truly created an interactive masterpiece...one that will no-doubt set the bar for other first-person games for quite some time. In the process, they've created a top-notch game engine that renders stunning environments that put both Doom 3 and FarCry to shame. I'm very much looking forward to future games that leverage the power of the Source engine.

    Like many people, I spent about 40 minutes Tuesday night trying to connect to Valve's Steam internet service to activate my copy of Half-Life 2. I received various arcane errors that made it obvious to me that Valve hadn't planned very well for the onslaught of traffic they received on the first day. Needless to say, I was quite frustrated. Not only had I been waiting for 5+ years, but the box and DVD were in my hands! It surprises me that Valve doesn't have a 30-day grace period like Windows XP product activation. Anyway, after a bit of persistence, I was finally able to activate and fire up the game.

    I was elated to discover that I could configure the game to run at 1,920 x 1,200, the native resolution of my recently purchased 23" Sony LCD monitor. I was also pleasantly surprised to learn that the game recommended setting everything to "high" for my dual Opteron workstation. Running the video performance benchmark that's included with Counter-Strike: Source reveals that my system is capable of around 70fps at these settings...more than enough for smooth game play. I guess I made the right decision to delay my computer purchase until this release.

    Unlike the original Half-Life, Half-Life 2 doesn't include a separate training level. Instead, it introduces new concepts as you play the game. When you encounter a situation that warrants the use of a new feature, the system displays a short message on the screen telling you which key to press to access the functionality. They really did a good job with this, because the situations don't seem contrived, and they provide just enough to get you used to the new feature.

    There is a very deep sense of immersion into the environment. As I mentioned, the graphics are downright stunning. Even my wife (who isn't a game player at all) was impressed with the quality and watched me play for a little while. The shadows, light, and surface reflectivity all lend an air of realism to the scenery, and there are some scenes that are nearly photographic. The audio is also extremely good. I was immediately thrown back to the original Half-Life game when I heard some of the very familiar sounds. Also, the weapon effects have a satisfying depth that I found missing in Doom 3.

    On top of all that, the game physics add even more to the realism (courtesy of the Havok engine). For example, you can push and lift many of the boxes and barrels in the game world, and this capability is used for some very clever puzzles. You eventually get a "gravity gun" that allows you to pick up or push much heavier items like refrigerators, televisions, and rusted-out cars. There's nothing like "throwing" an old car at a group of approaching enemies and watching the ensuing rag doll physics. Priceless.

    Unfortunately, I frequently encountered the nefarious stuttering problem that has plagued so many players. But, unlike many of them, I decided to continue playing despite the fact that it tends to jar you away from the storyline. The only other negative that I can think of is the simplicity of game play on even the medium difficulty level. Although I had to replay a few areas many times, for the most part, it was nothing like my experience with Doom 3 or FarCry. This is a minor complaint, since it's still a fantastic journey.

    Overall, Half-Life 2 is an excellent title. If you're a fan of first-person shooters, or if you like interactive fiction, this is a worthwhile purchase. It's smarter and brighter than Doom 3, more moody and beautiful than FarCry, and miles ahead of Halo 2 (which isn't a totally fair comparison, since Halo 2 is limited by the aging Xbox hardware). This is truly one of the best games I've ever played, and as a matter of fact, it might become the first game that I play through a second time. Kudos to Valve for a very polished and immersive experience.

    If you'd like to read another perspective, I found Scott Hanselman's review to be both unique and insightful.

  • Mike Swanson's Blog

    Avalon November 2004 Community Technology Preview


    Don't know how I missed this interesting bit of news, but Andy Boyd mentions that the Avalon November 2004 Community Technology Preview is now available via MSDN subscriber downloads (255.39MB ISO). You can also find the WinFX SDK documentation online. From the download description:

    The Community Technology Preview Edition of the Microsoft® WinFX™ Software Development Kit (SDK) contains documentation, samples, command-line compilers, and tools designed to help you develop managed applications and libraries using WinFX, which is the set of next-generation managed APIs provided by Microsoft. This release includes the .NET Framework 2.0 and the set of presentation classes code-named “Avalon.”

    The Microsoft WinFX SDK requires the Microsoft .NET Framework v2.0 Beta 1 and the “Avalon” Community Technology Preview. In order to use Visual Studio 2005 Beta 1 to develop “Avalon” applications you must install Visual Studio 2005 prior to installing the WinFX SDK.

    Although I don't see it mentioned specifically, it's my understanding that this SDK works with Windows XP.

  • Mike Swanson's Blog

    Windows XP Media Center Edition 2005 Rocks!


    Okay...I have a confession to make. To-date, I've purchased four TiVo units, and I'm currently running the DirectTV DVR that includes the TiVo service. My wife and I are both TiVo addicts, our friends are sick and tired of us talking about it, and I firmly believe that it's the only way to watch TV. Yes, I realize that it runs Linux, but you know what? It's an excellent product, and they've nailed the user interface. However, although the standalone edition allows you to browse digital media, the DirectTV version does not, so we're left with only a partial solution.

    As you can imagine, I've followed our Ultimate TV and Windows Media Center releases quite closely. Believe me when I tell you that I'd love nothing more than to purchase our own stuff. However, I refuse to spend my money on something that I don't believe will offer me a real benefit, and until the recent release of Windows XP Media Center Edition 2005, I didn't believe that we were there yet.

    I had heard so many good things about the 2005 edition (for example, see Paul Thurrott's review) that I decided to try it myself. The software and hardware are now available for OEM sale which makes it much easier to evaluate (as a matter of fact, the software is also available to MSDN subscribers). I've always had a problem with the thought of buying a whole computer just to play back my media. Part of the reason I really like TiVo is because it's an appliance that requires no maintenance on my part. I already have a few computers to maintain...I don't need another one. And I didn't look forward to having a computer with all of its associated cables in my home theater. I want something that looks more like A/V equipment (frankly, like TiVo).

    Because of a recent computer purchase, I now have an extra P4 1.8GHz machine in need of a job. Although the video card doesn't have a built-in tuner, it does have S-VIDEO out, making it a perfect test machine. So tonight, I installed MCE 2005 and connected it to our home theater. The installation was a breeze, the configuration took only a few minutes, and the interface is easy to use from a distance. And even though it isn't an "appliance," Windows XP Service Pack 2 now allows me to configure the system for automatic updates which makes maintenance simple.

    So you can appreciate our situation, my wife and I have ripped over 1,600 CDs to a media server (WMA 192Kbps), we have about 9,000 digital photos, and around six hours of digital video. I'd really like to be able to browse all of our media on our 64" HDTV. We've tried a number of solutions in the past (like the Turtle Beach AudioTron, a good device, but not for that many songs), but we always gravitate back to the Media Center interface. It's clean, logical, and intuitive.

    Well, after playing with the interface and working with media over our 802.11g wireless network, I can tell you that we've finally nailed it with the 2005 edition. It's trivial to find music, even among 1,600+ CDs. We're both visual people, so we enjoy the ability to select CDs using the album covers. But, it's also easy to use the remote to search by artist. Response is snappy, and I'm pleased to find that my MSN Radio subscription works just fine. I'm not sure if I'd ever use it, but I am pleasantly surprised to find that my favorite blog reader, NewsGator, is one of the online services. It's also a straightforward exercise to configure network shares, so I can distribute media across more than one device. Slick.

    I'm sure that I'll eventually purchase something like the HP Digital Entertainment Center z500 series, because it looks and feels more like the appliance that I'm after. Couple that with a few of our new Media Center Extenders, and we can proliferate media throughout the entire house. Tell me...is there anything better than a gadget addiction!?

Page 1 of 3 (14 items) 123