Thursday, April 03, 2008

Book Review: Programming WPF: Second Edition by Chris Sells and Ian Griffiths

Written by T. Michael Testi

 

Window Presentation Foundation (WPF) is the foundation for the next generation of Windows applications. WPF represents the best of the control-based Windows world that is tied with the best content-based Web world. Added to this is the graphic performance of DirectX and the deployment capabilities of ClickOnce and you now have a whole new world of applications just waiting to be developed.

 

While this is still uncharted territory — and no one knows where it will lead in five, ten, or fifteen years down the road — if it is anything like the last 15 years of Windows programming, it will be interesting.

 

Programming WPF is for developers and assumes you have some experience with some sort of programming environment. Knowing how to program in .NET and C# is pretty much required. Windows Forms, XML, and HTML are also recommended. You will not be taught how to program here. Programming WPF is a hefty 863 pages and is contained in 18 chapters. Don't drop it on your foot!

 

Chapter 1, "Hello WPF," begins in traditional style with the basics of the WPF technology and a whirlwind tour of the features that will be covered in the following chapters. This way you can see how everything fits together before getting down into the details.

 

Chapter 2, "Applications and Settings," focuses on the bigger picture. Some of the items covered here are application lifetime, keeping track of open windows, and application states and settings.

 

Chapter 3, "Layout," discusses the tools that manage the visual layout of your applications and how to use the tools. By handling many of the mundane tasks such as resizing and handling localization, developers can focus their attention on the more critical portions of layout.

 

Chapter 4, "Input," now takes a look at how to make your application respond to user input. Here the authors take you through some low level input handling as well as the higher-level command system.

 

Chapter 5, "Controls," describes the controls built into the WPF Framework and how they form the building blocks of a user interface, as well as how you can adjust their properties, and even use templates to replace the whole look of the control.

 

Chapter 6, "Simple Data Binding," examines how to use WPF's data binding features to connect the user interface to your underlying data. By the use of WPF's data binding engine, you will get more features with less code.

 

Chapter 7, "Binding to List Data," continues the tracks laid down in chapter six by now showing how binding works with lists of items as well as how to bind with hierarchical data. This includes expanding a single data source into a set of target UI elements, as well as working with XML and relational data.

 

Chapter 8, "Styles," is a powerful mechanism to control your applications appearance while ensuring consistency. Just as with a word processing document, in which a style is a set of properties applied to ranges of content, a WPF style is applied to visual rendering content to change appearances.

 

Chapter 9, "Control Templates," examines the capabilities available for customizing the appearance of your user interface and the controls it contains. By using control templates, you can replace the complete look of the built-in controls without changing the existing behavior.

 

Chapter 10, "Windows and Dialogs," discusses the WPF window class, how it works, and how it provides the facilities necessary to build your dialog windows.

 

Chapter 11, "Navigation," shows that although WPF supports traditional navigation, it also supports web-like navigation. This includes navigation between content, one page at a time. Here you will learn how to use these services, as well as how to use the XBAP deployment model.

 

Chapter 12, "Resources," explains how to use the mechanisms for managing styles and themes, as well as binary resources, such as graphics. Here you will use resources to plug in visual features where they are needed to ensure the right look and feel.

 

Chapter 13, "Graphics," describes the powerful drawing primitives available within WPF. This is not just for designers. Now it is easy to add graphical elements to your design. Because WPF's graphics capabilities are now so vast, this chapter just scratches the surface of what is available.

 

Chapter 14, "Text and Flow Documents," focuses on the text services available wherever text is used. Discussed here is the text object model that defines how text is formatted. Also described is the FlowDocuments used to present large volumes of mixed text and graphics optimized for screen viewing.

 

Chapter 15, "Printing and XPS," takes a look at how printing in WPF is tied to the XML paper specification. XPS not only lets you spool your print, but you can send the XPS file to someone else via email as a preview of what the printed output will look like. Additionally, because of the powerful support, you can now use the majority of the graphical features in print, as well as on screen.

 

Chapter 16, "Animation and Media," describes the animation facilities contained in WPF that allow most of the visual aspects of a user interface to be animated. This is helpful to let the user know the application is still active, as well as providing for transitions from one view to another.

 

Chapter 17, "3D Graphics," can be hosted in the user interface, as well as projecting 2D and user interfaces on to 3D surfaces. This chapter does not look at how to create 3D graphics, but rather how WPF does 3D graphics.

 

Chapter 18, "Custom Controls," shows you that even though one of the benefits of WPF is that you do not have to write custom controls as often, when you do need to you still can. This chapter will show you how to write custom controls and other common element types.

 

While Programming WPF does not go in to deep detail on all topics, it does get deep enough on most of the topics to give you everything you need to know to get up to speed and working with WPF. The authors provide a good blend of clear and concise writing, concrete examples, and helpful code to make a good learning experience.

 

Programming WPF is a book that serves two masters. First, it provides an excellent introductory text for those who are new to WPF. Sure, you have to have experience programming, but this book will get you up to speed in a logical manner without much pain and with reference to the past. Second, it provides a good reference book that covers the topics of WPF. When you are up to your knickers in molasses, it will provide a great reference book to refresh your memory, so it retains its usefulness long after.

 

While WPF is going to take Windows programmers to territories yet undiscovered, Programming WPF is here to make sure you get started down that road with an owner's manual and a set of maps. If you want to learn WPF, then Programming WPF is a great place to start.

,,

Thursday, March 27, 2008

Scientists Aim for Origami Space Flight

Posted by T. Michael Testi

Written By MARI YAMAGUCHI
Associated Press Writer

 

 

KASHIWA, Japan (AP) -- Japanese scientists and origami masters hope to launch a paper airplane from space and learn from its trip back to Earth.

It's no joke. A prototype passed a durability test in a wind tunnel this month, Japan's space agency adopted it Wednesday for feasibility studies, and a well-known astronaut is interested in participating.

 

A successful flight from space by an origami plane could have far-reaching implications for the design of re-entry vehicles or space probes for upper atmospheric exploration, said project leader Shinji Suzuki, a professor at Tokyo University's Department of Aeronautics and Astronautics.

Suzuki said he was skeptical a decade ago when he first discussed with experts the idea of sending into space a craft made in the tradition of Japan's ancient art of paper folding.

 

 

Read it all…


,,

Trapster turns your cell phone into a police detector

Posted by T. Michael Testi

 

By Josh Lowensohn – March 27, 2008, 11:33 AM PDT

 

Skyhook Wireless' geopositioning can be useful, but rarely does it save you from a $400 speeding ticket. A start-up named Trapster is trying to change that.

 

The company has taken a creative spin on using geopositioning to help lead-footed drivers avoid known and newly discovered speed traps and other police dragnets. By installing the application on your mobile phone you'll get heads up on speed cameras, red-light cameras, hiding places, and live police while out and about. The application uses Skyhook Wireless' Wi-Fi and cell tower location positioning system to keep tabs on where you are while you're driving around. It also blends in GPS to give you more precise positioning on city streets.

 

The data comes from other tipsters on the Trapster network, and is updated frequently. Creator Pete Tenereillo tells me there only need to be about 10 active users in each city to provide a reasonable amount of coverage for live police and new traps on major thoroughfares, a number which has already been met in places like Rhode Island, Florida, and San Diego.

 

 Read it all...

 

Wednesday, March 26, 2008

The Web's best free stuff

 

Posted by T. Michael Testi

From InfoWorld

 

There has allways been a wealth of free downloadable applications out there. Even before the internet, people just felt the need to create and keep it free. This article shows the current batch of the best of the bunch.


 

By Preston Gralla and Erik Larkin, PC World, IDG News Service


March 24, 2008

Free: It's the magic word for an ever-expanding wealth of downloadable software and online services. Free doesn't necessarily mean good, however, and hunting for freebies can mean sifting through a lot of junk.

 

That's where we come in. We surfed, clicked, and installed to find sparkling free gems capable of planning your time, keeping you in touch, and tuning and securing your PC, not to mention glitzing up your desktop, helping you stay productive, and entertaining you with music, videos, photos, and games. We paid special attention to programs and services you may not have heard of before.

 

Read it all...

,,,

Software Review -Visual Studio 2008: Professional Edition From Microsoft

Written by T. Michael Testi

 

 

 

Visual Studio 2008: Professional Edition is the latest incarnation of the integrated development environment (IDE) from Microsoft Corporation. It can be used to develop console and GUI applications as well as Windows Forms Applications, web sites, web applications and web services for all platforms supported by Microsoft Windows, .NET Framework (compact as well), Microsoft Silverlight, and Windows Mobile. It includes a code editor, an integrated debugger, and other built in tools for professional software development.

 

Visual Studio 2008, as well as prior versions, does not support any programming language, solution, or tool per-se, it does provide for those functionalities to be plugged into the IDE. Depending on the edition, included within the package are the languages Visual C/C++, Visual Basic, and Visual C#. Also supported are XML/XSLT, HTML/XHTML, JavaScript, and CSS. It also includes Visual Web Developer which is used to create web sites, web applications, and web services using ASP.NET using either VB.NET or C#.net

 

Visual Studio 2008 comes in several editions which target certain core users.

 

Visual Studio Express Edition are a series of free lightweight IDEs that stripped down versions that target specific languages with one each for VB, C++, C#, and web development. They contain a small set of the tools compared to the other systems and are geared for students and hobbyists.

 


Visual Studio Standard Edition provides and integrated IDE for all supported products; it supports XML and XSLT editing and creates deployment packages that only use ClickOnce. It has no integration with Microsoft SQL Server, can only consume Add-ins for extensibility, and has no mobile development support.

 


Visual Studio Professional Edition has all of the features of Standard Edition and adds SQL server integration, mobile development, remote debugging, and adds macro's and packages to Add-ins for extensibility.

 


Visual Studio Team System Edition adds to the Professional Edition features team collaboration functionality items such as metrics and reporting tools. There are five versions of the team systems; Architecture, Database, Development, Test, and Team Suite; the later includes the prior four Team Editions functionality.

 

The version that I evaluated is Visual Studio 2008: Professional Edition which is probably the one that is most used in small to mid-sized professional development environments. It contains all of the tools needed to create professional applications for both the desktop and the web.

 

Visual Studio 2008 was released to MSDN subscribers on November 19 2007 and generally released in early 2008. The focus of this version of Visual Studio is on development of Windows Vista, 2007 Office systems, and Web applications. It also brings a new language feature: LINQ, new versions of the C# and VB languages, a Windows Presentation Foundation visual designer, as well as improvements to the .NET Framework.

 

The goal of this release was to reduce the complexity of building, managing, and deploying all types of applications and by such giving developers more time to focus on solving development challenges. By supporting several languages it will allow programmers of all backgrounds to rapidly create superior end-user experiences.

 

So what is new in Visual Studio 2008?

 

• .NET Framework 3.5 – builds on the .NET Framework 3.0 with enhancements to feature areas such as the base class library, Windows Workflow Foundation (WF), Windows Communications Foundation (WCF), Windows Presentation Foundation (WPF), and Windows Cardspace, as well as LINQ, ASP.NET AJAX, and other improvements.

 

• AJAX Support – now provides developers with all the tools that is required to create quality AJAX enabled web applications. ASP.NET AJAX improvements include content linking support, JavaScript Library enhancements, and browser history support. It also makes Silverlight easier to integrate into ASP.NET Projects. Adding AJAX functionality to a site reduces or eliminates the need for the page to be reloaded every time the users click on a button or select an item.

 

• LINQ Support – also known as Language Integrated Query will allow developers to query data sources like ADO.NET, SQL, and XML. Included are three LINQ implementations: LINQ to SQL which allows users to write queries to retrieve and manipulate data from a SQL Server, LINQ to XML which provides a new way to construct and write and read XML data in the .NET language of choice, and LINQ to Datasets which makes it easier and faster to query data cached in a dataset object. LINQ generally out performs SqlDataAdaptor and reasonably close to SqlDataReader. Considering the additional benefits of LINQ, this is great news.

 

• Targeted .NET Frameworks – now allows you to target the .NET Framework that you want. In Prior incarnations of Visual Studio, you could only target the released version. VS 2002 only worked with .NET 1.0, VS 2003 only worked with .NET 1.1 and VS 2005 only worked with .NET 2.0. Now you have a choice. You can select between 2.0, 3.0 and 3.5. This means when you update your existing application to work with VS 2008, you can stay with the .NET 2.0 Framework and so your clients won't have to upgrade their system. If at some point later you want to update to .NET 3.5 select it on the properties page. Unfortunately, because of significant CLR engine changes, you cannot go back to .NET 1.x.

 

• Integrated Testing – now has integrated testing facilities into Visual Studio 2008 as opposed to having them as an add-on. In the professional version you can create and run two types of tests. First there is unit testing, to check if a specific method of production code works, for regression, or smoke testing. Then there is ordered testing that allows you to run tests in a specific order.

 

• Window Presentation Foundation (WPF) – is aimed at helping developers create attractive and effective user interfaces. Most software developers are more effective with technology than design. In the past the developer would have to integrate some combination of Windows Forms, GDI+, Direct3D, and other technologies together to create an interface. WPF attempts to handle most of that for you. Not that you won't have to still use other technologies, but rather by providing a broad range of functionality into a single technology, WPF can make creating a modern user interface significantly easier.

 

• Windows Communications Foundation (WCF) – is the next generation programming platform and runtime system for building, configuring, and deploying network-distributed services. In the past you have had ASP.NET Web Services (ASMX), Web Service Enhancements (WSE), Microsoft Message Queue (MSMQ), Enterprise Services/COM+, and .NET Remoting. You also had to make a choice of which one to use. With WCF you no longer are limited to one technology or one programming model.

 

• Window Presentation Foundation (WPF) – is the programming model, engine, and tools for quickly building workflow enabled applications on Windows. It contains support for both system workflow as well as human workflow within a wide variety of scenarios such as line of business workflow, interface workflow,

 

• Visual Designers – comes with an XAML based designer, Visual Studio Tools for Office designer which supports the development of InfoPath, Visio, and PowerPoint, as well as Word, Excel and Outlook, WPF Designer to help with WYSIWYG design of UI, a LINQ to SQL Designer, an updated XLM Schema designer (shipping separately)

 

• Office Based Solutions – are available in VS 2008 Professional edition. You can use these to build Microsoft Office-based solutions that are reliable, scaleable, and easier to maintain. By using WPF, WCF, and LINQ and Visual Studio Tools for Office (VSTO) you can build a wide range of customer solutions. These new technologies make it easy to build solutions that were difficult, or impossible in prior versions.

 

• Enhanced Collaborations – between designers and developers make it much easier to create more compelling user experiences. Designers can use Microsoft Expression Web to design a User Interface (UI) and then turn it over to the developers with faith that the subsequent developed business logic code will result with UI design remaining intact.

 

• Improved Mobile Development – within both the Professional and Team systems makes it even easier to extend desktop applications to mobile base devices. Along with .NET Framework 3.5, there are enhanced mobile Windows Forms controls that make it easy to modify and optimize mobile applications' screens to support the mobile devices' smaller displays.

 

• Silverlight Support – is included via a Silverlight SDK and Silverlight Tools for VS08. This is a rich internet application technology that includes a subset of WPF.

 

• JavaScript Intelesense
• Nested ASP.NET master page support at design time
• Rich CSS editing and layout support within the WYSIWYG designer
• Split View Designer for having both source and designer visible at the same time

 

OK, as with any release of a new version of Visual Studio, there are two questions that need to be answered. First, is this early release ready for prime time, and second is it really worth the upgrade? I have been running Visual Studio 2008: Professional Edition for a few weeks now and I have not experienced any problems that could not be traced back to my own fault. In doing some web research, I did find a hot fix that is posted on the MSDN blog that is a performance fix with regards to some sluggishness when working in Design View, but everything on this release appears to be pretty clean.

 

The next question on is this version worth the upgrade? My personal opinion is that it is most definitely worth the upgrade. I guess that if you are writing console apps in unmanaged C++ you can probably skip the upgrade, but if you are doing anything modern especially with regards to application or web development, you will be letting your competition get the upper hand if you don't upgrade.

 

The WPF, WCF, and LINQ are alone worth the upgrade and when you add VSTO, JavaScript Intelesense, Multi-Framework, and ASP.NET AJAX, to me it becomes a no-brainer.

 

So what are the downsides? The two that come to mind are the dropping of support for VBScript and Classic ASP. This means that there will be neither Intelesense help nor highlighting for either of these types of code. This will be a significant problem for those shops that still support these platforms. According to Microsoft, they recommend running Visual Studio 2005 along side of 2008. Now this is not an all is lost proposition. As of this writing word has it that Microsoft is considering restoring this functionality in a service release, but those who are still maintaining older sites will want to keep their existing tools. The other is the lack of support for .NET Framework 1.X. That would have been the cherry on the sundae, but not a deal breaker since no prior version had the multi-framework support.

 

Bottom line, if you are a Microsoft shop, I would most definitely upgrade and begin all new development using Visual Studio 2008 to take advantage of the new technologies. Once you are comfortable using Visual Studio 2008 I see no reason not to upgrade your existing projects. My experience has been that the upgrade is rather painless with relatively few actual code changes.

 

For those who are maintaining older versions of Visual Studio, I would seriously consider making the move to Visual Studio 2008. Even for those who thought that Visual Studio 2005 was a bit problematic, I would suggest that they take a good long look at 2008.

 

My impression is that Visual Studio 2008: Professional Edition; and probably all of the editions, are very, very solid. It is a strong upgrade; perhaps the most decisive upgrade in a long time. I believe that, with very few exceptions, users of prior versions will find a significant feature to justify an upgrade. If you have never used Visual Studio, now is a great time to check it out. I highly recommend Visual Studio 2008: Professional Edition!

 

,,,,,