Professional Documents
Culture Documents
46
Presented by
An Approach to a Multi-Boot
Windows Solution
When virtualization just isn’t an option
Coming...
March 13, 2006
New York City
www.ajaxseminar.com SEE PAG
E 43
FOR DE
TAILS
Marriott Marquis
Times Square, NYC
Presorted
Standard
US Postage
PAID
St. Croix Press
W W W . D O T N E T D E V E L O P E R S J O U R N A L . C O M
SUPERCHARGE
YOUR APPS WITH
THE POWER OF
LOCATION
INTELLIGENCE Enable Location Intelligent web services
110
Contact us at sales@mapinfo.com
DBA: “I suspect it’s your application server
code that’s causing the problem.”
App Dev: “It must be a database problem.”
Get a FREE “No more finger pointing” T-shirt. >> > > Learn more at www.radview.com/analyze
110100010110100010110100101010101000101101
00101010110100010110100011101001010101011
© RadView Software, Limited.All rights reserved. The Smart Choice in Web Application Testing
F e b r u a r y 2 0 0 6 Volume 4 Issue 2
����
Inside DNDJ 10
EDITORIAL
BOOK REVIEW
46
HOW MANY MANAGED
OBJECTS IS YOUR Pro ADO.NET 2.0
APPLICATION REALLY By Dennis Hayes ....................................................................... 48
CREATING? MONO
BY STEVEN PRATSCHNER
Mono 1.1.12 Released
By Dennis Hayes ....................................................................... 50
4 February 2006 • dotnetdevelopersjournal.com
���������������������
���
��������������
��������������
��������
����������������
��������� ���������������������� �����������������������
����������������� � ����� ���������� � ���� ������ ��
������������������������������� ������
��������������������������������������� ���� �������������������������������
��������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������������������������������������������
Editorial
w
Patrick Hynds phynds@criticalsites.com hen I was a kid, I Went to India (And All I Got Was
Open Source Editor remember someone say- This Lousy Book) in the mail. It is AUTHOR BIO:
Dennis Hayes dennisdotnet@yahoo.com
Product Reviews Editor ing, “If you like where written by Chad Fowler, is part of Derek Ferguson is an
Doug Holland doug.holland@precisionobjects.com
VB Editor you’re sitting, you had the Pragmatic Programmers series, associate director in the
Keith Franklin keithf@magenic.com better stay there!” They were refer- is subtitled “52 Ways To Save Your Information Technology
Smart Client Editor
Tim Huckaby timh@interknowlogy.com ring to a prediction that the Earth’s Job,” and is a must-read for anyone Group at Bear Stearns,
BizTalk Editor
Brian Loesgen brian.loesgen@neudesic.com population was going to increase interested in safeguarding his or a leading global investment
to the point that there wouldn’t be her career against the pervasive banking, securities, trading,
ADVISORY BOARD
dotnetadvisors@sys-con.com enough room for everyone to sit, so influence of our national economic and brokerage firm.
Derek Ferguson derekf@magenic.com we’d all have to stay standing for- decline.
Seta Papazian seta@sys-con.com
Jeremy Geelan jeremy@sys-con.com ever, or some such nonsense. One of the recurring themes 4derek@sys-con.com
Thom Robbins trobbins@microsoft.com
John Gomez John.Gomez@eclipsys.com As I got older, of course, I came of the book is that the job of soft-
Scott Hanselman scott@hanselman.com
Dean Guida deang@infragistics.com to realize that overpopulation was ware developer is rapidly chang-
John Sharp johns@contentmaster.com – or so I thought – strictly going ing in the West to be more of a
Jacob Cynamon jacobcy@microsoft.com
Chris Mayo cmayo@microsoft.com to be the problem of other, less management occupation. Those
Gary Cornell gary@thecornells.com
Joe Stagner joestag@microsoft.com “developed” parts of the world. of you who regularly read this
Peter DeBetta peter@debetta.com Since everyone couldn’t come here, magazine may recall that I liken-
Editor
Nancy Valentine nancy@sys-con.com they’d simply have to rot in whatev- ed this process (in DNDJ January,
Online Editor er god-forsaken holes in the ground 2005) to what has happened to
Roger Strukhoff roger@sys-con.com
they chose to call home. In the the nursing profession over the last
WRITERS IN THIS ISSUE
Jerry Dixon, Derek Ferguson, Dennis Hayes, Mark Hoskins,
Michael Kochanik, Pat Piccolo, Steven Pratschner, Ben Reichelt,
Vladimir Safonov, Kevin Wittmer
SUBSCRIPTIONS
“On the other hand, maybe it is the
end of life as we know it”
For subscriptions and requests for bulk orders,
please send your letters to Subscription Department
Subscription Hotline: subscribe@sys-con.com
Cover Price: $6.99/issue
Domestic: $69.99/yr. (12 issues)
Canada/Mexico: $99.99/yr. Overseas: $129.99/yr.
(U.S. banks or money orders). Back issues: $12/ea.,
plus shipping and handling. words of Ebenezer Scrooge, if they couple of decades. In the same
EDITORIAL OFFICES were going to die, they should do it way that hospitals employee fewer
SYS-CON Media 135 Chestnut Ridge Rd., speedily and decrease the surplus nurses and more low-cost “nurses
Montvale, NJ 07645
Telephone: 201 802-3000 Fax: 201 782-9638 population. aides” – which the nurses are
.NET Developer’s Journal (ISSN#1541-2849) is
published monthly (12 times a year) for $69.99 by Lately though, it seems as expected to manage – in the con-
SYS-CON Publications, Inc.,135 Chestnut Ridge Road,
Montvale, NJ 07645. though the rest of the world’s prob- tinuing battle to lower healthcare
Postmaster: Send address changes to: lems are coming closer and closer costs, so too will western software
.NET Developer’s Journal,
SYS-CON Publications, Inc., to home. September 11, of course companies continue to ship jobs
135 Chestnut Ridge Road
Montvale, NJ 07645 – like the sacking of Rome: bits of overseas.
Copyright © 2004 by SYS-CON Publications, Inc. trash from outside the empire’s The good news, of course, is that
All rights reserved. No part of this publication may be reproduced or
transmitted in any form or by any means, electronic or mechanical, borders finally managing to make for every three developers who are
including photocopy or any information storage and retrieval system,
without written permission. For promotional reprints, contact Reprint it across for a hugely symbolic half way around the world, there
Coordinator Dorothy Gil, dorothy@sys-con.com.
Worldwide Newsstand Distribution – if not, thankfully, hugely effec- will still need to be one developer
Curtis Circulation Company, New Milford, NJ
Newsstand Distribution Consultant: tive – attack on the empire’s heart. here at home to manage the inter-
Gregory Associates / W.R.D.S.
732 607-9941 - BJGAssociates@cs.com Consider the gas prices we see spi- face between software and busi-
For list rental information:
Kevin Collopy: 845 731-2684,
raling upwards as more hands com- ness needs. Almost every domestic
kevin.collopy@edithroman.com;
Frank Cipolla: 845 731-3832,
pete for slices of an ever-shrinking survey still indicates that good local
frank.cipolla@epostdirect.com
supply of pie; and, of course, the developers are in high demand, so
All brand and product names used on these pages are trade names,
service marks, or trademarks of their respective companies. SYS-CON
Publications, Inc., is not affiliated with the companies or products
threat of having all our jobs sent it could just be that the only thing
covered in .NET Developer’s Journal. .NET and .NET-based marks are
trademarks or registered trademarks of Microsoft Corporation in the United
to places where people have the we are losing in the process of glo-
States and other countries.
standards of living associated with balization is the excess baggage
SYS-CON Publications, Inc., reserves the right to revise,
republish and authorize its readers to use the articles gross overpopulation, i.e., “will that our industry picked up during
submitted for publication.
code for food.” the Roaring 90s.
It was against this backdrop that On the other hand, maybe it is
I recently received the book My Job the end of life as we know it.
10 4
Microsoft Excel 2003 for Group Publisher
Office Project Dummies Jeremy Geelan jeremy@sys-con.com
2003 Step by ADVERTISING
Step Senior Vice President, Sales and Marketing
Carmen Gonzalez carmen@sys-con.com
Vice President, Sales and Marketing
by Carl Chatfield by Greg Harvey Miles Silverman miles@sys-con.com
Advertising Director
9 3
Robyn Forma robyn@sys-con.com
Excel 2003 Gödel, Escher, Advertising Sales & Marketing Manager
Bible Bach: An Dennis Leavey dennis@sys-con.com
Eternal Golden Advertising Sales Manager
Braid Megan Mussa megan@sys-con.com
Associate Sales Managers
Dorothy Gil dorothy@sys-con.com
Kim Hughes kim@sys-con.com
by John Walkenbach by Douglas R. Hofstadter
PRODUCTION
8 2
Getting to HTML for the Production Consultant
Jim Morgan jim@sys-con.com
Know ArcGIS World Wide
Lead Designer
Desktop: Web with Tami Lima tami@sys-con.com
The Basics XHTML and Art Director
of ArcView, CSS: Visual Alex Botero alex@sys-con.com
ArcEditor, and QuickStart Associate Art Directors
Louis F. Cuffari louis@sys-con.com
ArcInfo Updated for ArcGIS 9 Guide, Fifth
Andrea Boden andrea@sys-con.com
(Getting to Know series) Edition Video Editor
by Robert Burke by Elizabeth Castro Ryan Palmieri ryan@sys-con.com
WEB SERVICES
7
UML Distilled: Information Systems Consultant
A Brief Robert Diamond robert@sys-con.com
Guide to the Web Designers
Standard Stephen Kilmurray stephen@sys-con.com
Wayne Uffleman wayne@sys-con.com
Object
Modeling ACCOUNTING
Language, Third Edition Financial Analyst
Joan LaRose joan@sys-con.com
by Martin Fowler
Accounts Payable
6
Betty White betty@sys-con.com
PROVIDED BY MCSE Accounts Receivable
Self-Paced Gail Naples gailn@sys-con.com
1
Training Kit: Design Patterns: SYS-CON EVENTS
Microsoft Elements of Reusable President, SYS-CON Events
Windows Object-Oriented Software Grisha Davida grisha@sys-con.com
Server 2003 Core (Addison-Wesley National Sales Manager
Jim Hanchrow jimh@sys-con.com
Requirements, Exams 70- Professional Computing
290, 70-291, 70-293, Series) SUBSCRIPTIONS
201 802-3012
70-294 by Erich Gamma
888 303-5282
by Dan Holme subscribe@sys-con.com
CUSTOMER RELATIONS
5 The Mythical
Man-Month:
Essays on
Software
Circulation Service Coordinators
Edna Earle Russell edna@sys-con.com
Linda Lipton linda@sys-con.com
JDJ Store Manager
Brunilda Staropoli bruni@sys-con.com
Engineering,
20th
Anniversary
Edition
by Frederick P. Brooks
������������������������������������
�������������������������������������
�������������������������������������������
������������������������������������������������������������������
��������������������������������������������
������������������������������������������������������������������
�
���������������������������������� ������������������������������
����������������������������������������������������������������������
������������������������������������������������������������������������
�������������������������������������������
��������������������������������������
4 ��������������������������������������������������������
����������������������������������������
4 ����������������������������������������������������������������
�����������������������������������������������������
���������������������������
4 ����������������������������������������������������������
�������������������������������������������������������� ��������������������������������������������
���������������������
4 ������������������������������������������������
����������������������������������������������������������������
������������������������������������ ��������������
���������������������
�������������
�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
Best Practices
i
’ve been a big fan of Note: The legality of this solution may would be a more powerful solution
boot loaders for the past depend on your licensing arrangements. than resorting to virtualization.
decade; whether its lilo This document in no way endorses So why don’t more people use
or grub or BootMagic, breaching your license contract and is multi-boot configurations? Quite
the ability to have multiple intended only for development, primarily simply, because it’s much less con-
bootable copies of Windows has within the realms of an MSDN subscription venient than just creating a new
always been a necessity to anyone or a VLE copy of Windows XP or Windows virtual machine. One way to set up
who works with beta software. The 2003. Your mileage may vary. a multi-boot configuration is to use
great thing is that with Windows XP a separate physical drive for each
Professional and Windows 2003, the instance. Another option would be
NTLDR has finally come of age and additional logging. In some cases, to split a single drive into multiple
can hold its own against the Linux beta software is more timing sensi- partitions, with an instance of
boot loaders. tive too. You don’t dare run beta Windows on each partition. Either
Why bother though? With virtu- software side by side with your way, it’s something that requires
alization software such as VMWare bread-and-butter development forethought and planning before
and Microsoft Virtual Server, you environment. At times though, you set up your workstation.
can just create a virtual machine to running it in a virtual machine Most seasoned IT professionals,
isolate different copies of Windows. makes it run far too slowly or not however, will tell you that setting
While this is true, virtualization at all. I have seen some beta soft- up multiple instances of Windows
comes at a cost: you can’t use your ware that slows down so much can be fraught with problems.
processor(s)’s full potential, and when run on a virtual machine It’s not that the process is difficult:
you can’t use all of your system’s that it appeared to be hung. This the Windows installer is perfectly
available RAM. By definition, you common scenario for beta software happy with configuring multiple
are sharing the system’s resources would be a good candidate for a instances of Windows on the
with the host operating system, multi-boot configuration. same workstation. The problem
BY PAT PICCOLO which also will impact perfor- Another scenario that doesn’t is that when the installation of
mance. In some cases, you may not fit perfectly into the virtualization Windows is done, the drive let-
be able to use your video or sound world is performance testing and ters of each instance of Windows
card’s full potential either. When analysis, or benchmarking. Here (other than the one on the first
these limitations are not an option, also, since the virtualized guest partition of the first drive) is some-
you may find setting up your work- must share resources with the host, thing other than drive C. So while
station with multiple bootable par- it’s difficult, if not impossible, to they will boot and run fine, many
titions is a better alternative. determine what bottlenecks really programs will not install prop-
It’s a given nowadays that beta exist in your code. Again, being able erly, or will cross-corrupt other
software runs slower than the to boot into a custom configured installations of Windows. This is
release version. This is often due Windows environment specifically because they make the assump-
to the overhead of debug code and set up for performance testing tion that drive C is the drive with
“The
great thing is that with Windows XP Professional
and Windows 2003, the NTLDR has finally come of age
and can hold its own against the Linux boot loaders”
Security should never be an inhibitor to new opportunity: Forum XWall™ Web Services
Firewall has been enabling Fortune 1000 companies to move forward with XML Web
services confidently. Forum XWall regulates the flow of XML data, prevents unwanted
intrusions and controls access to critical Web services.
Visit us at www.forumsys.com to learn more about how you can take your next leap
forward without increasing the risks to your business.
fo r u m syst e m s ™ – t h e l e a d e r i n we b s e rv i c e s s ec u r i t y ™
SQL Server 2005
A Point of Order
Organize your data with SQL ranking functions
s
equential numbers. Sooner ates a table-valued variable called The PARTITION clause provides
or later, you’ll find a process @OrderedRows that has three columns us with a very interesting capability.
that requires you to generate of actual data. The fourth column is an Without it, the ranking functions will
a series of sequential num- IDENTITY column, which is used to create sequential numbers across an
bers. As a matter of fact, most database assign an order to that data. An exam- entire result set. With it, however, we
engines provide at least one method ple of the output from such a table- can specify groups or categories that
of producing such numbers. Microsoft valued variable can be seen in Figure should be numbered. The number-
Access, for example, has AutoNumber 1. Each row receives a number, starting ing will then restart with each group.
columns, while SQL Server has with the seed number and increasing In addition, when the PARTITION
IDENTITY columns. However, these are each time by the specified increment. clause is used to create these groups,
features of tables. There are times when the ORDER BY clause applies to each.
you need some sequential numbers, In order words, each resulting group
but creating a table is inconvenient or will be individually sorted. Using these
inefficient. So how does one proceed? two clauses together, we can devise
How does one obtain a list of sequential numbering schemes that are far more
numbers without creating tables? complex than the IDENTITY clause
SQL Server 2000 has always pro- could ever produce. So, what does each
vided one answer. SQL Server 2005 individual ranking function do?
provides more. This month’s article will The RANK function assigns a rank
explain these capabilities in detail. We number to each row of the result set
will first discuss the SQL Server 2000 This technique has been available or group. The DENSE_RANK function
solution and then move on to SQL for years, and is still available in SQL does this too. The difference is how the
Server 2005. A total of four new func- Server 2005. Now however, we have two functions handle ties. Remember
tions will be introduced. These func- more options available. that the rows of the result set or group
tions, known collectively as ranking are sorted according to the specified
functions, provide a high level of control Ranking Functions ORDER BY clause. It is quite possible
over exactly how the sequential num- The four ranking functions, RANK, for multiple rows to have identical
bers are produced. As we will see, this DENSE_RANK, ROW_NUMBER, and values in the sort column(s). When this
eases the work on the part of the SQL NTILE, are very similar to each other. occurs, the tied rows will receive equal
developer. I will wrap up the discussion In fact, their syntax is almost identical. rank numbers – but how does the num-
by showing how sequential numbers As you can see in Listing 2, each func- bering continue afterward?
form the basis of a result set paging tion is followed by an OVER clause. This In Listing 3 I’ve created a query that
solution, and will demonstrate the solu- clause serves as a container for two lists some products and their associ-
tion in both SQL Server 2000 and 2005. subordinate clauses that do the actual ated categories. The rows inside each
work: the PARTITION clause and the category are sorted by ascending list
BY JERRY DIXON IDENTITY Columns ORDER BY clause. The PARTITION price. The rows are also assigned a rank
As mentioned earlier, SQL Server clause, which is optional, specifies the via the RANK function. This can be
2000 provides IDENTITY columns. field(s) or expression(s) that is used to seen in Figure 2. Notice that there are
Tables that use these columns will divide the result set into groups. The three products with the lowest price,
contain a list of automatically gener- ORDER BY clause, which is required, therefore there are three rows with a
ated sequential numbers. Because the specifies the sort order for each group. rank of one. The next row has a rank
IDENTITY seed and increment can be
specified, the developer has a mea-
sure of control over the resulting list
of numbers. However, in order to use
IDENTITY columns, you have to use
tables, which is not always desirable or
efficient. So, how do you get around this
requirement?
The answer is: you don’t. You use a
table-valued variable instead. Variables
are almost always faster and more
efficient than actual tables. Refer to
the code in Listing 1. This code cre- f1 Figure 1: IDENTITY f2 Figure 2: RANK
co-leader and frequent presenter query, with the results shown in Figure
at the Memphis .NET User Group. 4. You can see that, within each category,
Jerry holds the following Microsoft the numbering is consecutive with no
certifications: MCSD (VB 6.0 repeating values. The number does start
and .NET), MCDBA (SQL 2000), over when a new category is reached,
MCSA (Windows 2000 and 2003), which is one of the main reasons
MCSE (Windows 2000), MCAD that this function is different from an
(.NET), MCT. He resides in Olive IDENTITY column. Remember that the
Branch, MS with his wife and son. PARTITION clause is optional, though,
so we can use the ROW_NUMBER func-
4 jdixon@achfood.com tion to mimic an IDENTITY column. We
would simply leave out the PARTITION
clause. The advantage of this function f4 Figure 4: ROW_NUMBER f6 Figure 6: Paging, page 1
is that you don’t have to have a table in
order to obtain your sequential num- the number of rows in a group is not an
bers. The disadvantage is that the num- exact multiple of the NTILE parameter.
bering will always be consecutive – the
numbers will always start with one and Paging a Result Set
will always increment by one. IDENTITY Let’s see how a ranking function can
columns can have an increment greater be used to solve a real-world problem.
than one and can start with a number Many applications need to display large
other than one. (Pay special attention to lists of data. These lists are often far too
this ranking function though, because large to display all at once, so a small
we will use it in a real-world example page of data is shown instead. The pro-
later on.) gram typically provides some method of
The final ranking function, NTILE, is retrieving the next page, a prior page, the
a special case. The other three ranking first page, the last page, etc. This makes f7 Figure 7: Paging, page 2
functions produce sequential numbers the application seem more responsive
across the entire result set or group. and user-friendly. specified page, the ending row number
This function creates a specific number The key to this paging solution is the for the specified page, and the total
of subgroups, giving each row in the assignment of sequential numbers to number of rows in the Product table.
subgroup the same rank number. This the rows of the result set. These numbers The application can use this informa-
can best be seen with an example. The can then be used to calculate which rows tion to determine if it is displaying
query in Listing 6 produces the same need to be included on a specific page. the first page, the last page, or a page
product list that we’ve been using all With SQL Server 2000, these numbers somewhere in the middle. Next, notice
along. This time, however, a parameter are typically created via an IDENTITY that I’ve used a nonrecursive Common
of 3 has been passed to the ranking column. With SQL Server 2005, I prefer Table Expression (CTE) to simplify the
function. The parameter specifies the to use the ROW_NUMBER ranking func- code. (Take special note of the semico-
number of subgroups that should be tion. This allows me to create sequential lon at the end of the previous SELECT
created. Examine the results in Figure 5. numbers without having to resort to the statement. When a CTE is used in a
Notice that each product category has use of a table-valued variable. statement that is part of a batch, the
been divided into three subgroups and Refer to Listing 7. I’ve created a statement before it must be followed by
that each row of a subgroup has been stored procedure that accepts two a semicolon. For more on CTEs, refer to
given the same rank. Also notice that not parameters: a page number and a page the December edition of this column in
all subgroups have the same number size. This information will be used later DNDJ Vol. 3, iss. 10.) This CTE returns
of rows. The NTILE function will divide to filter the rows that get sent back to a couple of columns from the Product
the result set or group as evenly as pos- the caller. The first SELECT statement table, along with a row number created
sible, but some variance will occur when returns the starting row number for the by the ROW_NUMBER ranking func-
���������������������������������������
��������������������������������������������
��������������������������������������������
�������������������������������������������������������
������������������������������������������������������������
��������� � ����������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������� ������ �
���������� ������������ �����������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������
������������������������������������� ����������������������������������������������������������������������������������������
�������������������������������������������� ����������������������������������������������������������������������������������
��������������������������������
������������������������������������������������������������������������������������������������������������������������ ���������������������������������������������������������������������� ���������������������������������������������������� ������������������������������������������������������������������������������
� � � � � � � � � � � � � � � � � � � �
� � � � � � � � � � � � � � � � � � � �
SQL Server 2005
tion. I have omitted the PARTITION clause, because ond page, while Figure 7 shows that output. Finally,
I want a single set of numbers to be created across just to prove that the paging works as expected, the
the entire Product table. The next SELECT statement code in Listing 10 returns a 20-row page that contains
returns the Product information from this CTE, but the data from the previous two examples. Examine
filters out those rows that do not correspond to the the results in Figure 8, and you can see that the pag-
requested page. This ensures that only the desired ing is working properly.
number of rows is returned to the caller.
This solution returns two result sets: one that Summary
contains paging information and one that contains We’ve seen how the four ranking functions in SQL
one page of actual data. Programmers using ADO. Server 2005 can be used to create lists of sequential
NET can access the second result set via a call to the numbers. The numbering scheme can apply to an
NEXTRESULT method. If you don’t wish to return the entire result set, or it can restart each time a new
paging information, you can simply eliminate the grouping is encountered. In the case of ties, we can
first SELECT statement. In that case, the only result allow some numbers to be “skipped,” or we can
set that will be returned will be the one containing require that they be strictly consecutive. We can also
the Product data rows. cause rows to be segregated into a specific number
Now, we should test the stored procedure and of groups, assigning identical numbers to the mem-
verify the results. Listing 8 shows how to obtain the bers of each group. These new capabilities provide
first page with a page size of 10. Figure 6 shows the much-needed flexibility to the T-SQL language, which
f8 Figure 8: Paging, larger page output. Similarly, Listing 9 shows how to pull the sec- makes things easier for the SQL Server developer.
o
ne of the big buzz- for ASP.NET and show the differ- bly to the GAC if you are going to
words that rose to ences and similarities of them. I be using it in many projects.
fame in 2005 was will compare one of the earliest The way that Ajax.NET works
“Ajax.” The term “Ajax” libraries available: Ajax.NET and is also rather simple. There are
was first coined by Jesse James Microsoft’s ASP.NET 2.0 product, classes in the assembly that
Garrett in his essay “Ajax: A New code-named Atlas. are Attributes designed to be
Approach to Web Applications” As I started doing my research placed on your server-side
(www.adaptivepath.com/publi- for this article, I wanted to make methods in ASP.NET, of which
cations/essays/archives/000385. a grid in Excel that would com- the most important Attribute
php), and it refers to the use of pare these two products side is the “AjaxMethod.” When you
asynchronous JavaScript and by side, to see where they were apply this Attribute to your
XML to drive Web applications. similar and where the differed. methods, the Ajax.NET library
Rather than reloading the entire I found out rather quickly (and will then mirror that method in
Web page every time data needs against my assumptions) that your resulting JavaScript code
to be transmitted, only small, they were really not as similar on the client side. For instance,
necessary chunks are sent and as I had thought. I had tinkered if you have a method with this
received, with JavaScript manip- around with Ajax.NET last sum- signature “int Add(int x, int y),”
ulating the UI in response to the mer when it wasn’t quite as and you decorate that with the
data received. This gives the look mature as it has become, and I AjaxMethod attribute, there
and feel of a regular client appli- thought it was awesome. It made will be a resulting JavaScript
cation while still being hosted our Ajax development so much method on the client side called
inside of your Web browser. easier by hiding many of the “Add(x, y).” This is really all you
While Ajax methodologies have tedious details involved. Since need to know in order to use
been used for years – most nota- Ajax.NET worked so easily, I had this library to start making
bly in Microsoft’s Outlook Web assumed that Atlas would be Ajax-enabled Web applica-
Access – they have just recently implemented in much the same tions. The library contains the
BY BEN REICHELT become incredibly popular via way, but boy was I wrong! JavaScript necessary to commu-
services such Google’s Gmail and Ajax.NET is a simple instal- nicate to the server to call
Google Maps. lation. When you download the the appropriate method on the
Since Ajax has taken off library, you get a .NET assem- server, and then when the call
among Web developers, there bly and a Word document that returns to the client-side page,
have undoubtedly been many describes how it works, known it will execute a JavaScript call-
frameworks, APIs, and libraries issues, etc. In order to use Ajax. back method of your choice
to allow people to leverage Ajax NET you include a reference to the that contains the return value
with ease. I’d like to take a look assembly, aptly named Ajax.dll, from the server-side method
at two of these Ajax packages for each project or add the assem- call. Getting up and running
“Ajax.NET
and Atlas are both viable solutions for
adding Ajax functionality to your Web applications –
you just need to pick the right tool for the job”
�� ���������������������������
�������������������������
� �������������������������
� �������������������
� ������������ �
���������������������������������2�3���� ���������������
�� ��������������������������������������������
��������������������������� ��
��
�����������������������
���������������������������
�� ��������������������������������������������
�� ������������
���������������������� ��
��
�������������������������������������������������
����������������������������
������������������������������������������������� �� ��������������������
���������������������������������������������������������������� �� ������������
�� �������������
�������������������������������������������������������������������������������������������������������� �� ����������������������������������
�������������������������������������������������������������������������������������������������������� �� ���������������������������
������������������������������������������������������������������������������������������������� �� �����������������������
��������������������������������������������������������������������������������� �� �����������������
�� �� ����������������������������������
��������������������������������������������������������������������������������������������������������� �� �������������������������������������
������������������������������������������������������������������������������������������������� �� �������������������������������
���������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������
���������������������������������������������������������� �������� ����������������������������������
ALL RIGHTS RESERVED
� ��������������������������
�����������������������������������������������������������������
�������� ����������������������������������
���������������������������������������������������������������������� � ����������������������������
��������������������������������
�� �������� ����������������������������������
COPYRIGHT ©2006 SYS-CON MEDIA
������������������������������������������������������������������ � ���������������������������
�������������
������������������������������������������������������������������������� �������� �����������������������������������������������
����������������������������
������������������������������������������������������������������ � ����������������������������������������������
������������������
������������������������������������������ �� ����������������������������������������������
����������� � ����������������������������������������������
ASP.NET
AUTHOR BIO: with the Ajax.NET library is to ints and strings, you can return ASP.NET 1 or 2, because of its
Ben Reichelt is a software incredibly easy – you can practi- built-in classes to the .NET frame- simplicity.
developer for Magenic cally get it working by mistake. work like DataSets and Arrays, Atlas consists of server- and
Technologies Inc., a software An interesting side note about or even your own custom object client-side components to en-
consulting company based in Ajax.NET is that it actually uses types. This makes it extremely able Web developers to add Ajax
Minneapolis that specializes very little XML to work. Instead of easy to transfer data to the to their projects. These pieces
in Microsoft solutions. He has returning XML to the client and client and leave the burden of all work together to make Atlas
been working in software for then converting the XML into the rendering up to the browser. To feel very much at home in ASP.
three years and lives in Saint appropriate object form, Ajax. change the filtering or paging NET. Since Atlas was introduced
Paul, MN with his wife Erin. NET uses the JavaScript Object of a list on your Web page, for at this year’s PDC conference
You can catch up with Ben by Notation ( JSON) to send the instance, all you need to do is in September it has already
reading his blog at http://code- results to the browser. JSON is return an array of list items to undergone significant improve-
better.com/blogs/ben.reichelt. kind of like shorthand JavaScript the browser and it can loop ment. I tried to use one of the
– it’s a syntax of JavaScript that over the items and write the starter kits soon after Atlas
4ben.reichelt@hotmail.com allows you to dynamically define appropriate HTML code. By hav- was announced, but I could not
objects in your code. Ajax.NET ing your custom objects on the get it to work (this could certainly
simply returns a string as JSON client side, it allows you to pro- be a case of developer ignorance
code that gets run as a script on gram your JavaScript in a more as well). More recently, I found
the client side, and presto! – you object-oriented fashion, and it a great sample Atlas application
have your objects. The benefit also allows you to leverage the at Scott Guthrie’s blog (http://
of using JSON is that it needs no code you’ve already written on weblogs.asp.net/scottgu/archive/
parsing or serializing on the client the server side. 2005/12/26/433997.aspx).
side because it’s already in code Therefore what the Ajax.NET The sample application that
form, and it can also be less cum- library boils down to is that it Scott has created is a simple to-
bersome than XML, meaning the exposes your server-side meth- do list application that tracks
requests/responses can be that ods and objects to the browser your tasks. The sample is actually
much more efficient. The only so that you can use them in pretty full featured with paged,
downside that I can see is that it your JavaScript, and use them sorted lists and inline item edit-
makes your requests locked into asynchronously to give your ing, with no page postbacks.
a JavaScript implementation; that users a quicker, richer experi- What’s even more impressive
is, you can’t easily call a Web ser- ence on your Web sites. It is a is that Scott claims to have
vice that returns JavaScript code lightweight library with little written the app in 15 minutes
from a C# windows application, barrier to entry, and as I’ve on a plane! I highly recommend
but that’s a small price to pay for described above it’s easy to downloading Scott’s sample if
practicality. install and integrate it into your you are interested in playing
The Ajax.NET library was applications. around with Atlas – it’s simple
under some hot-and-heavy Microsoft’s Ajax product, enough to comprehend and it
development late last summer code-named Atlas, is currently shows the different kinds of
and early fall. It was created by in pre-beta stages and the most functionality in Atlas.
Michael Schwarz and he contin- recent release is the December The client-side component of
ued to improve it as the year CTP. Atlas is more than just a Atlas has several JavaScript files
went on, eventually adding library that makes Ajax Web that get included that provide
support for special controls applications easier – it’s really base functionality for Atlas to
that would make use of Ajax, a framework that sits on top of run in your browser. There is
JavaScript namespaces, and a ASP.NET 2.0 to provide built-in a browser-compatibility layer
whole JavaScript client library support for Ajax applications in to abstract the differences in
that gives you much more power ASP.NET. This is a key difference browsers’ JavaScript implemen-
on the client side. One of the between Ajax.NET and Atlas: tations. This ensures that Atlas
key features of Ajax.NET is its Atlas will only work in ASP.NET users aren’t restricted to Internet
ability to return complex types 2.0 because it leverages many of Explorer. Atlas currently works
from the server to the client-side the changes that have been made, in IE, Firefox, and Safari. Another
code; rather than being limited while Ajax.NET can be used in client script mimics the .NET
presentation classes”
ASP.NET Business Management,
eCommerce, and Dynamic
Internet Applications for over four
years, primarily using DotNetNuke
trols to handle the data entry for a new level by adding not only complete gen- components correctly, so a single as the development platform
table or columns, but you still need to eration of the stored procedures, DAL, primary key should be considered a since its conception in December
leave the business logic intact. This too CBO, and info classes, but also creates requirement when designing these 2002. In addition to desktop,
is handled by using an inherited stub the module project in its entirety. In tables for code generation. mobile and Web applications,
class as the generated business layer, fact, the module itself can be compiled • Foreign Key Constraints should Mark Hoskins has authored
so all of your custom changes can exist with the open source tool NAnt using be enforced between the related many articles and tutorials for
side by side without fear of losing the the accompanying build file included tables that directly correspond to developers on implementing
code when regenerating. in any ATGen SDK–generated module your module. These foreign keys and developing solutions using
The way that DotNetNuke uses package. are essential to the generation of a DotNetNuke and provides a
a Custom Business Object (CBO) to To those who are already familiar complete module that follows the wealth of resources at his flagship
supply a strongly typed class for each with code autogeneration tools, this rules set forth in your database. With domain, www.KodHedZ.net.
object is central to understanding the may not seem to be a revolutionary foreign keys fields, there is autogen-
DataProvider pattern. This class exists accomplishment, but the best part eration of the stored procedures that 4 kodhedz@shaw.ca
solely to house the public properties about the ATGen SDK is that it is filter the results to the foreign keys,
and the private variables that repre- completely free, and it is tightly inte- which saves considerably on coding
sent the results of the DataReader. grated with MyGeneration (which is later. For example, if you have a table
These types of classes are called info also free). Overall, the ease of use and named Pages with the three columns
classes, and for best results in a wide the lack of a learning curve to use the PageID (primary), PageName, and
variety of use cases they should be tool could allow someone without ChapterID (foreign key from the
stored in a separate assembly or any technical or development skills to table Chapters), the ATGen SDK
project than the rest of the module. quickly generate a complete, ready- will automatically create the stored
By storing these property classes in to-install module in under 10 minutes procedures and business methods
their own assembly you guarantee the from any existing database tables! to return the results by PageID or
utilization of these classes without Although this article is not ChapterID.
requiring a reference to the business intended to be a tutorial on how to
or presentation classes. In the ATGen use any of these tools, it is essential Understanding the DotNetNuke
SDK module structure, the info class- to understand the available products Module Structure
es are actually contained within the that can dramatically increase your There are many articles that can
central project for simplicity, which is productivity (for a complete tutorial be found at popular resource Web
suitable for most modules. on the AppTheory ATGen SDK, see the sites that are devoted to explain-
The CBO serializes these info References section). The remainder of ing the “why” of the Module File
classes into their respective types, the article will show the steps required Structure, and that explain the
passing the classes through the to plan, create, and implement a mod- necessary dependencies with
DataProvider to the selected ule for DotNetNuke, and demonstrate other assemblies in order to maxi- f1 Figure 1: Click on the
SqlDataProvider, or Access/Oracle/ how incredibly easy these tools can mize your module’s integration with AppTheory Icon to launch
MySQL provider. Until recently make your development cycle. DotNetNuke. Therefore in this part the ATGen SDK program
there was no definitive tool to aid
in the creation of these info classes, Designing the Database Tables
their accompanying logic classes, or Because the database is such a
their DataProvider methods, which central point of code generation, the
remained a cumbersome and time- tables must be created with a few
consuming burden for developers things in mind to produce the most
who were sure there was a better way effective, complete result when the
to spend their time. module is generated:
The DAL Builder from BonoSoft • Each table that will be used in the
is a popular application that takes a generation process must have a
defined data structure and produces single primary key field, which is
the data layer for you, and has become set to Auto-Increment. The ATGen
a popular and timesaving utility with SDK has a few problems with tables
a low price tag. The ATGen SDK from with multiple primary keys in that it
AppTheory takes all of this to a new does not generate the corresponding f2 Figure 2: MyGeneration running the ATGen SDK
SUBSCRIBE ONLINE!
Regardless of their experience level, .NET
fully selected for their prime Developer’s Journal assumes that everyone
reading it shares a common desire to under-
technical content – technical www.sys-con.com/dotnet/ stand as much about .NET – and the busi-
ness forces shaping it – as possible. Our aim
details aren’t watered down with or Call is to help bring our reader-developers closer
OFF $83.88
Wholly independent of both Microsoft Corporation
6999
.NET and Web services, .NET Developer’s Journal
Garbage Collection
How many managed objects is your application really creating?
ac[id] = rec; t2 Table 2: Performance statistics for two different approaches to string concatenation
t
his article is devoted to On the contrary, my viewpoint of understanding of the fundamental
my SPBU.NET educational the current software engineering is concepts. For example, concur-
project supported by as follows: now the time has come rency and multi-threading have
Microsoft Research in 2004 for commercialization (i.e., imple- been around since Prof. E. Dijkstra’s
and accomplished in 2004-2005. The menting in commercial systems and 1960s pioneering works on sema-
goal of the project was to develop a being used by millions of custom- phores; exceptions have existed
complex of educational materials on ers) of great ideas (like OOP, modu- since Prof. B. Liskov’s CLU language
Microsoft.NET, compilers, software lar and component programming, signal construct in early 1970s. It is
engineering, and operating systems, exception handling, etc.) whose interesting to emphasize that, as a
based on my 28 years of teaching foundations were actually laid in result, students themselves (even
and R&D experience at St. Petersburg 1960s and 1970s. without the teacher’s recommenda-
University. The results of the project In university teaching I use my tions) start doing the same in their
[1-6] are uploaded to the Microsoft own teaching paradigm referred to seminar presentations.
Developer’s Network Academic as ERATO, which is an acronym for
Alliance Curriculum Repository Experience, Retrospective, Analysis, Analysis
(MSDNAA CR) Web site in the form Theory, Oncoming perspectives Making critical and comparative
of presentations and lecture notes for (Erato is the name of the muse of analysis of the most important con-
four courses (in English) and materi- romantic poetry in antique Greek cepts and technologies when teach-
als of two seminars. The results have mythology shown in Figure 1). ing them is essential. For example, I
attracted a lot of attention and I analyze the Microsoft.NET platform,
received a lot of invaluable feedback Experience as compared to the competitive Java
from all over the world. My courses Experience consists of a descrip- platform, and explain the funda-
received good ratings, and my course tion of my long-term commercial mental reasons why .NET is more
on .NET [1] was recommended by and research software project general, open style, and prospective.
a Microsoft expert for teaching at experience in my courses. In par- I certainly explain to students that
Columbia University. ticular, from 1992 to 2002 I lead St. the authors of .NET have taken the
BY VLADIMIR SAFONOV In this article I describe my own Petersburg Sun projects in the com- best of Java, since .NET was devel-
ERATO teaching paradigm I’ve been pilers and Java areas. Since 2002 oped about five years later. On the
using in all my university teaching I started working with Microsoft other hand, I show the students that
work, the contents of the courses and Research on the Aspect.NET project .NET technologies have great back-
seminars included in the SPBU.NET [7-10], which I’ve already described ward influence on Java – in particu-
project, my experience of teaching in this journal in a series of articles, lar, it relates to the decision of Java
these courses and seminars (what and on Phoenix [11], within the founders to specify and implement
the most interesting and the most framework of the Phoenix Academic boxing, unboxing, and annotations
difficult parts were for the students), Program. These kinds of things (or metadata) in Java 1.5. This way
and then outline perspectives of fur- are of great interest to students, the students can better understand
ther development. and it helps to better illustrate the the dialectic nature of software engi-
concepts and principles that I am neering development.
The ERATO Teaching Paradigm teaching.
Many current tutorials and other Theory
teaching materials on software Retrospective This entails the provision of
engineering tend to represent the Retrospective allows for the theoretical definitions, justifica-
techniques that are taught as being consideration of the historical tions, known theorems, and issues
brand new and invented currently by background of each topic being relevant to the topic being taught. In
the commercial companies that are taught since its early origin, so particular, when teaching the con-
advertising them. that students may have a deeper cept of data type, I make a review
Advertiser Index
ADVERTISER URL PHONE PG
Application lifecycle management (ALM) Project persistence, agile processes, shared source code
Component-based design and reuse Ease of access, shared source code, peer review
���������������������
���������������������
������������������������
����������
������������������������������������������������������� ������������ �������������
����������������������������������������������������� �������
���������������������
���������������������
��������������
���������������������������������������������������������� ������������
���������� �����������������
������������������������������������� ����������������
���������
�������
������������������������
���������
����������������������������������������������� ���������������� ������������������
������������������������������� ������������������
���������������������
�������������
����������������
����������������������������������������������������������������� ������������
���������������� ����������������
������������������������
��������������������������������������������������������������� ������������������ �����������������������
������������������������ ������
�����������������������������������������������������������������������
����������������������������������������������������������������
���������������������������������������������������������������������������������
��������������������������������������������������������������������� ��������������������������
�����
������������������������������������������������������������������������
� � �
� ���������� ���� ��������������������������������������������������
��������������������������������������������������������������������� ������
���������������������������
��������������������������������������������������������������������� �������
��� ������� �������������������������������������������������������
��
����� ���
���������������������� �������������
���
�����
�����
� � ������
�����������
�������������
���������������������������������
� �
������������������
� ������������
COPYRIGHT ©2006 SYS-CON MEDIA ALL RIGHTS RESERVED NOTE: SPEAKER LINE-UP SUBJECT TO CHANGE WITHOUT NOTICE
���������
���
�����������
SOA
alignment with the goals of reducing the developers to register their compo-
development redundancy and having nents after development was complete
consistent enterprise architecture. to make them easy to discover.
The theory was that engineering
Some Focus Areas leads and project managers would occa-
According to the Yankee Group’s sionally search this library of compo-
“2004 Enterprise Web Service Study,” nents and reuse them if possible. Given
75 percent of the more than 400 US IT the amount of serious and sustained
organizations surveyed are planning attempts by qualified organizations and
to invest in SOA approaches over the smart people, the fact seems to remain
f1 Figure 1: What is changing in enterprise software development next 12 months. This seems reasonable that software reuse initiatives are rarely
because in any large-scale organiza- as successful as has been hoped. Many
directly rather than running their own tion, the concept of enterprise shared of these repositories ended up looking
copy of the software on their own sys- services that employ component-based like a kitchen junk drawer.
tems. Well, that might work for some design is not new and is easily under- The implication for SOA is that
applications that only need to invoke stood for its cost benefits. Often, “where the same fate can befall SOA service
that service a couple of times a minute, to begin” is the harder problem and registries. Whether is it reusing code
but what about other applications that reflects where open source processes or adopting a service, there are a lot
need to invoke it hundreds of times per might be applied. questions that potential users want to
second, or are in latency-critical situa- have answered before making a com-
tions, such as rendering a Web page? In Driving Adoption and Utilization mitment. Obvious questions are: What’s
this case we might option for building In the end, what makes for a suc- planned on the roadmap? Who is sup-
the software process as both an “open cessful Web service is fundamentally a porting the service? What are the known
standard” by giving it a Web services case based on whether or not anyone bugs and limitations? Who else is using
interface and as “open code” by pub- cares. Success is really a proof point it?
lishing the source and allowing it to be based on actual adoption and utiliza- The final decision is really about
run locally. tion levels. Successful open source proj- mitigating the risk of adoption. The con-
This example hopefully provides ects understand this point and invest sumer might feel more comfortable if,
an appreciation for the application of some significant percentage of effort to through the interaction with a service’s
open source principles in an attempt to support and grow the COI around the associated COI, they can get a sense
address a complex issue. In addressing project. There is a strong correlation for the service, its user base, and pos-
the cultural problem, we could adopt between how open source COIs grow sibly even the consumer’s own desire to
a community-based development and how to succeed in creating highly become a contributing member of the
approach in which business systems successful SOA components. project. The probability of adoption and
owners collaboratively participate in the A case in point is discovery. The the actual utilization of a service can be
development of a new solution. Such question is whether or not discovery enhanced by enabling a discovery regis-
a shared development model could via UDDI registry or other means is suf- try to provide easy access to the COI that
mitigate perceived risks of support and ficient by itself to drive a service’s adop- is supporting the Web service.
inflexible organizational dependencies. tion rate? This problem is analogous to
In the performance-based design prob- the push to develop reusable software Application Lifecycle Management
lem, having easy access to source code assets based upon traditional compo- While SOA’s impact on culture might
and a supporting community of interest nent-based design. Many enterprises be intuitive, what is not so obvious is its
(COI) might enable the best solution to implemented so called “component critical impact on application lifecycle
be applied. This would still be in general repositories” where they encouraged management (ALM). Existing tools
Life-cycle phases Supports full spectrum of definition, design, code and build, test, deployment, and support
Stakeholder support Full spectrum support for business and IT users, integrates business, engineering and operations
Security Supports role-based access and application-level security for across-the-firewall collaborative
development
i
f you are interested overview of DirectX, DirectX 3D,
in writing computer and GDI+. This introduction takes
games or simulations in you through devices, device param-
.NET, then the Apress eters and capabilities, and display
book Beginning .NET Game modes and into 3D coordinate
Programming will prove to be a systems, scene creation, camera
valuable resource. A trio of authors, placement and textures, as well as a
notably David Weller, Alexandre very brief introduction to matrices
Santos Laboa, and Ellen Hatton, and transformations that are part
wrote this book, which introduces and parcel of 3D computer graph-
the reader to many of the fun- ics. If your focus is on developing a
damental concepts that go into 3D game or simulation, you’ll want
programming a game. All topics to supplement the material found
are illustrated in .NET using Visual here with additional resources (to
Basic .NET or C# along with the help the reader here, the authors
.NET Framework managed wrapper provide a resource section at the
APIs for DirectX and GDI+. Title: Beginning .NET Game Programming in end of nearly every chapter to pres-
The book is organized princi- VB.NET, Beginning .NET Game Programming ent additional information).
pally around four game projects, in C# Chapter 4 provides an introduc-
including a .NET version of Tetris, Authors: David Weller, Alexandre Santos Lobao, tion to key concepts that include
as well as a space arcade game and Ellen Hatton vector and trigonometric functions
called Spacewar. Nearly every sec- (used to calculate object velocity,
Publisher: Apress
tion of the book is accompanied etc.) and the game field, and also
paperback/414 pp.
by several source code listings that delves further into sprites with an
demonstrate the concept at hand. introduction to sprite animation.
BY KEVIN WITTMER Because the source code plays an that most games require such as In addition, the authors devote
important role in introducing the network I/O for multi-user gaming coverage to developing a game
Kevin Wittmer works for reader to a particular concept, as well as applying AI algorithms to project proposal (in this context,
SmartSignal Corporation as a most will appreciate that this book implement intelligent or challeng- the proposal is used to define the
technical lead. His programming is available in either a Visual Basic ing strategies for interactive game scope of the game and the require-
interests span .NET, Java, .NET or C# edition. Thus if you pre- objects. ments that are involved). Chapters
C++, and Perl. fer to read source code examples This book touches on all of 5 through 7 develop the Spacewar
from one language to another, be these topics to varying degrees. arcade-style game, illustrating the
4kevinwittme7@hotmail.com sure to find the edition that match- The material is divided into seven concepts introduced in the first
es your language preference. chapters with the first chapter four chapters while also introduc-
There are a dozen or so core tackling the basics of GDI+ and ing more advanced concepts such
programming concepts that are collision detection. Although the as point sprites. As a bonus chap-
fundamental in developing a authors do a good job of intro- ter, they walk the reader through
graphics-based computer game ducing algorithms such as Axis porting .NETTrix to the Pocket PC
or simulation, and they include Aligned Bounding Boxes (AABB) for compact framework.
the base game object, the field or implementing collision detection, Beginning .NET Game
world, image manipulation, sprites I would have preferred that more Programming (in C# or VB.NET)
and sprite animation, the game or basic game programming concepts will provide you with a good start
simulation loop, collision detec- such as sprites (introduced in toward developing 2D or 3D games
tion, and path finding. In addi- chapter 2, after the introduction on or simulations. Although the book
tion to these concepts, there is a applying AI in games) be developed was written with .NET 1.x in mind,
myriad of fundamental concepts for the reader first. all of the fundamental game pro-
and technical details involving the Chapter 3, “Managed DirectX gramming concepts that this book
APIs used for 2D and 3D graphics First Steps” is packed with several presents are independent of a par-
display and rendering, as well as key topics. The first part of the ticular .NET release, and thus are
sound output. Finally, there are chapter launches into the managed applicable to both .NET 2.0 as well
intermediate to advanced topics DirectX API and also provides an as .NET 1.1.
���������������������������������������������
��������������� ���������������
������������������������������������������������������������������������������ ������������������������������������������������������������������������
����������������������������������������������������������������� ���������������������������������������������������������������������������
����������������������������������������������������������������������� �����������������������������������������������������������������������
������������������������������ ����������������������������������������������������������������������������
�������������������������������������������������������������������������
������������������� ����������������������������������������������������������������������������
����������������������������������� ������������������������� ��������������������������������������������������������������������������������
������������������������ ������������������� ����������������������������������������������������������������
������� ������������������
��������������� ���������� �������������������
����������� ��������������������������
��������������������������� ��������������������� ���������������������� ���������
��������������������� ���������������� ���������������������� �������������������
������������������������� ���������������� ����������� ����������������������������
������������������������� ����������������������������� ������������������ ������������������������������
�������������������������� ���������������������������� ����������������������� ����������������
���������������������������������������� �����������������
�������������������������������������������
������������
� ������������������������������
� �������� �������������������������������
��
� � �������������������������
��
� � ��������������������
������������������������������������������ � � �����������������������
����������������������������������������
� ����������������� �����������
© 2005 WEB SERVICES EDGE. ALL RIGHTS RESERVED
Book Review
t
his book bills itself as the The final chapter on basic ADO.
only ADO.NET you will ever NET covers updating data, including
need. This is a bit boister- adding, modifying, and deleting rows.
ous, but mostly true. This It spends a lot of time on merging
book covers pretty much all facets of tables, including some more informa-
ADO.NET programming, and covers tion on differences between how SQL
them well. This well-written book can Sever and Oracle handle merging.
take an ADO.NET novice, and advance The first chapter in what I would call
him or her to being an ADO.NET pro. the advanced section (the book is not
This book concentrates on ADO. officially divided into two sections)
NET, so to be a complete database continues with more advanced updat-
programmer, you will need other books ing issues such as concurrency issues,
to cover the non-ADO.NET parts of null values, and how triggers affect
database programming; in particular, the “number of rows affected” value
this book does not really cover SQL returned by an update. It also includes
syntax, or non-programming aspects of working with hierarchical data. The
databases. Experienced database pro- next chapter covers transactions start-
Title: Pro ADO.NET 2.0
grammers will already have this knowl- ing with the basic ACID definition
Author: Sahil Malik
edge, but programmers who are new (Atomic, Consistent, Isolated, and
Publisher: Apress
to database programming will need Durable), to threads and differences
ISBN #: 1-59059-512-2
at a least a good book on SQL syntax. between ADO.NET 1.1 and ADO.NET
However that is fine; no book can cover Price: US $49.99 2.0.
everything, and as far as ADO.NET 2.0 The next-to-last chapter covers
itself goes, this is likely to be the only some more advanced topic such as using .NET as stored procedures and
book you need. executing large queries asynchro- triggers inside SQL Server. Microsoft
Like most ADO.NET books, this one nously, storing .NET objects in SQL and others are pushing triggers and
starts off discussing the problems with Server 2005, and retrieving multiple stored procedures as the best and most
connected ADO database program- datasets with a single query. Although modern way to implement database
ming, and how the disconnected model this book concentrates on using SQL logic, and starting with SQL 2005, SQL
BY DENNIS HAYES of ADO.NET solves these problems. It Server 2005, it also points out how server can import .NET assemblies
then does an excellent job of present- things differ if you are using Oracle, into the server to be used as stored
Dennis Hayes is an independent ing an overview of the entire ADO.NET Access, or older versions of SQL Server. procedures. Personally, I think this is
software consultant in Atlanta, GA, class hierarchy. This includes the base Here it points out that you can return the coolest feature in SQL 2005, and
and has been involved with the classes that define ADO.NET, and the multiple datasets from Oracle, but it this book does a good job of getting you
Mono project for over three years. derived classes that provide interfaces warns that for future compatibility, started using it.
for each of the different databases. It you should return multiple cursors The final chapter in the book covers
4dennisdotnet@yahoo.com does this both graphically with class instead. I like that about this book. It ADO.NET best practices. This chapter
diagrams, and by discussing each of the follows this with a chapter on discon- is dived into two sections. The first sec-
classes and its members. nected databases covering details on tions covers situations such as deciding
It then shows how to do basic the DataSet object including tables, between using a DataReader and a
database programming using both the rows, columns, constraints, relations, DataSet, where the choice depends on
drag-and-drop capabilities of ADO.NET and primary keys. The chapter ends the job. The book gives good, concise
components and Visual Studio, and also with a discussion of strongly typed information on when to use which
how to manually create connections DataSets using XML Schemas. Later in one. The last part of the chapter cov-
using just code. The next half dozen the advanced part of the book there is ers situations like connected versus
chapters go into more detail on each a chapter devoted to accessing XML disconnected databases, where baring
part of database programming, starting files as databases. There is a chapter unusual circumstances, one will clearly
with connecting to the database with on retrieving data and creating que- be the better option.
details on the IdbConnection interface ries both manually and graphically, a Also as a bonus, until about March,
and the DbConnection class. It also cov- chapter on sorting, searching, and fil- those who purchase this book can also
ers why connection pooling is impor- tering, which includes more informa- download the ebook (normally $25) for
tant, how it works, and how to change tion on the XmlDataDocumnt object, free.
the default settings when needed. and creating XmlSchemas. XML plays This is likely to be the one ADO.
Next it covers basic database several key roles in ADO.NET, and this NET book that stays next to my desk for
queries on connected databases, and book reflects that. quick reference.
Website Today!
���������������������������������
���������������������������
24/7
����������������
������������������������������������������
���������������������������������������������������
����������
�������������������������������������������������������������������������������������
�������������
����������������������������������������������������������������������������������������
��������
������������������������������������������������������������������
��������������������
����������
���������������������� ��������������������������������������������������
������������������ ����������������������
������������������������������������ ������������������������������ ��������
��� ����������� �������������������������������������������������������������
�������������������� ������������������������������ �
������������������������ ��������������������������� ����������
������������������� ����������������� ������������������������������������������������������������������������������
������������������� ����
��������������������������� ��������������������������������
��������������������
�����������������������������������������������������������������������
������������������������������������������
Mono
Mono 1.1.12 Released in Parse, implementations for New Mono Book from Apress
The biggest changes in this the 2.0 string compares, System. Apress has released Practical
release come in SWF (System. Globalization, System.Text 2.0 Mono another book on Mono. It
Windows.Forms). This makes sense, (including updated CJK codecs), covers WinForms under Mono
as SWF is moving into debugging updated reflection code, and URI (including a section on 2.0 con-
mode in anticipation of having full parsers. The System.XML 2.0 API trols), ASP.NET (including how to
support for SWF in the major 1.2 is done, except for System.XML. set up both the Apache server and
release expected in early 2006 (pos- Serialization. Last-minute changes the Mono XSP server), GTK+, and
sibly by the time you read this). The to Nullable<T> boxing conventions other important parts of Mono.
“Nice” theme has been improved, are partially implemented, it still The book uses System.Windows.
and a new “ClearLooks” theme has some bugs, and some changes Forms to create an RSS aggregator
has been added. Newly supported need to be made to the run time as using many common WinForms
features include MDI applications, well. Work continues on the System. controls, including a data grid.
toolwindow, and shortcut and key Configuration namespace needed .NET Developer’s Journal and I
navigation. TextBox and RichTextBox for ASP.NET 2.0. The named and have made an agreement that I
now support cut and paste, includ- unnamed 2.0 Semaphore classes will write a book review for the
ing keybindings, drag and drop, and have been implemented. magazine each month in 2006. This
undo. Pedro, who worked on the started last month with a review of
DataGridView control, has contin- .NET 2.0 Generics from WROK press,
ued to work on the control, and this Pro ADO.NET 2.0 from Apress this
version includes his latest updates. month, and Mono: A Developer’s
The Menu infrastructure has been Notebook from O’Reilly next month.
improved, and System.Drawing is A full review of Practical Mono will
now 2.0 compatible. appear at some point in the next
The JIT compiler for S390 has few months. Suffice to say, the book
been improved, PowerPC bugs is worth its US$49.99 price, and you
exposed by new tests have been should not wait for the full review
fixed, and bugs in floating point to add it to your bookshelf. I will
code generation for ARM proces- also be reviewing two other books
BY DENNIS HAYES sors have been fixed. The JIT com- on Mono, Cross-Platform .NET
piler also has a new, better optimiz- Development, also from Apress,
Dennis Hayes is an independent er for dead code elimination, which and the aforementioned Mono: A
software consultant in Atlanta, GA, will be even more useful in the next Portable.NET Developers Notebook.
and has been involved with the release when new optimizations Last month I noted that Portable.
Mono project for over three years. will tend to produce more dead NET had received two US$4,500 Odds and Ends
code. grants (totaling US$9,000) for com- There has been some code
4dennisdotnet@yahoo.com The new debugger is working, pletion of LibJit, and the addition of checked in to Mono as a start on
but with bugs; X-Develop, a com- a C# front end for LibJit. This raised COM Interop; this is interesting, but it
mercial multilanguage, cross-plat- the question of what happened is hard to tell what will come of it.
form IDE from Omnicore that sup- to the US$4,500 donated as prize Firebird has a release candidate
ports Mono, now has a GUI interface money for work on SWF last year. It for version 1.5.3, and a first beta of
for the Mono debugger (www. turns out that only US$500 had been version 2.0. The project also now
omnicore.com). claimed, so US$1,700 was awarded has a newsletter, and has published
An implementation of the reg- to Gopal for his work on the project; a roadmap for 2006. The plan is to
istry is now available on Unix, and so, there is still US$2,300 of that have a beta release of version 3.0
Iron Python 0.9.6 can run on this prize money to be claimed by devel- towards the end of the year that will
release of Mono. Mono now has an opers. Join the project and maybe be based on the “Vulcan” project,
embeddable HttpListner Web server, you can earn part of it. which is a heavily refractored ver-
many bugs were fixed in the mbas Two big changes coming in the sion of Firebird. Firebird is the open
compiler, and the Npqsgl database next release of Portable.NET will be source database based on code from
driver was upgraded to use the latest the use of LibCrayons (a lightweight the Borland Interbase product. You
version (1.0beta1). drawing library created specifically can get all of the code, programs, the
There are a number of updates to implement System.Drawing) as document mentioned above, and
to the .NET 2.0 classes, includ- the back end for System.Drawing, more from their home page at www.
ing performance improvements and the use of LibJit in Portable.NET. firebirdsql.org.