What follows is the explanation. To think this through, we need to hold in our minds three things. First, there is the Windows API. By this I mean the low- level programming interface to Windows, as explained in books like Charles Petzold. It is primarily a C interface. Every Windows programming tool compiles code that calls the Windows API. Second, there is COM, which stands for the Component Object Model.
So what is COM? Essentially, it is a mechanism for linking software components together. It is a binary standard, so it works with compiled code at runtime.
COM is a family of technologies. Practical Fracture Treatment 5Th Edition. One of them is Active. X controls as found in both Internet Explorer and Visual Basic. There is also COM automation, used in Microsoft Office and elsewhere to control one application from another. A third COM standard is OLE (Object Linking and Embedding), used when you insert an Excel spreadsheet into a Word document.
Third, there is . NET. The . NET Framework is Microsoft. COM was replaced because it was failing. It is a tightly- coupled binary standard, which makes it frail for Internet applications. It is highly complex, which was one of the reasons developers were moving from VB to Java.
It also has versioning problems, causing software failures. By contrast, . NET has a loosely- coupled architecture, idea for Internet and mobile applications. It is also designed for ease of development, and has many security and versioning features that could not easily be added to COM. It is hard to understate the significance of Microsoft. I think we should assume that the company would not have done so if there had been a good alternative.
If industry politics had allowed, It could have moved towards Java rather than . NET, but the move away from COM was necessary in order for the Microsoft platform to remain viable. Today, with the family of technologies called Indigo, the extent of this move is becoming even more apparent. Indigo replaces COM+, the COM- base transaction server which is key to distributed Enterprise applications on Windows. Indigo is also the new standard for XML Web Services, message queuing, transaction management and remote objects, and even inter- process communications.
Indigo is built on the second version of the . NET Framework. So what has this got to do with Visual Basic? I assume that sometime around the year 2.
NET were coming together, Microsoft looked at Visual Basic 6. At the time, VB6 was a popular product, but also the source of considerable discontent.
Developers bemoaned its lack of full object- orientation and its many anomalies. Another issue was the VB roadblock.
Some things that you could do in C++ or in Borland. It was intended to be a language for high- level composition of low- level components, a glue language if you like. For this reason, VB created a highly successful third- party industry in components, mostly Active. X controls. These components were built mainly using C++, but used mainly from VB. Without Active. X, VB would have been severely underpowered.
VB gets its component abilities from COM. In fact, VB is built using COM. It is not just a good COM client or server; it is a COM product. The object- orientation in VB is that of COM objects, which is why it doesn't do inheritance (COM is based on interfaces). Create a class module in VB6, and look at its Instancing property. Would you like Public.
Not. Creatable or Global. Single. Use? These strange terms are COM features. In other words the technology on which VB was built was the technology . NET was replacing. There was no way VB could easily be adapted to become a .
NET language. Clearly Microsoft had to implement a new Visual Basic. However, it made what in my view was the only feasible decision. The company created a brand new product, maintaining compatibility with VB6 only where it could be done without damaging the new language. In one or two cases it maintained broken features in VB6 for the sake of compatibility (the strange array dimensioning comes to mind), but in general it made the new stuff clean. The new product solved many of the issues that afflicted VB6. It removes most anomalies, supports full object orientation, removes the dependency on a single IDE (VB . NET has a command- line compiler), and largely removes the roadblock, putting VB on a par with any other .
NET language. The compatibility problem However there was a huge price to pay, and that was compatibility. Imagine you are a large organization which has used VB6 to build applications that play a key role in your business. There are hundreds of thousands of lines of VB6 code. The database architecture is based on ADO, the last COM- based database model. Now Microsoft says that VB6 is the end of the line.
What do you do? It's a bad scenario, and not uncommon. Neither option is particularly attractive. Porting is a major effort, and your application developers have skills in VB6 and COM, not . NET. Interop is another idea, but often raises performance issues as well as tricky programming problems. Microsoft does of course offer porting tools. Frankly, these have an impossible task. They can help a little, but there are many inherent problems.
The main difficulty is not with the language, which converts reasonably well in most cases. The difficulty is with the class library, components, and GUI framework. The Visual Basic forms engine is nothing like the . NET Windows Forms library. Active. X controls work to some extent in . NET, but they are sub- optimal and often cause problems.
Worse still, advanced VB applications make considerable use of clever hacks and API calls which are bound to trip up any porting tool. Finally, COM has a totally different architecture to . NET. How is a porting tool ever going to re- architect your application successfully? Mitigating factors. There can be mitigating factors. In general, applications which are mainly non- visual will either convert or interoperate more easily than visual applications. Applications which use best practice in terms of separating business logic from presentation code, and which use an object- oriented design, will be much easier to migrate or maintain than those which do not.
However, even the best- written applications still have a problem. COM is not altogether dead.
Personally I like . NET. My general instinct when considering the future of a legacy VB application is to plan a new . NET or perhaps a Java application to replace it.
However, that is not always realistic. There is another option, which is simply to continue with VB6. Some people are spooked by Microsoft withdrawing support. In summary, mainstream support ended in March 2. Extended support, which is almost as good, runs until March 2. However, the real support for VB6 is in the community and on the Web. By now, almost everything is known about the product.
In addition, VB is (as we have seen) hugely extensible. You can call the Windows API; you can consume Active.
X controls; and you can create DLLs in other languages and call them from VB. There is of course a theoretical risk that Longhorn or some other Windows release might break VB, locking developers to old versions of the operating system.
However, this is vanishingly unlikely for the foreseeable future. Microsoft is not stupid.
Why would it wreck adoption for a future Windows release by breaking VB apps? Another factor is that Microsoft itself still uses VB.