Gonzo blogging from the Annie Leibovitz of the software development world.

Category: Technology (Page 1 of 2)

Microsoft and the Open Source prediction

A long time ago, in a blog far, far away a prediction was made. Microsoft would be writing programs for Linux in 2004. Maybe today we’re one step closer to that vision.

Microsoft released the source code for the Windows Installer XML (WiX) developer tool to SourceForge under the IBM Common Public License or CPL. The WiX project is the first Shared Source Initiative to go “public” on Source Forge rather than a Microsoft site. It is also the first to use an externally created Open Source license. Microsoft supports the idea that a software developer should be free to choose how they license their work and for the goals of WiX, the CPL was the right fit. This does open up the creation of MSI type install packages and possibly will bridge the problem of cross-platform tools that need to install on Linux, Windows, and Mac. All someone has to do now is write an MSI installer for the “other” platforms and they’ll be a tool to build the installation package from a single XML file spec. Nice and slick and makes for installing software a breeze (especially if you count the cost of a package like Wise or InstallShield that Open Source projects can’t afford).

An interesting quote from the lead developer, Rob Mensching’s blog: “Today, via WiX on SourceForge, you get to see the results of many people’s efforts to improve Microsoft from the inside out. I’m not exactly sure what is going to happen next but I’m sure there are quite a few people who are interested to see where this leads.”

Much more detailed information available at MSDN.

VS.NET and the Microsoft Way…

I’ve been struggling with a “best practice” around setting up larger scale projects with .NET

The Web Project wizard in Visual Studio .NET is convenient for creating quick ASP.NET applications on your local machine, but in an effort to simplify your life, it also makes many decisions for you that are difficult to change if you need more flexibility. If you don’t create the virtual directory first then the wizard will automagically create on for you, based on the root of your web server (which is normally C:InetPubwwwroot). My biggest pet peeve with Web Projects is that you cannot even open a .sln file if the virtual directory mapping in IIS is not set up correctly. This becomes a problem with you have multiple users all trying to open the projects you’ve created.

One fix is to not share solution files, but when it comes to the ASP.NET applications, you always have to have the virtual directory setup first before you can open a web project. It’s all very frustrating and I still can’t find a good middle-ground between what you can do without shooting yourself in the head and having a well structured project directory layout. Microsoft has an article where they basically tell you to setup your physical directory first, then point a virtual to it, then create the ASP.NET project. I find this is the fasted way to open up a project as well, because VS.NET isn’t churning in the background creating the virtual directories.

There are some other tricks with folder structure because you can easily create a localized breadcrumb navigation trail with ASP.NET (there are several components out there) which is based on the directory structure. With UrlRewriting, you can direct the user all over the place and not worry about moving things internally. I think this is one the big downfalls with HTML and the Web. You move a link and your entire system falls apart. Some content managment systems (like Microsoft’s own CMS) fix this by storing everything in a SQL database and referring to the files through GUID like URLs, but a) it starts to look like Lotus Notes after awhile (if you’ve ever saw those Urls, they’re god awful ugly and long) and b) it still doesn’t really protect you and moving or changing something sometimes breaks things. There’s still some work there before that problem gets solved.

I think (and correct me if I’m wrong here) it should start with a Web project. The sequence that seems to have worked for me is this:

1. Create a physical directory (I refuse to call them folders) on the hard drive to hold the project

2. Create a web subfolder in this directory. This is where your web app will live.

3. Create a virtual directory to point to the directory you created in step #2 with your app name

3. Create a new Web application in VS.NET with that name. VS.NET will automatically save all your files to the physical directory you created in step 2

4. Create new class library projects and add them to the solution (for unit testing, data access, business functions, etc.) and put them somewhere in the structure (maybe a test or src folder off the root)

One trick I picked up this week (thanks to the guys at ThoughtWorks and some cool guys at CP) is to create one class library project called Core for all your system functions. Inside this project, create a folder called DAL, DTO, Domain, etc. to hold the classes for such. This way you can import one namespace into your tests and it makes it easy to reference everything else. Of course if you have to physically split some of the pieces (like the data access layer from your domain) this might be a problem. I’ve always put my DAL and Domain into separate projects. Not sure if that will be a problem with this setup but it does make things easier in the end.

I don’t think there’s any one real solution or “right” way to do things here. A rule of thumb might be to group logical sub-sections of your application in their own directories. If you ever have more than 10-15 files in one directory, maybe it’s a sign you need to improve your directory structure.

In the end, there is also motivation to have all directory structures the same on all developer machines, as well as having the same structure mirrored on an integration server (like one running your web server or Continuous Integration one). Makes for a simple migration from one environment to the next. Don’t even get me started on the whole namespace heiarchy…

Good (free) ASP.NET components

I’m really struggling trying to find some good free ASP.NET components on the net. I’m a strong believer (and follower) of not re-inventing the wheel and will fully conceed to someone who has already gone through the pain and suffering of writing a module that did something simple, like a drop-down menu, calendar pop-up, etc. I love writing custom components, but in a crunch when you need to do an app I don’t have time to write a nice re-usable thing. Maybe after the project is finished but not as part of it. Too much of a hit on the momentum that you’re trying to achieve.

Right now I’m struggling to try to find a good tab navigation component. I like navigation through tab panels, as long as there’s only a few. Some good examples of sites that use the tab approach would be GForge, MSDN, and Experts Exchange. I’m currently building a simple ExtremeProgramming (XP) tool that would track stories, iterations, tasks, and show some metrics in an agile type project. There are a few tools out there, but some are overkill and this one needs so many dependant libraries and technologies that even my Linux box would have a hard time trying to run it. A tab panel would be great for that type of thing so each area is split up into a separate page and you can easily see what’s going on and access everything.

I did manage to hunt down the ZmodemControls which look great. However when you actually get your grubby hands on it, it doesn’t work right. You can go into the collection and define the tabs and all that jazz, but the control has a bad habit of reverting back to it’s empty self, losing all your configuration. I even hand coded the menu collection (rather than using the collection editor) but after reloading the page the component (or VS.NET, or both?) just decided to blow everything away. Hmmm. That’s just not right.

There’s a great one here, that looks exactly like what I want. It’s in all JavaScript. Ugh. For an ASP.NET application, that’s just not right either.

The quest continues.

« Older posts