Ask HN: Good open-source examples of properly tiered ASP.NET architectures.

5 points by WesleyJohnson ↗ HN
After working with ASP.NET (C#) for around 3 years, 2 of which was with a company that had no real solid architecture, I've realized that I have a lot to learn when it comes to creating properly designed Web Applications.

I'm wondering if anyone has examples of open-source software that I could study, tutorials to walk-through or even a good book to pick up so that I can better understand this process.

A lot of the work I did at the aforementioned job was a (small) step in the right direction with trying to separate presentation from logic, but in most cases the Code Behind files for our pages were tightly coupled with the Database structure. They did use a database management object to handle the actual database call, connections, command, data adapters, etc, but the page itself was still constructing the query and sending it off to the database object to fetch.

Towards the end of my tenure there, we outsource a new product to a very capable team based out of Boston and I had the pleasure of working with their code for integration purposes. This is what "woke me up" to how we were going about things all wrong. Their designs had calls out to a Business Logic Layer, which then called a Data Access Layer, which returned objects, collections or just straight DataTable/Sets depending on the need.

What I still struggled with, in my own designs, is what goes in the business logic layer and what goes in the data access layer. When to use objects and when to not, etc. I know those questions are somewhat subjective and based on the project at hand, but I'd love a really good example or book that covers these exact techniques so that I can be a better programmer.

Obviously, pseudo code examples and open discussion on the topic is also very much welcomed.

8 comments

[ 5.4 ms ] story [ 25.4 ms ] thread
The majority of the open source web applications out there are not going to be written in ASP.NET and C#.

I would suggest looking in to the 'codeplex' offering, if that's your flavour of icecream. Personally I wouldn't touch it with a 10' pole, but I don't think Microsoft Windows should be a server platform anyway.

If you're going that route you might as well get it from the horses mouth.

You make a good point that I won't find nearly as much in the way of ASP.NET and C# as I would on other platforms, but for now, those are indeed my flavors and will likely continue to be as most of the development jobs in my area are using Microsoft's solutions.

I appreciate the suggestion of Codeplex. I remember hearing and learning about that at a Tech Fest in Indy several years ago and had since forgotten about it, so I'll definitely be checking that out.

What about Dotnetnuke? As one of the biggest and most popular open source asp.net projects out there, I imagine their architecture to be very good.
Ah, yes! I had forgotten DNN was open source as well, thanks for the reminder.
My startup is using ASP.NET with C# I've decided to use the MVC framework. Its quite phenomenal! Working with the MVC framework is more like working with ruby on rails but using C# instead of ruby, you don't get the heavy intermingling of layers that you inevitably will get with web forms + code behind. In addition there is no more view state... in fact it is basically completely stateless. Test driven development is also possible. Right now its a free download. I should also note how great it works with jQuery .
I've heard good things about MVC, unfortunately I've been a little hesitant with exploring it. I worked with classic ASP for the first few years at my last job, before we started transitioning to ASP.NET and while I know websites really are (and should be) stateless, I've kind of grown accustomed to how ASP.NET works.

I suppose it boils down to the fact that there are so many technologies out there right now that it's almost overwhelming and I'm more comfortable with sticking what I know, and what's kept me employed. Still, MVC is something that I may look into as some point. The fact that it works so splendidly with jQuery is definitely enticing. I'm loving jQuery lately.

Also, I forgot to add, which company did you outsource to in Boston?
The name of the company was/is Envisa. I say is, because I presume they're still working on the project as it was quite the undertaking. Admittedly I didn't have much experience working with other companies in this fashion (outsourcing), but I can't commend them enough on their work. We had face to face meetings and conference calls for what was probably 3 months before they even got started so that they had a very solid understanding of what we needed. The had very detailed project outlines, timeframes, etc, etc. All the stuff I would imagine a legitimate and professional shop would have, but it was so amazing to me because of the processes we had in house that were drastically different.

Heck, they even set me up with a Virtual Machine, VPN and VSS access to the project on their network so I could actually get in there and help them on certain aspects. Setting up the VPN actually required them to reconfiguring their entire network due to IP conflicts and they did so without complaint. Just a real great group of people to work with.