Archives

Archives / 2008
  • Configuring WCF Performance

    Because the WCF team wanted to provide something secure out of the box and allow inexperienced developers to get up and running quickly, WCF will not perform well without tweaking. Here's a little help with the less obvious settings:

  • Entity Framework: Right Problem, Wrong Place

    I was listening to the recent .NET rocks episode about the Entity Framework advisory council and it was interesting to hear the team's point of view and the problems they are trying to solve with the Entity Framework. They have nice goals, but there is a fundamental problem here that some of the original database gurus like C.J. Date make quite clear. SQL is flawed. It's not that we need a million object relational mappers or that we need to look at our databases in terms of objects. In fact, that's the opposite of what the relational model was intended to do. When E.F. Codd invented the relational model, he intended for the database to be a collection of facts with relationships to other facts... not a collection of objects. The relational model was supposed to provide a way to look at and work with these facts in different ways, but SQL and modern RDBMS's fall short of what they were supposed to do. Somewhere along the way, the original plans were lost. Instead of building a truely relational storage system, vendors jumped on the semi-relational SQL model. The SQL model ties physical structure closely to the logical data model, which is where a lot of problems start coming into play. This leads to the situations we've all seen where we need to denormalize the data model to get decent performance numbers.  It seems to me that the solution to the problem should not start with mapping the data to objects, it should start inside SQL Server itself, transitioning from the flawed world of T-SQL to a true implementation of the relational model as it was intended, a world where the physical model is truely detatched from the logical model.

  • Agile Development: Warning Signs

    Alok Srivastava has an excellent post discussing agile development and areas that can put agile projects at risk. I'm currently doing clean up on an agile project gone south, and I wholeheartedly agree that the issues he points out should be warning signs if you are considering agile development. That's not to say that agile is bad by any means, just that you should think carefully before you make the jump, especially if your project will have the issues Alok mentions:

  • Making the Possible Impossible

    Have you ever gone to a restraunt with a menu that was just too big? Every once and a while I wind up at a place with a huge menu and it takes forever to choose what kind of food I'm going to eat. That's not a problem when I go to a steak house. When I go to a steak house, I know exactly what I want. A rib-eye medium well with a side of mashed potatoes. Removing options always makes it easier to choose the right thing.

  • NServiceBus = Fail?

    Finally had a chance to dig into the NServiceBus code. My thoughts are here if you care (I'm sure Udi will respond with his thoughts, so comment there instead of here if you think I'm off base):

  • My First Microsoft Interview

    I'm happy in my present situation, but working at Microsoft has always been in the back of my mind. So, when a recruiter for the Business Solutions division tracked me down, I was certainly going to find out more. The project sounded interesting enough, so when he asked if he could take it to the next level and ask some technical questions I said, "why not?" The questions he asked basically ranged from basic stuff everyone should know to basic stuff anyone who got a CS degree should know. I've been writing code just about every day for the past 15 or so years, starting with ASM. When I started out, I had an 8086 Zenith laptop with a CGA monitor that couldn't really do much of anything else. I actually wrote programs for quite some time inside the command line debugger until I managed to find some cheap assembler program at a local computer swapmeet. As a kid, I spent so much time programming that my mom would ground me from the computer, not from going out. My first first fight was with my programming buddy that "stole" my code and changed my copyright with a hex editor (Yeah, I learned that software piracy was a bitch before I could drive). Later, I got a bigger machine and moved on to C and then C++ and did a ton of work with the STL since those were still the days when Windows was still a DOS program :). These days, I write code literally from the time I wake up at 5:30 AM till I sleep (which usually results in far less than 8 hours of sleep). It's not that I have to. I just really enjoy it. I'll hit the clubs or go out on the town every once and a while, but most nights I'd rather be coding. But... I didn't get a CS degree. To the dismay of my teachers who all had their own ideas of what I should do, I was actually going to get a Theology Degree... I never could kick the programming habit though and ended up dropping out after two years to start a consulting company.

  • Protocol Buffers: Google vs. XML

    "Google (or at least some part of it) has now weighed in on the whole XML discussion with the recent release of their "Protocol Buffers" implementation, and, quite naturally, the debates have begun, with all the carefully-weighed logic, respectful discourse, and reasoned analysis that we've come to expect and enjoy from this industry.

  • Events are your Friend

    "Imagine trying to build a desktop application without events. How would you make a button click do what you want? One way would be to open the Button source code and add the code directly.  That has approach has obvious problems, not the least of which is that the behavior of the button click will vary from button to button..."

  • iPhone SDK

    Been playing a bit with the iPhone SDK lately. Fortunately, I bought a MacBook Pro a few months ago (with default boot to Vista since I rarely ever boot into OS X). If I could pick one word to describe the experience it would be "different." The whole Apple/Jobs culture even leaks into the developer platform. They really couldn't just pick a name like "Object" for example as the base class for various objects. Instead, they had to make it NSObject. Why the NS? It stands for Next-Step--which, as you may know, is the OS that Jobs worked on during his time away from Apple. On top of that, you can't just write an application for the iPhone. You have to get on a waiting list and be approved first. That takes about 6 months or so, after which you still don't have any promise that your app can get loaded on any iPhones. After you finish your app, you then have to submit it to Apple, who decides whether or not they want it on their iPhones. That's a hell of a lot of work to do before getting a yes / no answer (not to mention that even if you do get the app in the store, a cut of every sale goes to Apple).

  • Indisposable: WCF Gotcha #1

    When you have the code behind the service ready to go, you deploy it to the server of your choice and are ready to call the service. At this point, you will most likely do one of two things to consume the service: Create a ChannelFactory and reuse your interface, or use the "Add Service Reference..." option inside Visual Studio. Either way you go, you will almost certainly get the next part wrong... even if you know your shit when it comes to the rest of the .NET framework... [1]

  • iServiceOriented.com

    I'm starting up a new blog / website over at www.iserviceoriented.com. If you are considering transitioning over to a service oriented architecture, I'll help you make the jump. I don't have an ESB to sell or a product to muddy up the conversation with, just some practical advice to get you started.

  • Flash Lite on Windows Mobile

    Lots of people are pointing to the release of Flash "Light" on Windows Mobile by Microsoft and claiming that this is to "hold people over" until Silverlight gets here. That is just utter BS. Who the hell has ever used a Flash Light site on their phone? Hell, who really uses Windows Mobile to do any web surfing? Come to think of it, I don't think I've ever used a Flash "Light" site. Ever. From ANY device. This is certainly not something that is happening because users are demanding it and it sure isn't going to sell any more phones. More likely, this is a reflection of two things. First, Microsoft under Ozzie is making it a higher priority to support other people's products. Second, this could help limit the chances of another lawsuit over in EU land should Silverlight get big. By providing support for Flash "Light" well ahead of the Silverlight for mobile release, Microsoft is showing that it wants to win this fight fair and square.

  • Silverlight for Symbian

    "The two companies on Tuesday at Microsoft's Mix '08 conference are scheduled to announce that Microsoft will write a version of Silverlight for Nokia's Series 60 (S60) smartphone software that runs on Symbian OS. The software, which will be available later this year, will also run on Series 40 devices and Nokia Internet tablets. "

  • WCF: Getting ServiceAuthorizationManager and IAuthorizationPolicy to Work Together Properly

    When using WCF, you may want to integrate your security model into your application using claim based security. At this point, you will come across ServiceAuthorizationManager, which is responsible for evaluating policy statements to determine if the user is authorized to perform the requested operation. There is an interface, IAuthorizationPolicy, which you can implement to add your own claims to be evaluated by your ServiceAuthorizationManager implementation... there is one problem with this approach: the documentation you will find will most likely tell you to override CheckAccess in ServiceAuthorizationManager. However, if you merely override CheckAccess as in most of the provided samples, you will never see the output of your IAuthorizationPolicy implementation. As it turns out, the default implementation of CheckAccess sets up your security context as expected, but overriding CheckAccess will prevent this setup code from happening. Instead, override CheckAccessCore and your Security Context will be set up properly (the default implementation of CheckAccess sets up the context and then calls CheckAccessCore), or call base.CheckAccess as the first line in your handler to ensure that the basic setup of the security context happens before your code executes. This will save you hours of frustration.

  • Hard Code

    "The trouble is that qaulity and value are wrapped in perception. Even if we built a product that precisely matched the spec with zero bugs, customers and reviewers might still hate it. If it doesn't work the way they think it should, it's junk. If it doesn't solve the problem the way they expect, it's trash.

  • Silverlight Supercomputer

    Dan Fay pointed to an interesting article on CodeProject about building a grid computing framework that runs on Silverlight. The proposition is really interesting. Imagine someone like the folding at home (http://folding.stanford.edu/) project providing and embeddable Silverlight widget that people can place on their sites to help speed genetic research... or how about a little widget on your page that takes some of the load off of your server to help offset high traffic volumes? Just imagine how many teraflops a site like MySpace could output on a given day. Google could potentially use something like this to index the web or calculate page ranks via MapReduce and eliminate a large chunk of their server farm.

  • .NET Clipboard Problems Under VirtualPC

    When performing Clipboard operations (SetDataObject, SetImage, etc.) in a .NET program under VPC, you may encounter the error "Requested clipboard operation did not succeed." This error turns out to be a major pain if you are doing dev. in a VPC like mine, because 99% of your calls will fail. Every once and a while, you'll get lucky and one will go through (it seems to work if you go to another application, cut some text, paste that text, then come back and use the clipboard in your .NET app).

  • Designing a Generic Database Layer

    Some people like to automatically generate their database tier. Personally, I had enough bad experiences with ORM tools that I try to avoid them. After all, data tier code can be knocked out pretty quickly and it's always nice to know you didn't take any shortcuts. It's been a while since I've seen data tiers discussed, so I figured I'd pass along a modern approach that I have found works quite well and results in really clean data tiers.

  • How Silverlight Will Change the Way We Build Applications

      "...Don't make the mistake of tossing Silverlight in the same bucket as Flash. While they definitely compete in some significant areas, and both have real strengths in different areas, Silverlight 2.0 was created from the ground-up to be an application development platform equally friendly to designers and developers. If you're a .NET developer (or want to be), you'll find the .NET framework included with Silverlight to be extremely capable and powerful..." [1]

  • Rails is a Ghetto

    Zed Shaw, a former big time Rails dev, is leaving the community. He has a scathing rant of the community as a whole as well as ThoughtWorks. I must say that some of Zed's stories sound really familiar to when I was doing a lot of consulting work. There are a hell of a lot of bad customers out there that want you devote your life to thier projects, make them a ton of money, and not pay you back for your work. More often than not, it's because they don't really have any money to spend and they are simply trying to get rich quick off of some really bad idea, or some really poor execution of a fairly good idea.