578 Chapter 13 • Creating a Message Board with ADO and XML
an OO-manner is whomever is developing the classes needs to take a lot of care to get it done properly, and be able to build it in such a manner as to not tie it exclusively to one type of user interface.
When deciding whether or not dotBoard should be procedural or ObjectOriented, take into account these things. First and foremost, you need to be able to maintain your code. If your code is modularized into multiple functions and organized very well, then the procedural approach doesn’t seem too bad. However, if your code is placed haphazardly throughout your application, finding your bugs and improving code at a later date might be harder. If your code is organized into a set of classes and public interfaces (the methods and procedures that an application can “see”), it is typically easier to maintain your code, as each piece of each class is a very small piece of the application as a whole, and making changes won’t likely take a large amount of code.
The other thing you should think about is that dotBoard is being written in VB.NET. For anyone who has built an application in straight ASP, you would probably be more comfortable with the procedural approach. For anyone who has built an application in ASP and created VB COM objects, you would most likely be more comfortable with the Object-Oriented approach, but feel some trepidation about speed and performance issues. For the master gurus out there who are building C++ ATL COM objects and using them in ASP, you might scoff at VB.NET and think you would rather stick with C++ ATL COM.Well, all of you have very valid points. A straight procedural approach is generally looked down upon in a professional environment,VB COM objects in ASP are typically regarded as slow and frequently memoryand processor-intensive, and well, nobody can read the C++ ATL code anyway, so it doesn’t count!
Seriously, though, every point made is very valid about every technology discussed.That’s where VB.NET comes in.The .NET runtime is remarkably fast. The Just-In-Time (JIT) compilation of your code only happens the first time it is executed; so, after that initial execution, your code runs incredibly fast until you change it (at which point the JIT compilation happens again).VB.NET is also a fully Object-Oriented language. It provides developers with every good OO technique available, and it is actually quite easy to write OO applications with it.
All that said, it’s pretty obvious dotBoard should be an Object-Oriented application. Don’t worry if you’ve never written any OO code before. ObjectOriented techniques are relatively easy to implement, and even if you don’t think you’ve ever used any objects before, you probably have (especially if you’ve done any development in ASP).