DNDJ - 2006 - 05
DNDJ - 2006 - 05
DNDJ - 2006 - 05
44
Presented by
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
Single environment for deployment
to desktop or web
Full integration with VisualStudio .NET
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
10100010110100010110100101010101000101101
0101010110100010110100011101001010101011
© RadView Software, Limited.All rights reserved. The Smart Choice in Web Application Testing
M a y 2 0 0 6 Volume 4 Issue 5
F# on a BOOK REVIEW
Heard on Hanselminutes
12
26
Hosted by Carl Franklin ............................................................
TOOLS
Flash ASP.NET
Adding Validation 40
By Ryan Moore ..........................................................................
Capabilities to a BoundField
USING ASP.NET BOOK REVIEW
BY OSCAR PELI Best Kept Secrets in .NET
By Steven Mandel ..................................................................... 44
34 BOOK REVIEW
Practical Mono
Building a Simple Content By Dennis Hayes ....................................................................... 48
Management System
LEARN HOW TO ENABLE YOUR EDITORS TO MONO
VISUALLY EDIT HTML CONTENT ONLINE
BY CRISTIAN IVASCU
Mono Beta for 1.2 Released...
By Dennis Hayes ....................................................................... 50
������������������������������������
�������������������������������������
�������������������������������������������
������������������������������������������������������������������
��������������������������������������������
������������������������������������������������������������������
�
���������������������������������� ������������������������������
����������������������������������������������������������������������
������������������������������������������������������������������������
�������������������������������������������
��������������������������������������
4 ��������������������������������������������������������
����������������������������������������
4 ����������������������������������������������������������������
�����������������������������������������������������
���������������������������
4 ����������������������������������������������������������
�������������������������������������������������������� ��������������������������������������������
���������������������
4 ������������������������������������������������
����������������������������������������������������������������
������������������������������������ ��������������
���������������������
�������������
�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
Editorial
EDITORIAL BOARD
dotnetboard@sys-con.com
Editor-in-Chief
Derek Ferguson derekf@speakeasy.net
Web 2.0 ‘Goes Mainstream’
w
Group Publisher hen newsstands through- the Web.” This is a much more power-
Jeremy Geelan jeremy@sys-con.com out America on Monday, ful rallying cry and I, for one, should
Mobility Editor
BY JEREMY GEELAN
Jon Box jbox@psgi.net March 27, started display- have much preferred to see it used as
Security Editor ing the April 3 issue of Newsweek’s front-cover headline, but Jeremy Geelan is group publisher of
Patrick Hynds phynds@criticalsites.com
Open Source Editor Newsweek with its cover story such is the way of the world. Maybe the SYS-CON Media and is responsible
Dennis Hayes dennisdotnet@yahoo.com about “Web 2.0” – “Putting the ‘We’ in editors at MSNBC “get it” better than for the development of new titles
Product Review Editor
Doug Holland doug.holland@precisionobjects.com Web” – it seems to me that we have those at Newsweek. and technology portals for the
VB Editor reached one of Malcolm Gladwell’s I can’t wait for BusinessWeek to ad- firm. He regularly represents
Keith Franklin keithf@magenic.com
Smart Client Editor
now-famous Tipping Points. dress the same story: they’ll get the title SYS-CON at conferences and trade
Tim Huckaby timh@interknowlogy.com In the Newsweek piece, written by spot-on, just watch!! shows, speaking to technology
BizTalk Editor
Brian Loesgen brian.loesgen@neudesic.com
the magazine’s senior editor Steven Newsweek’s two authors triangu- audiences both in North America
ADVISORY BOARD Levy and its Silicon Valley correspon- lated on James Surowiecki, whom they and overseas.
dotnetadvisors@sys-con.com dent Brad Stone, the authors report quote, so his “Wisdom of Crowds” no-
Derek Ferguson derekf@magenic.com
Jeremy Geelan jeremy@sys-con.com how, “less than a decade ago, when we tion is included in the article. (“It’s clear 4jeremy@sys-con.com
Thom Robbins trobbins@microsoft.com were first getting used to the idea of an that the Web is structurally congenial
John Gomez John.Gomez@eclipsys.com
Scott Hanselman scott@hanselman.com Internet, people described the act of to the wisdom of crowds,” he’s quoted
Dean Guida deang@infragistics.com going online as venturing into some as saying.) But my instincts tell me
John Sharp johns@contentmaster.com
Jacob Cynamon jacobcy@microsoft.com foreign realm that, for all that
Chris Mayo cmayo@microsoft.com called cyber- Steven Levy and
Gary Cornell gary@thecornells.com
Joe Stagner joestag@microsoft.com space.” But Brad Stone are to
Peter DeBetta peter@debetta.com that metaphor, be thanked and
Executive Editor
Nancy Valentine nancy@sys-con.com the authors congratulated for
Online Editor suggest, no producing the
Roger Strukhoff roger@sys-con.com
Assistant Online Editor longer applies: article, they don’t
Nicholas DeJesus nick@sys-con.com “MySpace, necessarily – yet,
SUBSCRIPTIONS Flickr, and anyway – fully
For subscriptions and requests for bulk orders,
please send your letters to Subscription Department all the other comprehend the
Subscription Hotline: subscribe@sys-con.com newcomers technologies of
Cover Price: $6.99/issue
Domestic: $69.99/yr. (12 issues) aren’t places to “social comput-
Canada/Mexico: $99.99/yr. Overseas: $129.99/yr. go, but things ing” like RSS. And
(u.s. banks or money orders). Back issues: $12/ea.,
plus shipping and handling. to do, ways to they certainly
EDITORIAL OFFICES express ourselves means to connect don’t have a clue what AJAX actually
SYS-CON Media 135 Chestnut Ridge Rd., with others and extend our own is. (It is hastily referenced in a single
Montvale, NJ 07645
Telephone: 201 802-3000 Fax: 201 782-9638 horizons.” sentence buried right in the middle of
.NET Developer’s Journal (issn#1541-2849) is
published monthly (12 times a year) for $69.99 by
“Cyberspace was somewhere else,” the piece.)
SYS-CON Publications, Inc.,135 Chestnut Ridge Road, they write. Whereas “The Web is where Again, all credit to Newsweek,
Montvale, NJ 07645.
Postmaster: Send address changes to: we live.” [My emphasis.] though, for the resonant final para-
.NET Developer’s Journal, What’s the tipping point, you ask. graph:
SYS-CON Publications, Inc.,
135 Chestnut Ridge Road Well, for me – and for plenty of others,
Montvale, NJ 07645 it seems – what’s special/unusual is Less than a decade ago, when we were
Copyright © 2006 by SYS-CON Publications, Inc.
All rights reserved. No part of this publication may be reproduced or that Newsweek, a mainstream publica- first getting used to the idea of an In-
transmitted in any form or by any means, electronic or mechanical,
including photocopy or any information storage and retrieval system, tion, deems “Web 2.0” worthy not just ternet, people described the act of going
without written permission. For promotional reprints, contact Reprint
Coordinator Dorothy Gil, dorothy@sys-con.com. of an in-depth article but also of an online as venturing into some foreign
Worldwide Newsstand Distribution
Curtis Circulation Company, New Milford, NJ
in-depth article that it puts on its cover. realm called cyberspace. But that meta-
Newsstand Distribution Consultant: It means that the notion of a “live Web” phor no longer applies. MySpace, Flickr
Gregory Associates / W.R.D.S.
732 607-9941 - BJGAssociates@cs.com is getting prime time, along with the and all the other newcomers aren’t
For list rental information:
Kevin Collopy: 845 731-2684, terminology of Web 2.0 like “tagging,” places to go, but things to do, ways to
kevin.collopy@edithroman.com;
Frank Cipolla: 845 731-3832, “mash-ups,” “collective intelligence,” express yourself, means to connect with
frank.cipolla@epostdirect.com
All brand and product names used on these pages are trade names, and “social media.” others and extend your own horizons.
service marks, or trademarks of their respective companies. SYS-CON
Publications, Inc., is not affiliated with the companies or products Web 2.0, make no mistake about it, is Cyberspace was somewhere else. The
covered in .NET Developer’s Journal. .NET and .NET-based marks are
trademarks or registered trademarks of Microsoft Corporation in the United going mainstream. Web is where we live.
States and other countries.
SYS-CON Publications, Inc., reserves the right to revise,
For those who think that one weak-
republish and authorize its readers to use the articles ness of the Newsweek piece is its title, With these five sentences, given their
submitted for publication.
MSNBC has come to the rescue by appearance in one of the world’s most
repurposing it under the – in my view, widely read news magazines, “Web 2.0”
far sharper– title “The New Wisdom of has truly arrived in Main Street.
10 4
Murach’s MCAD/MCSD Fuat Kircaali fuat@sys-con.com
Beginning Visual Training Guide President, SYS-CON Events
Basic .NET (70-320): Grisha Davida grisha@sys-con.com
Group Publisher
(Murach: Training Developing XML
Jeremy Geelan jeremy@sys-con.com
& Reference) Web Services
and Server ADVERTISING
by Anne Prince Components with Visual C# Senior Vice President, Sales and Marketing
.NET and the .NET Framework Carmen Gonzalez carmen@sys-con.com
by Amit Kalani Vice President, Sales and Marketing
3
ASP.NET MCAD/MCSD
Robyn Forma robyn@sys-con.com
Training Guide
Advertising Sales Manager
(70-315): Megan Mussa megan@sys-con.com
Developing and Associate Sales Managers
Implementing Kerry Mealia kerry@sys-con.com
Web Lauren Orsi lauren@sys-con.com
8
Developing Art Director
2
Web MCAD/MCSD Alex Botero alex@sys-con.com
7
Developing and 70-300
Web Designers
Application Microsoft Corporation Stephen Kilmurray stephen@sys-con.com
Frameworks in Wayne Uffleman wayne@sys-con.com
.NET
ACCOUNTING
Financial Analyst
Joan LaRose joan@sys-con.com
by Xin Chen
Accounts Payable
Betty White betty@sys-con.com
Accounts Receivable
PROVIDED BY
Solution
Patterns Using SYS-CON EVENTS
Microsoft .Net: President, Sys-con Events
1
Grisha Davida grisha@sys-con.com
Version 2.0 Programming Microsoft
National Sales Manager
: Patterns & Visual Basic .NET Version Jim Hanchrow jimh@sys-con.com
Practices 2003 (Book & CD-ROM)
Microsoft Corporation SUBSCRIPTIONS
by Francesco Balena 201 802-3012
888 303-5282
5
subscribe@sys-con.com
MCAD/MCSD
Self-Paced
CUSTOMER RELATIONS
Training Kit: Circulation Service Coordinators
Developing Edna Earle Russell edna@sys-con.com
Web JDJ Store Manager
Applications Brunilda Staropoli bruni@sys-con.com
with Microsoft Visual Basic
.NET and Microsoft Visual C#
.NET, Second Edition
Microsoft Corporation
Heard on Hanselminutes
Interview with Web developer and technologist Scott Hanselman
h
anselminutes is a weekly ule, or you do it on a check-in. For aged by the ThoughtWorks guys. And
30-minute podcast with us at Corillian we do a combination. this is an automated build solution
Web developer and tech- Every single time someone checks in, and a server for .NET written in .NET.
nologist Scott Hanselman a server on the other end starts watch- The final 1.0 release came out last
hosted by Carl Franklin. The following ing, and says, “All right I am going to November, although we have been
is a transcript from show number 4 on kick off a build. Someone just checked using it since version 0.7.
Continuous Integration. You can listen something in, I want to kick off a
online at www.hanselminutes.com. build, but I’ll wait 10 minutes just in CF: Very cool.
case there are other things coming.” SH: CruiseControl runs as a Window
Carl Franklin: All right so let’s get into Because when you do a check-in you service. You can also run it from the
Continuous Integration. Why don’t might have a couple of things batched command line. It will watch your
you start by telling us what it is? up. So it’s not going to kick off a build source control and check to see if
Scott Hanselman: So Continuous every single check-in. But once a anything is updated. It works with
Integration is a concept that came batch of things has been checked in virtually any source control – CVS,
from a paper that Martin Fowler wrote and nothing has happened for, say, 10 SourceSafe, Perforce, SourceGear,
along with a guy named Matthew minutes, it says, “All right. Something PVCS, StarTeam; any source control
Foemmel from ThoughtWorks. dramatic has happened. I am going to that’s out there that’s worth its salt will
Martin Fowler is the chief scientist run the build. I want to test the build. work just great. When it detects that a
at ThoughtWorks. And he uses the I’ll build and install and I’ll send the change has occurred then it will kick
term Continuous Integration within report to the entire team.” off the build. Typically these builds are
the larger extreme programming or kicked off using something like NAnt,
XP series of practices. Continuous CF: How long typically does that pro- the .NET port of ANT, which basically
Integration is something that’s been cess take for you guys? make files with angle brackets.
around for a long time but people SH: For us using a big project we have
really never put a name on it. It’s the got one that takes as much as an hour CF: Yeah.
automation of a daily build, the for- but for a smaller project it can take SH: You can get that at nant.source-
malization of that process, keeping a between 10 and 20 minutes. forge.net and NAnt is similar to
single place where all the source code MSbuild and there are already
lives, so that everyone can always go CF: And is it easy to interrupt? Let’s people on the Net who are using
to the exact same place to get the cur- say you actually did want to add CruiseControl with MSbuild. So at
rent source for the current (and any something else and you knew that it its simplest you can certainly kick
previous) version. It’s automating the was going to break. off a batch file. But for the most part
build but it’s also automating the test- SH: Yeah, that’s a good point. If you CruiseControl and NAnt go hand-
ing so that you can run the test on the check something in and you knew in-hand. The idea is that you should
entire suite at any time. An executable that it would break the build, if you always be able to check your source
HOSTED BY
would pop out of the end. didn’t check it in within that first 10- out, go out to the command line and
CARL FRANKLIN
So the ideal Continuous minute window you are out of luck, type ‘build’ or ‘go’ or whatever, and get
Integration environment, in my opin- you’ll get a broken build. But the build a build, it needs to be that simple.
ion and in many people’s opinion, would be fixed on your immediate So when you’re building these
would be: A developer sits down. He next check-in. So we have literally NAnt files you typically build targets
checks out his code, goes out to the dozens of builds a day. within them. So you will say build
command line – he types, “build,” and all, build test, build install, so that
he gets a complete build that is totally CF: Interesting. people can hit these different targets:
tested on the spot. If he says some- SH: So there are a number of tools that build debug, build release, these are all
thing like “build install” it will actu- you can get, the most well-known is targets within the NAnt file, this XML-
ally pop out an MSI installer and he’s one called CruiseControl at cruisec- based file. These tasks in the NAnt file
completely set up. He can do this in a ontrol.sourceforge.net. There are also can be written by you or picked up
repeatable fashion on any machine. some competitors: Draco at draconet. from other places. So, there’s a task for
He can make changes to the code, sourceforge.net and Hippo, which is getting source from source control.
check it in, and a build server dedi- another old one that hasn’t changed There might be a task for calling a
cated to this task would automatically very recently (hipponet.sourceforge. Web Service or looking in the registry.
run the build upon his check-in. net). But CruiseControl is largely Each of these tasks is associated with
Now, there are some arguments: thought of as being the one that is the a specific XML element in that NAnt
that you do these things on a sched- most mature. It’s the one that is man- file.
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 ™
Interview
CF: Cool! CF: So you mentioned building install- basis. And then you can flag things
SH: Ideally, we would actually build ers as part of CI. What are some tools in the build and, say, wow, anything
the entire thing, do a functional NUnit to automate that process? that has a complexity of 10, indicat-
test, then we would actually do a SH: So at the simplest level, of course, ing that there are 10 or more ways
silent install of the product as part of Visual Studio supports building through this method, which is argu-
the build, and then do an end-to-end installers from the development envi- ably a number that is greater than the
integration test. And while NUnit does ronment itself. For a lot of our stuff number of paths that a human can
easy functional testing, there are tools we just actually shell out and launch comfortably store in his head, right?
like NUnitASP and NunitForms, you the deployment project that comes
can get those at nunitforms.source- with Visual Studio from the com- CF: Right.
forge.net and nunitasp.sourceforge. mand line. But for the times that that SH: I can barely hold my phone nuber
net. These are extensions to NUnit that doesn’t work you can use a number of and my wife’s phone number. I can’t
let you test WinForms – actually like different toolsets. You can use com- hold 10 different paths through some
push buttons and poke around on a mand-line versions of InstallShield, code. That would be the time then to
WinForm – or test ASP.NET Forms. for example. kick it out – we need to have a code
At Corillian we have been using a tool But since the Continuous review. Now whether you choose to
called WATIR, Web Application Testing Integration world and the break the build or not it’s really up
in Ruby, and I have a little article on it CruiseControl world are so focused to you. But these are some [of the]
up on my blog at shrinkster.com/bm8. on getting a lot of great work done kinds of feedback you can get that you
If you go up on my blog and search with Open Source tools, the tools couldn’t before.
for Watir, you’ll find not only stuff that you will often find are things like Another one is the tool called
I’ve done with Watir but stuff that one Windows Installer XML or WIX, that Simian, which is a similarity-based
of our guys at Corillian by the name of is at sourceforge.net/project/wix tool. It’s actually kind of funny. It looks
Travis Illig has done to extend Watir. or the Nullsoft Scriptable Install for copy[ing and] pasting in your
We have another guy named Dustin System, NSIS, that used to be called source code base. It’s at shrinkster.
Woodhouse who’s extending Watir the PiMP. This is the tool that the com/bma. Simian is actually written
and NUnit such that this Ruby-based guys that made Winamp used to in Java but it will work on .NET code
scripting language will actually create install Winamp. This is a very elegant and it will find places where, say, you
NUnit tests and NUnit results. install system at nsis.sourceforge. and I are working on the same project
net. So you can call these different and I found a For loop that I really
CF: Now a lot of people might not installer makers at the end of your liked. I copied and pasted it but edited
know what Ruby is. NantScript and if you wanted to take a little bit. And it will go and say, you
SH: So, Ruby is a scripting language it to the next level then you would do know this is suspiciously similar, I
that a lot of people find very beautiful a remote deploy, or remote install of think this is a candidate for refactor-
in its style. Feels kind of like Python; your application, and then start doing ing. We did this on dasBlog and I think
it feels kind of like Scheme, it feels integration testing. we found something like 14% or 15%
kind of like C++. It’s just one of those Some of the other things that you of it was just complete duplication.
languages that feels nice in your can stick at the end of your build
mouth. There’s actually a fellow who once you have the ability to do all CF: Mark Miller told me once that
did a presentation where he had no these things that framework are doing Developer Express’s refactor looks at
bullet points. He only had Ruby code things like development metrics like Cyclomatic Complexity and that’s one
because he felt that the beauty of the what’s called Cyclomtic Complexity. of the main characteristics they use
code spoke enough. It’s that kind of Cyclomatic Complexity is a measure to determine whether refactoring is
code. A gentleman named John Lam at of how many different paths through a necessary.
iunknown.com believes very strongly particular function there are. Let’s say SH: Totally. Mark Miller being an
in the beauty of Ruby. And every once that if there’s a function called Foo that expert on refactoring generally with
in a while he’ll have epiphany while he takes a Boolean. It has one input and all the refactors that he put into
is writing Ruby and then he’ll post it it can be false or true. There are two Refactor and into CodeRush. Having
on his blog: “Oh! I took these six lines ways through that particular method the nice chart and graph that you get
of code and turned into that two lines so then its complexity might be con- as a toolbox in the CodeRush product
of code in Ruby and I’m just enamored sidered two. is pretty powerful stuff. That’s a very
with Ruby today.” There are some papers that are visceral way of finding out which
Then Watir is an IE, an Internet written about Cyclomatic Complexity function in your application kind of
Explorer wrapper for Ruby so that you and there are great tools like sucks the most.
can write these kinds of tests. And DevMetrics from a company called
then I wrote a little cheapy application Anticipating Minds at shrinkster. Listen to the entire interview online
called Watir Maker that would basical- com/bm9. They have a command- at www.hanselminutes.com. The
ly record your experience while you’re line tool that will go through your Hanselminutes Podcast is produced
inside of IE and it would basically entire source code base and tell you weekly by Pwop Productions, a pod-
write out the beginnings of a Watir test. the complexity of your particular casting services company at www.
People are looking to extend that. project on a method-by-method pwop.com.
����������������
���������������������������������������������������������������������������������������������������������������
������������������������������������������������
��������������������������
����������������������������������������������������������������������������������������
�������������������������������
���������������������������������������������������������������������������������������������������������������������������������
��������������������������������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������
Super Computer
���������������������������������������
��������������������������������������������
��������������������������������������������
�������������������������������������������������������
������������������������������������������������������������
��������� � ����������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������� ������ �
���������� ������������ �����������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������������������������
������������������������������������� ����������������������������������������������������������������������������������������
�������������������������������������������� ����������������������������������������������������������������������������������
��������������������������������
������������������������������������������������������������������������������������������������������������������������ ���������������������������������������������������������������������� ���������������������������������������������������� ������������������������������������������������������������������������������
� � � � � � � � � � � � � � � � � � � �
� � � � � � � � � � � � � � � � � � � �
Super Computer
Without any optimization the
F# implementation took 453 ms. C#
finished up in 62 ms. Turning opti-
mization on caused the C# results to
drop to 46 ms. And, most shocking
of all, the F# was dead even at 46 ms!
t1 Table 1: Performance Results Apparently, the F# compiler does an
excellent job optimizing the code.
algorithm working well in F#, it was on types that are derived from a more Continuing on, I ran the entire C#
time to get rid of the C# all together. I general type. and F# grid applications against one
began by converting the C# GThread An example would be type car is another. Without any optimization
over to F# by adding the definition to derived from type vehicle then car the C# code took 3.9 seconds to cal-
the pb.fsi file and the implementation needs to be up cast to a vehicle and culate 100 digits of pi while F# only
to pb.fs as shown in Listing 11 and 12. vehicle needs to be down cast to a car. took 2.8 seconds. Optimizing this
You’ll see the similarities between application showed that F# would fin-
Listing 4 and Listing 12. The differ- More Advanced F# ish in 1.5 seconds while C# would not
ences include: F# was originally written by Dr. complete any faster than 2.6 seconds.
• Inheritance technique Don Syme of Microsoft Research. Dr. A look at the IL showed the reason
• Constructor implementation Syme still maintains F# and plays an for the difference. From the begin-
• Use of base class active part of the F# community. After ning of Listing 10 you can see the
• Method overloading technique discussing this article and its code use of the inline keyword, not avail-
with him, he suggested some chang- able in C#, this lets F# squeeze out a
While certainly not an all-inclusive es. The changes highlight some of the little more performance. If you’re not
list of differences, they are some of the advantages of using F#. In particular familiar with the concept of inline
items I ran into. Inheritance is done he suggested: functions, let me explain. Each time a
using the inherit keyword just below • Use for-loops instead of while loops function is called arguments need to
the class definition. • Try to remove mutables be pushed onto the stack or stored in
Constructors are implemented • Try to stick with F# convention and registers. When the function is done
using the new keyword and can be use lower case variable names results need to be pushed onto the
defined as using the keyword to for most letbound variables and stack, all this takes time. The cost of
access the base class. The use of the arguments these calls can be avoided by mov-
base class is required to implement • Make your classes smaller and more ing the function into the body of the
method overloading using the over- reusable. Classes rarely need to cap- calling code. The C# compiler doesn’t
ride keyword. ture variables explicitly support the inlining, instead, it relies
Finally, I implemented the main on the JIT to do this. Here’s a sim-
code in F# in Listing 13.(Listings 13-14 Dr. Syme was nice enough to pro- plified list of heuristics that the JIT
and additional source code can be vide a rewrite of some of my code seg- uses to decide if a method should be
downloaded from the online version ments. In Listing 14 you can see some inlined:
of this article at http://dotnet.sys-con. of the major areas where thinking in • Methods that are greater than 32
com.) F# can produce more elegant code. bytes of IL won’t be inlined.
In this code segment, some of the The hardest thing for me to adapt • Virtual functions aren’t inlined.
issues I ran into with F# are: to has been the use of let-bound • Methods that have complex flow
• Hooking into events functions. While it reminds me of the control won’t be in-lined. Complex
• Exception handling use of macros in other languages, flow control is any flow control other
• Type up and down casting I’m still not used to seeing them than if/then/else; in this case, switch
inline with the rest of the code. You or while.
The method for hooking events can see an example of this in Listing • Methods that contain exception-
in F# reminds me of COM connec- 14. The declaration of check in the handling blocks aren’t inlined,
tion points. Instead of the addition is_prime function took me a while to though methods that throw excep-
assignment operator used in C#, we understand. tions are still candidates for inlining.
use the Add method of the IEvent • If any of the method’s formal argu-
interface. To the Add method we pass Performance Comparison ments are structs, the method won’t
fun evArgs -> expr, where expr is an One of the most interesting parts be inlined.
appropriate implementation of a call- of this process was examining the
back. Exception handling takes on the performance differences between C# F# can still take advantage of
try/with and try/finally forms in F#. and F#. My initial assumption was the JIT optimization but also allows
Try/with is similar to try-catch blocks that the F# code had to be slower. the developer to control the use of
in C# while try/finally is similar to the This, in fact, is not the case. In a start- method inlining. As a result, an F#
try-finally. Up casting occurs when a ing benchmark, I wanted to examine developer can more explicitly control
type is converted to a more general the differences in performance of the the performance characteristics of an
type whereas down casting can occur Plouffe-Bellard calculation. application.
t
he new family of bound In the case of an error you have to • RequiredErrorMessage: The string
controls lets developers submit data to the user so he or she can value that represents the error mes-
build data-driven appli- correct the mistake and do this until all sage displayed to the user when he
cations almost without the fields are filled correctly. or she leave a required field blank.
writing a line of code at page level, but You could avoid all the roundtrips • RegularExpressionValidationStri
there’s more work to do to build really to the server if you could check for ng: The string value that represents
robust, fully featured controls. data correctness on the client side (of the regular expression to be satisfied
With the new version of .NET course, to check the correctness server- by the data inserted in the bound
Framework, developers can extend side is a best practice that I warmly field.
base controls to build “powered” ones advice). • RegularExpressionValidationErro
that satisfy particular needs that base Using validator controls is a way rMessage: The string value that rep-
controls can’t. to do client-side validation; a detailed resents the error message displayed
In this article you’ll see how to description of the validator controls to the user when he or she inserts
extend the BoundField control add- are outside the scope of this article so if an invalid expression.
ing validation capabilities using ASP. you want a detailed description, point
NET validation controls. These con- your browser to http://msdn.microsoft. Listing 2 shows some of these
trols provide two ways of validation: com/library/default.asp?url=/library/ properties (note that the property
server-side and client-side. The nice en-us/cpgenref/html/cpconaspnetsyn- value is stored in the ViewState to pre-
thing about these validation controls is taxforvalidationcontrols.asp. serve it from postbacks).
that they will do client-side validation The goal now is to extend a The properties just created let you
when they detect that the browser can BoundControl so that, in edit or insert define the behavior of the control and
(unless client-side validation has been mode, user input can be validated what kind of validation controls have
disabled), thus reducing roundtrips. against a validation control. to be injected when the control is ren-
BY OSCAR PELI And it will do server-side where nec- dered.
essary. This client-side/server-side The PoweredBoundFiled Class Add a RequiredFieldValidator con-
detection and validation are done First of all create a class that inher- trol if the required property is set to
without extra work by the developer. its from the BoundField class (see true; add a RegularExpressionValidator
Listing 1). This lets you start with a control if the RegularExpressionValidat
BoundField Control class that behaves exactly like a generic ionString property isn’t empty.
The BoundField control is used BoundField control. The RegularExpressionValidati
by data-bound controls (such as You have to add properties onErrorMessage property and the
GridView and DetailsView) to display and override methods to imple- RequiredErrorMessage property let
the value of a field as text. ment the validation feature. The the developer customize the error
In edit/insert mode the control PoweredBoundField control will sup- message to present to the user in case
displays a textbox where the user can port the required validation and regular of erroneous inputs (note that these
change the value of the underlying field. expression validation capabilities, so properties have a default value for dis-
With a base BoundField you can’t vali- the first step is to create some proper- playing a generic message).
date the user input in any way so you ties to carry some information about
have to check the server side to see that, this. PoweredBoundField Overrides
for example, all the mandatory fields Add the following public properties: The validation feature of the
are filled and all the rules for special • Required: The Boolean value that PoweredBoundField control is provid-
fields (like e-mail fields) are satisfied. indicates if the field is mandatory. ed by validation controls; you have to
PoweredBoundField at Work
Now you can see the new Powered-
BoundField in action; first compile the
above class in a class library dll then use it
inside an aspx page. (You can download the
whole Visual Studio 2005 solution from the
online version of this article at http://dotnet.
sys-con.com.)
You’ll use the PoweredBoundField
control just created inside a GridView
control that will bind to a table in the
AdventureWorks sample database that
ships with SQL Server 2005 (to run this
example you can download Microsoft
SQL Server 2005 Express Edition at http:// f1 Figure 1: PowerBoundField at work
} Return rev
} End Function
}
��������������������������� ��������������
������������
�������������
����������
����
���������������
�������
�������������������������������������������������������
��������������
�����������������������������������������������������
���������������������������������������������������������� �������������������
������������������������������������� �����������������������������
�������������������������������������������������������������� �������
���������������������������������������
�����������������������������������������������
������������������������������� ������������������������������
�������������������������������������������������������������� �������
���������������������������������������
�����������������������������������������������������������������
� � � �� ��������������������������������������������������������������� �����������������������������
�������������������������������������������������������������� �������
�� ��������� ����
����������������������������������������������������������������������� ���������������������������������������
����������������������������������������������������������������
�
����� �������� ��������������������������������������������������������������������� ����������������������������������
����������������������������������������������������������������������
����
����
��������� ������������������������������������������������������������������������ ������������������������������������������������������������������
� � ���������� ��
��
�������������������������������������������������� �������������������������������������
������������������������������������������
��� �����
�����
�������������
��������������������������������� ����������������
������������������ ������������������������������
������������
�������������������������������
���������������
������������������������������������ ������������������������
����������������������������������������� �������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������
�������������������������������� �������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������� ������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������ ������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������� ������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������
������������������������������������������������������������������
��������������������������������
��������������������������������������������������������������
����������������������������������������������������������
�������������������������������������������������������������������������������������������������
���������������������������������������� �������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������
���������������������������������� ������������������������������������������������������������������������������������������������������������
�������������������������� ��������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������
�����������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������
�� �� �� ������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
��������������������������������������������������������������������������������������������������� ��������������������������������
���������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������� ��������������������������������������������������������������
�������������������������������������������������������������������������������������
����������������������������������������������������������
������������������������������������������������������������������������������������������������������
�� �� �� ��������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������
�����������������������������������
����������������������������������
�� �� �� ���������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������� ����������������������������������
�������������������������������������������������������������������������������������������
�������������������������������������������� ������������������������������������������������������
����������������������������������������������������������
����������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������
����������������������������� ��������������������������������
������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������
����������������������������������������������������������������� ���������������������������� ������������������������
��� �������
��������������������������������
� �������������������������������������������������������������������������������������������� ����������������������������������������
� �������������������������������������
�������������������������������� ������������������������
��� ������������� ��������������������������������������������������������������������������������������������������
� ���������������������������������������������������������������������������������������������� ���������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
���������������������������������������������
��� �����������������������������
� �������������������������������������������������������������������������������������������������� �����������������������������������������������������������������������������������������������������
� �������������������� ������������������������������������������������������������������������������������������������������ ��������������������������������������������������
���������������������������������������������������������������������������������������������������������
��� ������������������������������ ����������������������������������������������������������������������������������������������������� NOTE: SPEAKER LINE-UP SUBJECT TO CHANGE WITHOUT NOTICE
� �������������������������������������������������������������������������������� ���������������������������������������������������������������������������������������������� VISIT WWW.AJAXSEMINAR.COM FOR THE MOST COMPLETE UP-TO-DATE INFORMATION
CMS
i
n this article you’ll learn HTML-Editor/KTML-for-.NET/Try- Access database and copy it into
how to create a basic con- Download/). the site root. You’ll also have to
tent management system 3. A database system, either Microsoft refresh the Solution Explorer
that stores articles in a Access or Microsoft SQL Server. view to access it from within the
database using Microsoft’s Visual 4. A basic knowledge of databases and platform.
Web Developer Express Edition (or the .NET platform.
Microsoft Visual Studio) and KTML 4 Your application setup is almost
Lite edition. The first step in building this complete. All you need to check
At the end of this article users of application is to set up your working now is that you have all the compo-
the Content Management System environment. nents handy.
will be able to:
• See the list of articles that exist in Setting Up the Environment Add the KTML 4 Lite Control to
the site database with the title and It only takes three easy steps to the Toolbox
short description. get you up and going. Let’s do it You’ll only use three controls
• Display the full article. now: to build your pages: the DataList,
• Edit or add articles using the free 1. Start the IDE you’re using. On the DetailsView, and the KTML 4
online HTML editor KTML Lite Welcome page that’s shown select Visual Studio control. The first two
that is easy to learn and use just the option to create a new ASP. are present by default in your plat-
like Microsoft Word. NET Web site. Select the path to form, right under the Data tab in
store the files and give it a proper the Toolbox. The latter is a custom
Using KTML Lite the text boxes or name, say, SimpleCMS. Note: control that you must manually
text areas used to edit content can be If you’ve disabled the Welcome add to the Toolbox:
replaced with an online HTML edi- page, you can create the new 1. Download the KTML 4 Lite for
tor that lets you format text, style it application from File > New Web the ASP.NET zip archive. Unpack
using CSS, upload and insert images Site. it to a folder of choice.
BY CRISTIAN IVASCU
and media, upload and manage files. 2. The new Web site starts off with 2. Inside the main package there
You need 20 minutes to complete a single page – default.aspx. On are two more archives – one for
this tutorial. this page you’ll display the list ASP.NET 1.1 and the other for
of articles. For the editing page version 2.0 of ASP.NET. Use the
Getting Started right-click the project title in the one that’s appropriate to your
Before starting on this project, Solution Explorer and select the specific ASP.NET version.
there are some prerequisites to take Add new Item option. Name the 3. Unpack the zip with KTML to a
care of. You need: new page edit.aspx. folder on your hard drive (e.g.,
1. Microsoft Visual Web Developer 2005 3. Next create a database with the c:\InterAKT\Ktml). The archive
Express Edition (see http://msdn. same structure as in Figure 1 or contains two folders – bin and
microsoft.com/vstudio/express/ download the sample Microsoft includes – and two files – one
vwd/) or Microsoft Visual Studio
2005 (see http://msdn.microsoft.
com/vstudio/default.aspx). Since the
steps are the same for both platforms
there will be no distinction in what
follows.
2. KTML 4 Lite for ASP.NET Visual
Studio Control (see www.inter-
aktonline.com/Products/Online- f1 Figure 1: The articles table structure
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
69
.NET and Web services, .NET Developer’s Journal
“
You’ll no longer have to rely on the Webmaster just
to update a piece of content and the site editors don’t
have to take HTML courses; if they know how to use a
word processor, they’ll have no trouble with KTML”
Advertiser Index
ADVERTISER URL PHONE PG
ONLY
$
69 99
ONE YEAR
12 ISSUES
www.JDJ.SYS-CON.com
or 1-888-303-5282
l
ately, it seems that every tion development that Ms. Kurata
computer book that you touches upon in her book. In gen-
find is a weighty tome of eral, we tend to view stored pro-
at least 500 or 600 pages. cedures, views, and user-defined
You groan just thinking about hav- functions as “second class” code
ing to schlep another monster-size that does not require proper track-
book around. It is so nice then to ing through source code control.
inform you that sometimes good It is true that SQL Server does not
things do come in small packages. lend itself to placing these vital
This book, while only 200 pages, pieces of code under source code
contains lots of nuggets that will control. However, now that we
appeal to all levels of developers. have the ability to create database
Chapter one covers an exhaus- projects inside of Visual Studio and
tive list of navigation short cuts place them under source code con-
that you will find in Visual Studio trol, there is no longer an excuse
2003. If you want to master get- for not properly tracking changes
ting around in Visual Studio, this Title: Best Kept Secrets in .NET
made to “database” code that is just
is a great chapter to have nearby. as vital to your application as your
Author: Deborah Kurata
I would urge Ms. Kurata to update VB.NET or C# code.
Publisher: Apress
this chapter to include Visual Visual studio provides templates
ISBN #: 1-59059-426-6
Studio 2005 shortcuts as well. that you can use when creating new
Price: US $29.99
In chapter two’s topics on stored procedures, views, and udfs.
Windows Forms is an important These templates can be found in
BY STEVEN MANDEL discussion on how to use the to keep track of all your changes “C:\Program Files\Microsoft Visual
Windows Form’s error provider to using Visual Source Safe. In this Studio .NET 2003\Common7\
Steven Mandel has worked in do proper validation in a Winform chapter, she also provides a very Tools\Templates\Database Project
the IT industry for over 15 years setting. neat tip on viewing datasets as Items”. If you decide to modify
designing databases using Chapter three has code tips. XML which is very handy espe- the templates ,you should rename
Microsoft Access and SQL There are some terrific tables that cially when you are in the midst of them and leave them in the same
Server. He has developed Web outline the use of regular expres- debugging. directory. They will be included
and Windows applications sions that Apress should think In the last chapter, Ms. Kurata in the list of possible templates to
using VB.NET and has written about including in Nathan Good’s discusses myriad tips and tech- select when adding a new stored
numerous articles and reviews otherwise terrific book on regular niques to make your code more procedure in the project.
about ASP.NET and VB.NET. expressions Regular Expression durable such as creating a general While it may take a bit of time,
Recipes for Windows Developers: exception handler and ideas put I would highly recommend placing
4smandel7@yahoo.com A Problem-Solution Approach. forth by the advocates of extreme all of your existing stored proce-
Another interesting discussion programming. dures in database projects. You will
Ms. Kurata has in this chapter is Is this book worth having? You have to manually add some of the
the way you can go about marking bet ya and as Ms. Kurata notes, features that the template provides
your code as obsolete by using the “Did you say ‘I didn’t know that!’ at but it will be worth it. Also, the flow
Obsolete Attribute in your code. least one while reading this book. If of your development will always
Chapter four covers various so it met its object of revealing the begin and end with the database
ADO.NET topics. There is an addi- best-kept secrets of .NET.” project. You will check out the
tional benefit that using a database database “code” when you need to
project provides. It allows you to A Side Note modify it and you will check it back
organize your stored procedures I would like to discuss an often in with your modifications after
into meaningful folder names and overlooked aspect of applica- you have revised it.
“While
only 200 pages this book contains lots of
nuggets that will appeal to all levels of developers”
�� ���������������������������
�������������������������
� �������������������������
� �������������������
� ������������ �
���������������������������������2�3���� ���������������
�� ��������������������������������������������
��������������������������� ��
��
�����������������������
���������������������������
�� ��������������������������������������������
�� ������������
���������������������� ��
��
�������������������������������������������������
����������������������������
������������������������������������������������� �� ��������������������
���������������������������������������������������������������� �� ������������
�� �������������
�������������������������������������������������������������������������������������������������������� �� ����������������������������������
�������������������������������������������������������������������������������������������������������� �� ���������������������������
������������������������������������������������������������������������������������������������� �� �����������������������
��������������������������������������������������������������������������������� �� �����������������
�� �� ����������������������������������
��������������������������������������������������������������������������������������������������������� �� �������������������������������������
������������������������������������������������������������������������������������������������� �� �������������������������������
���������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������
���������������������������������������������������������� �������� ����������������������������������
ALL RIGHTS RESERVED
� ��������������������������
�����������������������������������������������������������������
�������� ����������������������������������
���������������������������������������������������������������������� � ����������������������������
��������������������������������
�� �������� ����������������������������������
COPYRIGHT ©2006 SYS-CON MEDIA
������������������������������������������������������������������ � ���������������������������
�������������
������������������������������������������������������������������������� �������� �����������������������������������������������
����������������������������
������������������������������������������������������������������ � ����������������������������������������������
������������������
������������������������������������������ �� ����������������������������������������������
����������� � ����������������������������������������������
���
����
���
��
���
�� ��
���
�
���
���
��
�����
���
���
���
��
���
��
����
����
��
��
��
�����
��
�
�������������
�����������
�����������
������������������
�������������������������������������
����������������������������������������������� �������������
���������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������
����������������
���������������������������������������������������������������������������������������������������������
���������������������������������������
������
�������������������
������������������������������������������������������������������������������������������������������������ ���������������������������������������������
��������������������������������������������������������������������������������������������������������������������
����������������������������������������������������������������������������������������������������� ���������������������������������������������������
�����������������������������������������������������
������������������������������������������������������������������������������������������������������
���������������������������������������������������
�����������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������� ���������������������������������������������
��������������������������������������������������� ���������������������������������
���������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������
�����������������������������������������������������������������
�����������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������������������������
������������������������������������������������������������������������������������������
�����������
����������������������������
���������������������������
�����������������������������������
������������ ��������������� ����������� ������������
������ ��������� �������� ������
������������������������������������������������ ������������������������������������������������� ��������������������������������������������� �����������������������������������������������
��������������������������������������������� ����������������������������������������� ���������������������������������������������������� �������������������������������������
������������������������������������������� ������������������������������������������� ��������������������������������������������
������������������������������������������ ��������������������������������������������� ���������������������������������������������������
����������������������������������������������� ����������������� ���������������������������������������������
������������������������������������������������������������ �������������������������������������������������������������������
���������������������������������������������������������������������� ���������������������������������������������������������������
����������������������������������������������������������������� ������������������������������������������������������������������
����������������������������������������������������������������� ��������������������������������������������������������������������
������������������������������������������������������������������� �����������������������������������������������������������������
����������������������������������������������������� ����������������������������������������������������������������
�����������������������������������������������������������
�����������������������������������
���������������
������������������������������
��������������������������� �����������������
����������������
�����������������
��������������������������������������
������������������������������������������������ ������� ���������������������� ����������������������� ���������������������
����������������������������������� ����������������������� �����������������������������
������������������������������������
ALL RIGHTS RESERVED
��������������������������������������
Book Review
m
ark Mamone is a program namespace classes. It gives a quick
lead and solutions architect example of how to read a Web page from
for British Telecom, and he’s a server and describes what a proxy
been involved in .NET since server is, and how to connect to one. It
Beta 1; he’s presently spearheading a then shows how to add network connec-
Mono-driven project for BT. Mamone tivity to the RSS aggregator application
has co-authored several books, includ- using the .NET networking classes. It
ing Beginning Fedora 2, Beginning Red closes, like most chapters in this book,
Hat Linux 9, and Professional Windows with a description of the new .NET 2.0
Forms. classes, including the NetworkInterface
The first chapter of this book gives class that retrieves information on all
an overview of .NET, a history of the the network cards in the system, and the
Mono project, and instructions on Ping and FTP classes that support ping
downloading and installing Mono on and FTP protocols and functions.
Linux and Windows. OSX is mentioned, Chapter 11 covers ASP.NET, includ-
but specific instructions aren’t included. ing installing and using both the Mono
Moppix, the “live” version of Mono that XSP ASP server, and installing and
Title: Practical Mono
runs from a bootable CD (based on configuring Apache to be an ASP.NET
Author: Mark Mamone
the Konppix Linux distro), is also men- server using Mono on both Windows and
Publisher: Apress
tioned. Linux. The book gives an example of how
ISBN #: 1-59059-548-3
The second chapter gives an to set up your own Web server and create
introduction to installing and using Price: US $49.99 a WebForm application. It also covers
MonoDevelop, an IDE for .NET develop- creating and consuming Web services. It
ment under Linux that’s closely associ- the Glade design tool for user interface again closes with a description of the ASP.
ated with the Mono project. layout. The author does this by recreat- NET changes in .NET 2.0; however these
Chapter three gives a quick overview ing the same RSS aggregator user inter- changes are so great I would recommend
of basic C#, and chapter four continues face produced in chapter six. using this book to see how to set up ASP.
this covering classes, attributes, inter- Chapter eight covers database con- NET using Mono with XSP and Apache,
faces, delegates, and exceptions, closing nections using ADO.NET, concentrating but continue with another book on ASP.
BY DENNIS HAYES with a short section on what’s new in C# on MySQL. Mono and .NET can use a NET 2.0 such as Pro ASP.NET 2.0 Website
2.0. number of different databases, but here Programming, also from Apress.
Dennis Hayes is an independent Chapter five gives a high-level view the author concentrates on MySQL Chapter 12, the last chapter is
software consultant in Atlanta, GA, of .NET and its advantages, including because it’s one of the most popular divided into two parts. The first part cov-
and has been involved with the the intermediate language, assemblies, open source databases, and it is avail- ers profiling using the Mono profiler and
Mono project for over three years. the GAC (Global Assembly Cache), able on many platforms. Another advan- the low-level OProfile tool that comes as
memory management and garbage tage is that by limiting the discussion to part of Linux. It points out that you can
4dennisdotnet@yahoo.com collection, and application domains. It a single database, he can go into details use other profilers, such as the one for
closes with a short paragraph on each of such as how to install and set up MySQL. the Nermele programming language, by
the system namespaces (IO, Collections, This chapter gives an excellent overview using the Mono profiler flag.
Security, etc.). of using a database with .NET, but if you The second section gives a few good
Chapter six covers creating graph- want to have a deep and wide under- tips on how to write faster programs, such
ics programs using System.Windows. standing of databases under .NET, check as using StringBuilder instead of String
Forms by creating a user interface for out Pro ADO.NET 2.0, also from Apress; when several strings have to be concat-
a RSS aggregator application that uses it covers .NET databases in detail. enated, and using structures instead of
menus, dialog boxes, panels, ListBoxes, Chapter nine covers XML. It starts classes where appropriate. These are
datagrids, and events. The code is cre- with a good overview of XML and all good tips, but are too few and basic to
ated manually without using an IDE of its parts. Since RSS uses XML for its help an experienced .NET programmer,
graphic layout designer so the reader document format, this chapter shows but could be helpful to a beginner.
can understand how a .NET program how to read and write RSS XML docu- This is a great book for anyone who
works. Using System.Windows.Forms, ments, and parse out the information for wants to use .NET on Linux. It gives .NET
this is not that difficult. The chapter clos- the application created in chapter six and programmers everything they need to
es by giving an overview of the advances seven. use Linux, and it gives the Linux gurus
in System.Windows.Forms 2.0. Chapter 10 gives a quick overview of everything they need to use .NET. It is a
Chapter seven covers creating appli- networking, including the OSI model, must have for anyone doing cross-plat-
cations by using the GTK# library and and then introduces the System.Net form .NET.
Website Today!
���������������������������������
���������������������������
24/7
����������������
������������������������������������������
���������������������������������������������������
����������
�������������������������������������������������������������������������������������
�������������
����������������������������������������������������������������������������������������
��������
������������������������������������������������������������������
��������������������
����������
���������������������� ��������������������������������������������������
������������������ ����������������������
������������������������������������ ������������������������������ ��������
��� ����������� �������������������������������������������������������������
�������������������� ������������������������������ �
������������������������ ��������������������������� ����������
������������������� ����������������� ������������������������������������������������������������������������������
������������������� ����
��������������������������� ��������������������������������
��������������������
�����������������������������������������������������������������������
������������������������������������������
Mono
Mono Beta for 1.2 Released... And more from the Mono archives
m
ono has released version some have long been 2.0-compliant,
1.1.13.5 and 1.1.14. Version while others still struggle to be 1.0/1.1-
1.1.13.5 is actually the compliant. Once a library is written,
first release since 1.1.13, it’s easier to keep up with changes in
even though there were four internal new versions, so this should improve
releases in between. The purpose of over time.
this release is to document the chang-
es in those releases; there are no new Commercial Use of Mono
features in this release, just bug fixes in Early in Mono’s development, a
all areas of the project. One reason for number of small companies used
multiple releases was to keep testers it to move their .NET applications
current during the run-up to the major to Linux and Mac. This did several
1.2 release. Release notes are at http:// things for the Mono project: it gave
go-mono.com/archive/1.1.13.5. it credibility and it provided a lot
The 1.1.14 release is considered the of real-life test code that pushed
first beta for the upcoming 1.2 release. improvements in several parts of
This will be Mono’s third major release, Mono, especially its Web Services
the first two being the 1.0 and 1.1 and remoting technologies. Several
releases. The biggest visible addition in companies also paid developers
this release is full support for the Mac- to help with critical parts of Mono.
on-Intel. Another big advance that isn’t hand, it prevents deep compatibility SourceGear and Winfessor are two
visible is the new version of the Boehm with the real SWF, because only a companies that bet on Mono during
garbage collector that Mono uses. The minimum set of WinProc messages the early days.
garbage collector currently doesn’t can be hooked from SWF controls, Not a big a milestone, but Mono
support compacting or moving, which and standard Windows Pinvokes that has now been incorporated into
can cause memory problems on long could have been made won’t work Fedora Core 5. Until now, Mono has
running programs. The new version of with the managed SWF. On the other been never been included in any Red
the garbage collector includes a lot of hand, removing the WINE dependency Hat-related product, and it still won’t
internal changes in preparation for a freed Mono from changes that the be included in Red Hat Enterprise
BY DENNIS HAYES future version, which will do moving WINE project was going through, and Linux (RHEL), the official Red Hat
and compacting. let SWF be ported to non-Intel archi- release.
Dennis Hayes is an independent Included in this release are System. tectures (including Mac), which would
software consultant in Atlanta, GA, Transaction, better support for the Boo have been far more difficult with a What the Future Holds for Mono
and has been involved with the and IronPython languages, improve- WINE-based implementation. I think The biggest headlines in Mono’s
Mono project for over three years. ments in libgdiplus, and more optimi- that as more applications and SWF future are likely to be the comple-
zations in the JIT compiler. controls become fully managed, this tion of SWF, followed by the release
4dennisdotnet@yahoo.com Separately, IronPython is rapidly decision will look better and better. of Mono 1.2. These are tied together
releasing betas for testers and getting and should happen in the next few
ready to release version 1.0; see the Mono Keeps Up With .NET months. Completing the .NET 2.0
IronPython homepage at http://www. Version 2 libraries, and the release of a Visual
gotdotnet.com/workspaces/work- In the early days of Mono, a com- Basic.NET complier are the other big
space.aspx?id=ad7acff7-ab1e-4bcb- mon question was whether Mono milestones down the road. Currently
99c0-57ac5a3a9742 for details. could keep up with changes in there are no dates forecast for finish-
Microsoft’s .NET specification. The ing VB.NET or the 2.0 libraries.
Great Moments in Mono fact that the Mono C# compiler and
This month I’ll finish my take on .NET runtime were compatible with Odds and Ends
the six most important events in the .NET 2.0 within days of its release MonoDevelop, an IDE for Linux,
history of the Mono project and the pretty much answered this question; has released version 0.10. This is
next big milestones. but there are still questions about a big release with a lot of features,
some of the newer technologies such including a GUI designer for GTK#,
Mono Launches a New Version as Microsoft’s Avalon and WinFX, one of the most popular graphics
of SWF but the Open Source community is tool kits on Linux. The full release
Switching from the old WINE- working on them. The class libraries notes can be found at http://www.
based SWF to the new managed SWF are a mixed bag. Depending on the monodevelop.org/Release_notes_
was a big move for Mono. On one difficulty of implementing the library, for_MonoDevelop_0.10.