I remember seeing a framework like that somewhere and wanted to give it a try, anything you can point me at for bypassing the Page class?
It's been about four years since I wrote that, so I don't remember what references I had at the time, but here's a reference that shows how to do essentially what I've done:
http://www.brainbell.com/tutorials/ASP/Implementing_IHttpHandler.html. Overall, it's really a very easy process, the hard part is then just designing your internal control structure that lets you emit HTML. I've basically got mine organized into an overall Page class, and then things WebLabel, WebTextbox, WebDateBox, WebEmailBox, WebListing, WebListBox, WebCheckbox, etc -- I think I have around 60-70 classes in all by now with that. That's the part that takes time, but you can make them super efficient and just do exactly what you want, which is cool if you're designing and coding a very long term system (or a framework for multiple systems).
I don't use their session state
I currently have my own as well but I was thinking of falling back on their Session object because it works with their Out-of-proc session management and the In-proc (where all static scope stuff is) dies every time we change any of the dlls. In my environment we often make dozens of code changes in the production environment every day, and everyone on the server losing their sessions dozens of times a day... but I could just do a db session and key it with the client mem-cookie that doesn't care about my dlls... hmm...
Yeah, using cookies or querystring you can have a session key (we have a set of three), and then it is always something you can look up in the database. This is the only way you can really do load balancing, as well. We have a cluster of front-end web servers, so that means that using anything in-memory that is not for building the current page is not possible, anyway. So that let's us swap in updated dlls whenever we want without interrupting users (and we frequently do).
I also don't use their viewstate
That was the first thing to go for me. I don't know if they've changed it yet but some of those data-bound controls actually *trust* the data coming back through viewstate when updating a record. I'm hoping I misunderstood that part, but even with security aside I didn't want that stuff in there.
Yeah, it's pretty crazy, and also so bloated.
I don't have WYSIWYG support in my classes
We never use it either, even though we've used Dreamweaver as the ColdFusion editor due to syntax highlighting and partial "intellisense" like functionality. I honestly wish I could disable Dreamweaver's design tab because it pops up sometimes unbidden.
Ah, yeah -- I use much the same thing in Visual Studio. In our case we have no raw html at all, just .NET classes that emit html based on our internal control structure. So it's all with strings, etc, in C#, and thus we get full intellisense and no design tab.
This is a half a million line of code system
Not sure what ours is up to; the core isn't that big, about 550KB of source code. A huge part of it is generating a ton of classes for each db table/column for each schema we develop, and the gen'd source for just two of the core DBs we use comes to ~4.3MB.
Ah, that makes sense, I see you are going with an OOP style database interface. We are all about the stored procedures, and handle our TSQL in a very different way from the upper-level C#. With all the crazy reports and aggregation and stuff that we have to do, that's the only feasible thing for us -- have to utilize the strengths of each platform, etc, etc. But I've seen the method you're using in the past, and have been intrigued by it. I'm too much of a TSQL junkie to ever really go that route, though, most likely.
so it's more important to be able to (...) enable reflection, etc.
I've gone out of my way to avoid the need for normal app code to use reflection, so barely any dynamic casts and tons of fairly complex constrained generic types (though most of the concrete classes don't need type parameters). My main concern was maintaining static analysis of the code so we don't get runtime type incompatibilities and whatnot (not that I have any right to complain about late binding when coming from ColdFusion) and secondarily I was concerned about performance.
We use reflection to enable dynamic class loading. That's a lot more efficient for us (with 2700+ pages in the system) than having a big factory method or something. We basically have one "page" in the system (rh.sh), and then a querystring key of "content" tells it what class to load via reflection. There are a few other uses for it that also really ease development for us. We don't do much in the way of late binding aside from this, so we don't get anything else beyond the expected "class not found" errors if someone makes an erroneous request.
That's also one of the reasons I'm not including LINQ: how do I control the number of trips it takes to the DB server, because those network connections take way more time than anything else? Functionally I love LINQ, but sometimes I really want to control _how_ it does stuff.
Oh, lord I would NEVER use LINQ with a database. I'm with you there. That's why I'm all about the TSQL, I totally love that control also. I really am just a fan of LINQ when it comes to interrogating in-memory classes and lists.
Anyway, I should sign off for the night, thanks for the discussion.
Keith
You bet! Thank you, as well.
Chris