ARCast.net - Non-Code Artifacts Approach Zero with Scott Hanselman
- Posted: Dec 21, 2006 at 8:56 AM
- 9,570 Views
- 1 Comment
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
What do you give to the architect that has everything? How about a grab bag of really good advice an interesting discussion with a very smart architect and fellow podcaster Scott Hanselman? This episode defies a single description because we covered so much ground but if you have ever listened to Hanselminutes you will know what I mean when I say that Scott is a very interesting guy to listen to. Scott and I led a pre-conference seminar at Tech-Ed 2006 in Barcelona called "Introduction to Software Architecture" and we caught up for a quick chat while in Spain.
-Ron
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
Oops, something didn't work.
What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in. You need to be signed in to Channel 9 to use this feature.What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in and view them all on your notifications page.sign up for email notifications?
[music]
[clapping]
[Ron laughs]
[Ron laughs]
[Ron laughs]
[Ron laughs]
So we're working on a project right now that is all about automating the deployment and management of our platform and Bryan is heading up that project and he keeps pushing us every time we want to create a document, he's saying, "Well how can I make that something declarative? How can I make that code, if there's a requirement that a business person wants?"
Well, like we talked about in the pre-conference, the home page should load in less than two seconds, you can write that in a word document all you want but when that doesn't happen, it's not the word document that's going to jump up and say, "Hey, the home page didn't load in time, stop, agghhh". That doesn't happen, right, so we need to have that bit of information, that expression of programmer intent, rather than being expressed in terms of prose, be expressed in code. So then if we express it in code or an XML file or something that is at least readable by the business person then we don't need the word document...
[Ron laughs]
A guy who I used to work with at Carillon who's no longer there, would always jump on us about parameters that come into our methods and would he say, "Could that ever be no?". Well, yeah, it could be no. "If it ever were, would that be a valid state?" Well, no. Well, assert that.
There's so much implicit things going on, implicit parameters right, when you have some global variable or some variable with wider than local scope that needs to be a certain way. This happens a lot in ASP.net applications because people use the query string or the forms or the cookie or HTP.context.current.items -- these are all implicit parameters.
Someone takes a perfectly harmless method like "do it," takes no parameters, maybe does two or three things and then exits and then they look like the climatic complexity of that particular method, they look at that and it says, "Oh it has a complexity of one" but it accesses 14 internal intrinsic variables and makes a lot of assumptions, that the system will be in a certain state, so the idea is to set the system up such that the only state that is valid is the successful state.
I had to work on a project once where I got the short straw so I had to do the deployment. You know, it's the job that nobody wants. I had to start analyzing what exactly has to go in this deployment. This team was not very good about tracking this. So, it turned out that I had to search through code to find everything, every little assumption they were making about a file will be in this certain location, a registry key will be set, and all of these things.
We had to kind of reverse engineer it. Eventually, though, what I ended up doing, was writing my own - this was long in the days before things like EndUnit - so I had to write my own little test harness though to basically do the install and run a whole series of tests on the install environment.
Our cries are not falling on deaf ears. I know for a fact that they are working on some stuff to make this kind of thing easier. I don't know what that will look like. I know it won't look like Application Center. I know it won't look like Systems Management Server but it will be something that will be able to say, "is this system healthy."
Now this guy Brian one time on the team at Corillian that has been thinking about this, has an interesting way to deploy our application. We have a large application and in its most-installed form can take, you know, a dozen MSI installers to configure.
It is kind of a hassle. It is a great run-time environment. It's a fantastic development-time environment. It just happens to have a mediocre install-time and we are trying to make it so much easier. It takes about a day to a day and a half to install. It's kind of like Exchange, right; you don't just bang out an Exchange install in 15 minutes. It takes thought.
So, one of the things that we are doing, which is a little unconventional, is we'll actually take an installed, completely configured system - not like a virtual disk, but just the folder, the Program Files directory - and we'll check that into Subversion. So we basically freeze-dry the system. Check that into Subversion and label it; call that "default".
And then all of the registry changes, decomp configuration, ackles, database, all that information, all that kind of implicit parameters, all that extra out-of-band information is then written up in PowerShell script.
I didn't want to use cloning or changing the SIDs and all that kind of stuff. I've got perfectly good boxes that are all set up. I just want to put a web site on that box.
I could have used DFS, distributed file system, that would have gotten the files over there but it wouldn't have got all the changes that were there. What Brian allowed us to do was, he said, well why don't we just check in the whole damn thing. That's where I said I don't think that is going to be possible. Of course he proved it two hours later that it was totally possible.
And it works great. What we ended up doing was using Power Shell. One of the things that is not included in Power Shell 1.0 was a remoting interface-the ability to invoke Power Shell commands on a remote machine.
So then we use some background jobs processing code that's very similar to the Unix background job processing to do distributed asynchronous work. We basically said "On these 25 machines, go off and set up that website."
There's a really great demo where a guy wrote... do you remember "Logo?" When we were kids there was a language they would let us play with on the Apples, Apple one or Apple 2, where it was called "Logo." You would say, "turtle-dot-right."
OK, so there was this thing called "Logo." Basically, you would draw things like fractal patterns, nano bots, you would learn about forward loops and stuff in very simple language, and you control this turtle.
So he added to this Power Shell. There's a text box where you type in the form loops and the different patterns. The way that you do that is you make a run space, and then you hand an instance of your dot net object, in this case the turtle object, and you hand that to Power Shell.
I can put Outlook on a string from outside of PowerShell but when I want to write a macro, I got to do it in on the inside. I have to do it in VBA. So, yeah, I think PowerShell would be a very clean way to do that.
Other kinds of things that you might want to automate, if you simply put stuff in WMI, or made things available as a.NET interface from the outside, you can automate as well. Like we've automated some things in VirtualServer because VirtualServer puts all this information inside of WMI. I had no idea. Like information about how hard the CPU is working, how full the virtual disk is. So you can go and say -- for every machine on this virtual server if any of them has a CPU greater than 50%, email me. Or whatever, you can go nuts.
This is the gauges that you would put on your dashboard. Then PowerShell is that rubber band that's helping you lash them all together.
I go and do a little one-line ad-hoc query, pipe it into a gauge, pick that gauge up drag it to the window's sidebar and dock it. Then I get to see the health of my system.
In C# 3.0 even though the language feels like it is kind of dynamic and early-bound, is it really? Is it the compiler that is doing this? Is it the jitter that is doing this? Is it the IL? Languages like Ruby are dynamic because they are interpreted. Languages like C# 3.0 are dynamic because of some of the funky stuff we are supposed to do just-in-time.
So we are starting to blur the line. Then as it starts to blur the line in the underlying compilers, what does that mean for us as designers and what we can, and should get away with, in our methods? Just because you can do something, does that mean it is the right thing to do?
I have had this article up on my blog. I think it is called "Data Sets are the Apawn of Satan and All That is Wrong with the World".
Speaking of that seminar that we did together, we had the seminars videotaped in the US and in Barcelona. I am releasing little clips of those in about 15 minutes chunks. on ARCast.TV. Now if you haven't seen the video version of our podcast show at ARCast.TV, let me encourage you to go download an episode and check it out. In fact, I think I may just feature the audio on a bonus episode sometime.
Hey, we'll see you next time on ARCast.
Remove this comment
Remove this thread
close