Microsoft
.NET for Programmers by Fergal Grimes and published by Mannig Publications Inc. is a
presentation of Microsoft's new .NET framework. The front cover contains the comment "The entire .NET,
presented simply and concisely using C# examples" is a sweeping statement
considering the rather modest (by programming book standards) length of 356
pages from cover to cover. Although one
must raise an eyebrow about the presentation of the entire .NET within the
books context, the examples were presented simply and concisely. The back cover says that Mr. Grimes "is
a .NET expert with 15 years experience developing diverse applications for
embedded, mainframe, client/server, and Web-based platforms." It goes on to state that he has both his
MCSD and is a Sun Certified Java Developer.
The preface of the book says that the intended audience of the book is
intermediate and advanced programmers.
Now
briefly about myself as to my qualifications to review this book. I have been programming database
applications primarily in Access and VBA for about 5 years. I have also taken a couple of courses in
beginning Java to broaden my horizons and begin gaining a grasp of a solidly
object oriented language. When the
opportunity was presented at a recent meeting of MAD to review this book I
jumped at the chance because I've been hearing that .NET is the new trend in
Microsoft programming.
The
reason I included the last paragraph is to help the reader understand the
importance of some familiarity with an object oriented language approach to
programming structure. Without the
basic knowledge of Java ( or some other OOP language like Delphi or C++) I
would have been lost from the beginning.
Mr. Grimes states up front and proceeds with the assumption that the
reader has a basic familiarity with the structure and syntax. He does include as one of the appendices a
31 page "Introduction to C#," which gives a brief overview of the
syntactical presentation of the various logical, mathematical and comparison
statements, creation of classes and structs, methods, exceptions, events,
interfaces, attributes and threading.
With a basic understanding from my Java experience, I was able to follow
his examples fairly easily.
The vehicle which he chose to present his
example code is a video poker machine.
At first this seems like an unusual choice for an example, but each
succeeding chapter made his model choice more clear. Many books of greater length talk extensively about various
programming aspects and devote only a small portion of the text to discussing
the handling and presentation of data.
I find this curious since most real life applications deal extensively
with data I/O and processing. The poker
machine example discussing data throughout the book. The model starts with an array of 4 suits with 13 cards
each. The player begins play by placing
a bet--user input. The program must
determine if he has enough credits to place such a wager--input validation. If the player has sufficient credits a hand
of 5 cards is dealt. These cards must
be subtracted from the deck array--memory modification--so they will not be
available until a new deck is created.
The player may chose to hold or replace any of the cards he has been
dealt in an attempt to improve his chances of getting a winning hand. New cards are dealt to replace those
discarded. Then the program assesses
the hand and awards points based on a pre-determined point system--data
evaluation and response. Further, the
program keeps track of the number of winning and losing hands and in the more
advanced model actually is capable of modifying the "random deal" to
achieve a more "desired" win-loss ratio. As you can see the poker machine becomes a strong microcosm of a
larger data processing environment.
Another
significant point of interest was the presentation of the varied functionality
and flexibility of the .NET structure.
Anyone who has been involved with Microsoft products for any length of
time has heard about the movement to develop a framework that would allow VB programs
to communicate with C++ programs; for Windows based applications to interface
with non-Windows based programs; for applications to be more easily ported to a
web based GUI. There's been COM, DCOM,
DNA all of which made strides in this direction and yet seemed to fail to
compete head to head with Java as a platform independent, web dynamic,
programming language. With .NET
Microsoft seems poised to make a significant challenge in this area of
technology.
In
the successive chapters, Fergal, who you recall is experienced in a variety of
application presentations from embedded to web-based, takes us through the
process of creating a simple presentation using a command prompt, builds a GUI
to present the information in a more attractive manner, adds graphics, and then
modifies it so several people can play at the same time. Ultimately he shows us how to convert the
application to a web based presentation without having to rewrite all of the
code to an HTML format. The beauty of
this progression is that the original objects change very little, only the
presentation becomes more sophisticated.
The
reason this is possible is that .NET relies on a concept called IL. IL is .NET's native language. It is a stack-based assembly language that
is fully compiled at load time. Because
of this, regardless of whether the original code was written in VB.NET, or C#
the Intermediate Language is the same and can be understood by an application
written in another language via the specific compiler. Currently there are compilers available for
C#, VB.NET, Jscript.NET, Cobol, Perl, Python, Eiffel, APL and others are
planned.
Fergal demonstrates this portability as he takes the
poker machine model and moves it through the various stages of application
presentation with minimal code modification.
Some of the transformations are even accomplished by calling on built in
system services which can reformat an object, i.e. from a windows based
presentation to XML for web presentation..
At one point in the book he states, "The historical division of
skills between Visual C++ component developers, Visual Basic graphical user
interface (GUI) developers, and VBScript/HTML web developers is a thing of the
past." (P. 11) As you read through
the remainder of the book, you realize that indeed the proof is in the
programming.
All in all, I found this book to play as
advertised. It was a straight forward
presentation of the breadth of .Nets extensibility. I believe that an intermediate or advanced programmer who is
coming to .NET from either a C++ or Java background would be able to take the
concise examples and move swiftly into knowledgeable productivity. For those of us on the lower end of that
scale, the capabilities described, and the range of development and
adaptability presented makes .NET a very attractive and dynamic tool to add to
ones programming skills.