ASP.NET Getting A Little Clearer
(Apologies in advance. This was intended to be a brief
treatise on where I’m headed with ASP.NET web development, but it
disintegrates into a wish list for a text editor that can handle remote
sites better than what I’ve found so far)
I’ve been working more with .NET lately. I found a fantastic free tool in the form of #develop
(AKA SharpDevelop), but I’ve been struggling with ASP.NET sites.
In particular, my experience so far has been in Visual Studio.NET 2003,
and it’s got some very definite ideas about how one should go about
building an ASP.NET web application.
The VS.NET way is to compile
all code into a single DLL file that lives in the /bin directory.
All pages inherit from this massive application DLL, and all code is
compiled into it. To make a change to a site, you load it up in
VS.NET, tweak it, rebuild, push a new copy of the DLL, and then the app
will reset itself thanks to the ASP.NET processing watching for updates.
I hate about this is that it makes everything monolithic. I grew
up (figuratively) doing ASP coding where each page was interpreted and
stood alone. Need to make a change to a page? No big
deal. Update the code, save the page, and you’re set. No
jarring restarts of the entire application. Easy to do the
code-save-verify cycle repeatedly. Heck, for some of my little
hobby sites, I do it all on the live server. The downside here,
of course, is that the presentation and the code get all wound around
each other, and some pages are exceedingly difficult to unwind.
seems like there ought to be a middle ground, and there is. You
can bask in the goodness of code/presentation separation by using
code-behind, but not bundle everything up into a single DLL file.
ASP.NET is smart enough to recompile the page when needed. (In
fact, Dino Esposito has published an excellent document discussing the conundrum of how code is built in VS.NET) That, to me, seems the right way to do ASP.NET code.
fact, I’m starting to think that the ideal would be to build a few
class-oriented DLL’s, or a library of support functions bundled up as a
class library, push those out to the /bin directory, and then
instantiate those suckers when needed within my ASP.NET pages.
That allows me to do test-driven development using NUnit on the meat of
the project (and to do it within #develop), and then use a simple
editor to build the ASP.NET pages. The downside here, is that I
haven’t yet found a nice editor to do ASP.NET development — one that
will connect directly to a remote server, can handle some form of
reflection to do easy code completion, and might even integrate some
kind of NUnit support like #develop does. At the very least, I’d
like to see something like a FrontPage on steroids.
you bash me for being a FrontPage guy, you need to understand how I use
it. FP is a pretty good text editor paired up with unparalleled
remote management capabilities. What I mean by that is that no
other program that I’ve found has the ability to connect to a remote
webserver, display a tree view of the files on the server, and make it
easy to open a file, edit it, and save it back to the server. If
you could add the ability to do reflection and code completion for .NET
stuff, that would be a killer development tool.
UltraEdit is nice
because of its ability to use FTP and/or SFTP to open up remote files
for editing, but it’s weak in that you always do it
onesie-twosie. You have to do an “Open from FTP”, browse the
server, select the file, and then open it. It doesn’t download
and display a tree view, and at least simulate a persistent connection
to the webserver. THAT’S what I really want. Anybody got a
tool like that? Even if it doesn’t know about .NET, an editor
that can do with FTP and SFTP what FrontPage does with a
FrontPage-extended website would be exceptionally cool.