Professional Documents
Culture Documents
1
6/9/2011
2
6/9/2011
3
6/9/2011
The Common Language Runtime (CLR) What does CLR code offer to your applications?
• prevents operations that could corrupt memory and
The CLR is a runtime environment that processes, executes, cause the system to become unstable.
and manages Visual Basic code.
It’s a little like the traditional Visual Basic runtimes (for • Automatically cleans up objects you don’t need.
example, VBRUN300.dll or MSVBVM60.dll), but with • Catches common mistakes & halts your program with
increased responsibility. an error, rather than letting it run on with scrambled
data.
• Compiles your code on the fly into native machine
code, ensuring optimum performance.
• Code that executes inside the CLR is called managed
code which works with CLR services & operates
under the CLR’s careful supervision.
4
6/9/2011
5
6/9/2011
Prebuilt Infrastructure
• Most internal business applications boil down to databases, web
development involves tackling site-management issues, & game
requires the traditional 3D-rendering engine.
• Microsoft has been successful designing some of the basic
infrastructure that we all need, creating such tools as ADO for
universal database access and COM+ for managing transactions. Web Services and the Next-Generation
• Microsoft’s philosophy is to supply the infrastructure, while the Internet
programmer writes the specific “business logic” that distinguishes
one project from the next.
• No Need to spend time wrestling with low-level details such as
state management, database-specific APIs, and messaging.
• The .NET Framework extends this philosophy with its common
class library. Here you can find cutting-edge tools for creating
everything from a Windows service to an ASP.NET web application
ready to serve thousands of eager e-shoppers.
Open Standards: XML, SOAP, WSDL, Metadata: The End of DLL Hell?
and Other Letters from the Alphabet
6
6/9/2011
Ten Enhancements You Can’t Live Without Ten Enhancements You Can’t Live Without
1. Visual Basic is truly object-oriented—at last. 6. Method overloading now allows you to create different
2. The new Windows Forms model for programming a versions of methods with the same name, but with different
user interface is more powerful than ever, and arguments. Visual Basic 2005 will use the correct one
bundles convenient controls for everything from automatically.
system tray icons to print previewing to web browser 7. Even critics can’t deny that the new development
windows. environment is heart-stoppingly beautiful. Does any other
3. There’s no automatic type conversion: Option Strict language offer collapsible code, intelligent dynamic help,
lets you turn off this dangerous “convenience.” and an entire programming language for creating macros?
4. Structured error handling makes it as easy to trap an 8. A new event model lets you connect multiple event handlers
error in Visual Basic as in any other modern to a single control and store function references in special
programming language. variables, called delegates.
5. ASP.NET provides the easiest and most powerful 9. Initializes let you set the value of a variable on the same line
system to date for programming web applications. where it is declared.
10. Metadata means that DLL Hell may finally be a thing of the
past. You can now set up a program just by copying its
directory—a capability that hasn’t existed in the Windows
Ten Changes That May Frustrate You Ten Changes That May Frustrate You
6. Older database access methods, such as RDO and DAO, are not
1. Arrays must always have a lower boundary of 0. fully supported. (For example, they can’t be used for data
2. Existing Internet projects using Web Classes or DHTML aren’t binding.)
supported, so you will need to rewrite them from scratch as 7. Even if you use the upgrade wizard, a great deal of code may need
ASP.NET applications. to be rewritten, including routines for reading from and writing to
3. There are no more default properties, so you can’t abbreviate files, and for creating printouts. In fact, for complex applications,
Text1.Text as just Text1. you may have to abandon the whole idea of migration.
4. The techniques you used in the past to print documents, draw 8. There is no way of accessing pointers. In classic Visual Basic,
graphics, read text files, and provide context-sensitive help have pointer access was dangerous and unsupported, but could still be
changed—get ready to learn these basics all over again. done by those who knew the “secret” functions, such as StrPtr()
5. There is no deterministic finalization. That fancy jargon means and ObjPtr().
that when you’re finished with an object, it may still hang around 9. Goto, Gosub, and line numbers are no longer supported.
in memory for some time until it’s cleaned out. As a result, you 10. The model for drawing on a form has changed. If you did custom
can’t rely on events that take place when an object is unloaded, drawing in the past, you’ll need to rewrite it from scratch.
because they won’t occur at a predictable time.
7
6/9/2011