In my humble opinion Microsoft made a slight mistake with the way they implemented ASP.NET in 2005. They should have split their documentation into at least three areas and defined a path through them that over time introduced newer and lower-level concepts as projects become more complex – and that this path should be kept independent from the whole certification framework and made generally available for everyone.
These three general areas should have been split into something like as follows:
- Small sites that require only the highest level knowledge of ASP.NET – essentially this would be what come’s out of the box as most people new to ASP.NET understand it.
- Medium complexity/size sites that require some control customisation and a greater understanding of the underlying technology. You could say that this is the point you start to wonder if ‘.ascx’ is going to do everything you want and maybe you might be considering a Web Service or two. You also may start to wonder if the 2005 version of web projects is cutting the mustard. You also find that class libraries are starting to look attractive.
- Larger sites that maybe could be called ‘Enterprise’ or ‘distributed’ solutions. Here you would require a varying knowledge of the platforms and technologies from intermediate to exceptional. You instantly discover that the nice fuzzy world of ASP.NET isn’t that fuzzy after all and in fact can become a hindrance. You have to work more and more outside of the nice cosy ASP.NET world and ASP.NET simply becomes a thin layer façade over the real work underneath. You may also start praising Microsoft for caving in to the real world and releasing proper Web Application projects as part of VS2k5SP1.
It is not that any of the above isn’t possible to construct with everything that Microsoft makes available, merely that there does not seem to be an easy path through the possibilities for people and many developers new to the ASP.NET platform, while finding the initial transition easier than with the previous versions of .NET, find that there can be a very steep learning curve involved if anything more complex than the ASP.NET based controls is required.
One of the largest issues I encounter is related specifically to this learning curve, especially with individuals migrating from ASP, PHP or Coldfusion (although admittedly this is becoming less of an issue with PHP as many PHP developers are happily embracing the OOP paradigm as the language grows). Even though Microsoft’s marketing is proving successful with ASP.NET’s take up being faster that at any other time, Microsoft is making technical transitions potentially difficult DUE to with their marketing and high level fluffy features available in ASP.NET.
That’s the thing though, it *is* easy to create basic dynamic web sites with ASP.NET using many of the advanced drag-and-drop features of the IDE, so initially ASP.NET comes over in the most part as a breath of fresh air and in fact, Microsoft has excelled here. However, if you do need to create something a little more complex than the statistical majority represented by the smaller-site implementations, you have to start to scratch and look beneath that shiny veneer; this where many find that under the shiny exterior ASP.NET can actually be a complicated beast.
ASP.NET reeks of one aspect of the KISS (Keep It Simple Stupid) principle. In order to make ASP.NET easy to use for the masses they have had to stretch and contort everything. Most of it is exceptionally clever and ASP.NET is a wonderfully powerful reflection and JIT compiler engine. It’s because of this end-user KISS based design that Microsoft have inadvertently made the ASP.NET internals a bit complicated. Also because of this ‘ease of use’ angle Microsoft has completely ignored in many instances (except for the Singleton for example) the entire OOP design paradigm from MSDN and more specifically ASP.NET.
This is a huge travesty that is giving me the most cause for concern at the present moment.
Many well intentioned and possibly very skilled Web Developers are missing the point to .NET because of this. .NET is Object Oriented! Why the hell is Microsoft not telling people how to leverage this paradigm? Why are so many developers being left out in the cold in this manner with .NET?
It is because of this issue that I and no doubt many, many other developers/architects ‘in the know’ are finding that they are being employed to work on projects or teams that are suffering badly directly or indirectly because of a lack of knowledge in OOP, .NET and how computers really tick.
Because I don’t have time to do something about the situation described above, all I can do is give some general pointers…
So those four steps to ‘.NET Web Development’ enlightenment are in my opinion as follows:
- Learn the basic pillars of OOP, ‘Encapsulation’, ‘Inheritance’ and ‘Polymorphism’ using the .NET language of your choice.
- Learn how to use the Gang of Four design OOP patterns with the .NET language of your choice
- Learn to think in these patterns so that when you are presented with a problem, you can state to other developers and business analysts the names of these patterns and why you think they are useful.
- Don’t use ASP.NET’s inbuilt tools simply for the sake of using them, they are sometimes too generalised and trying to be too many things for too many reasons.
- Never use the newer Website projects in VS2k5 – Install SP1 and use real Web Application projects. Convert them if needed. Get away from the VS2k5 website!
- Keep UI logic and Business logic separate. Don’t be afraid to use class library projects.
- Use Web Control library projects instead of ASCX’s if appropriate, especially if the controls are to be re-useable for other projects.
- Learn how your computer works; learn how .NET makes your computer work.
- If you don’t know:
- Why a string comparison is slower than an integer comparison
- That ASP.NET isn’t just a request/response based environment
- Why the Dispose/Finalize methods are so important and how the GC works
- How your computers memory and general IO works
And you are not interested in finding out, then to be quite blunt - stick to small websites!
- Learn why you should split Presentation from business logic and business logic from data logic.
- Get Lutz Roeder’s Reflector and don’t be scared to use it to view the internals of .NET. You may be surprised what you find and how it will improve your ability to leverage .NET.
- Be your own apprentice.
- Buy books and learn.
- Use gained knowledge and help others
- Goto point a - Repeat forever.