.NET 2.0 for Delphi Programmers - Chapters
Your Delphi experience makes .NET easy to learn.
I signed the contract to write a book about Delphi for .NET on May 10, 2002. I sent in my final draft of this book about .NET for Delphi programmers on February 9, 2006; I received printed copies on June 2, and Amazon is shipping copies.

Clicking on a section title hides and unhides the section. Page counts are from the final PDFs.

.NET offers what you've always loved about Delphi, without locking you into a narrow ghetto. [The 2002 preface.] [The final preface (and other front matter) as a 24 page PDF]
The CLR is the foundation for all of .NET. This section covers key concepts like managed code, the Common Type System, garbage collection, JIT-ing and CIL.
Chapter 1 - Managed Code
The system has type information for every structure in memory. This means that it can detect buffer overruns and mis-casting. 14 pages
Chapter 2 - The Object Model
Everything is an object - boxing &c. CTS allows any language to use the FCL, without a translation layer. It also allows objects and exceptions to be built into the core API, not layered on top. The CLS is a subset of the CTS that allows for language interop - C# objects deriving from Delphi objects and vice versa. (Examples of this.) 42 pages
Chapter 3 - Garbage Collection
Generations and performance. Finalization. Weak references. 22 pages
Chapter 4 - JIT and CIL
.NET is not interpreted. . NET compiles pre-parsed CIL to native object code when a method is first run, and then always executes that object code. This is about as fast as Delphi compilation, and actually generates somewhat better object code. CIL is a high-level, generic assembler. CIL is easier to read (and write) than x86 assembler. The System. Reflection. Emit namespace allows you to generate code at runtime. 24 pages
Like Delphi, C# is an object oriented language that avoids some of the more esoteric complexities of C++. That is, C# is 'less different' from Delphi than C++ is, and it's thus even easier to move between Delphi and C# than it is to move between Delphi and C++. This section is more a cross-reference than a tutorial, though it goes into greater depth on 2.0 features.
Chapter 5 - C# Primitive Types
Records and primitive types. Strings, arrays, enums, & boxing. 18 pages
Chapter 6 - C# Control Structures
Loops, conditionals, exceptions, foreach, lock, using, scoping, &c. 13 pages
Chapter 7 - C# Objects
Fields, methods, properties, inheritance, and generics. 39 pages
Chapter 8 - C# Interfaces & Delegates
Interfaces, delegates, iterators, anonymous methods. 21 pages
Chapter 9 - C# Topics
Attributes, pragmas, namespaces, main() method, partial classes, the @ escape. (A lightning overview.) 20 pages
Chapter 10 - Delphi for .NET
A quick-reference to the language changes in D8, Delphi 2005 and Delphi 2006. 33 pages

I had a bike accident Aug-31-2005, just as I had only this chapter, three appendices, and some front matter remaining on the first draft. I tore ligaments in my shoulder, and recovery took a long time. I was thinking of cutting this chapter entirely, as (since I don't use DfN) I'd have had to do a lot of research, and that would have delayed things even more. Fortunately, Hallvard stepped up and volunteered to do this chapter.

Learning the FCL is what makes you a .NET programmer. While you can stick to the VCL.NET compatibility layer, you really should only do so if you need your code to be portable between a native code Delphi and Delphi for .NET. If you use the FCL, your programs will be smaller, and they can take advantage of FCL functions that aren't part of the VCL. And, of course, learning the FCL is your ticket to freedom.
Chapter 11 - Strings and Files
Basic old-fashioned programming, the FCL way. String and regex operations; file, path, and directory operations; strings to streams and back. 48 pages
Free online chapter! Chapter11.pdf
Chapter 12 - Collections
The .NET collections classes are like Delphi's - just better. Arrays, lists, hashes, stacks & queues, generics, and foreach. 24 pages
Chapter 13 - Reflection
Discovery, manipulation and emit. Custom attributes. 24 pages
Chapter 14 - Serialization
Both persisting (to/from files) and remoting (between processes (on the same or different computer) or between application domains). 20 pages
Chapter 15 - WinForm Basics
Architectural and accidental differences between .NET forms and VCL forms. 17 pages
Chapter 16 - Graphics
Fonts, brushes, pens, bitmaps, regions; printing. 21 pages
Chapter 17 - Threads and Synchronization
Semaphores, mutexes, and critical sections; thread vars, [ThreadStatic]. Multithreaded desktop apps. 26 pages
Chapter 18 - XML
XML readers and writers; XML DOM; serialization; XSLT; &c. 16 pages
Appendix 0 - Unsafe C#
Pointer operator, fixed(), stackalloc, &c 7 pages
Appendix 1 - NUnit
A few pages of guide, and three quick ref tables. 7 pages
Appendix 2 - Assembly loading & signing
Strong names and versioning.3 pages
Appendix 3 - Config files
App config files. 2 pages
Appendix 4 - Glossary
5 pages
3 pages
top
Copyright © July 9, 2004..August 16, 2006
Jon Shemitz - jon@midnightbeach.com