Creating Customized UserControls (Deriving from ContentControl) in WPF 4 |
- Creating Customized UserControls (Deriving from ContentControl) in WPF 4
- Kaxaml Update + Downloads + A Request
- Silverlight Cream for February 05, 2010 -- #793
- Test Driven Silverlight Body Snatchers
- Test Driven Silverlight Body Snatchers
- ASP.NET MVC 2 (Release Candidate 2) Now Available
- MIX 2010 Zune HD app
- Installing and Setting Up and Encoding for IIS 7 Smooth Streaming and Silverlight
- Installing and Setting Up and Encoding for IIS 7 Smooth Streaming and Silverlight
- Installing and Setting Up and Encoding for IIS 7 Smooth Streaming and Silverlight
- ASP.NET MVC 2 RC 2 Released
- Developing the world’s first interactive Silverlight banner: Metia’s perspective
- Back to Basics - Keep it Simple and Develop Your Sense of Smell - From Linq To CSV
- Upcoming Deal on my Silverlight 4 Book for Blog Subscribers
Creating Customized UserControls (Deriving from ContentControl) in WPF 4 Posted: 05 Feb 2010 01:26 PM PST Another twitter question. As usual, I'm targeting WPF 4 here, but just about everything here works with Silverlight 4 as well. (read from bottom up) Let's say you want to create a standardized "gadget" for your application, from which anyone can derive...( read more )...(read more) | |
Kaxaml Update + Downloads + A Request Posted: 05 Feb 2010 10:36 AM PST Kaxaml Update I had a great conversation with Rob Relyea (Mr. XAML) yesterday about the future of Kaxaml and he shared a lot of very useful pointers about how to use some upcoming .NET 4.0 features to make Kaxaml super awesome. Looks like he's already...( read more )...(read more) | |
Silverlight Cream for February 05, 2010 -- #793 Posted: 05 Feb 2010 09:51 AM PST In this Issue: Joel Neubeck , James Bacon , Jeremy Likness , John Stockton , Fredrik Normén , Subodh Pushpak , Alexander Golesh , PhaniRajuYN , Victor Gaudioso , and Syed Mehroz Alam . Shoutouts: Michael Sync posted the material for his My WPF MVVM Session...( read more )...(read more) | |
Test Driven Silverlight Body Snatchers Posted: 05 Feb 2010 08:31 AM PST This posting is part of the Silverlight HyperVideo Platform documentation and a Silverlight Mini-tutorial . The information in this posting, however, should be of interest to anyone writing meaningful Line of Business applications with Silverlight...( read more )...(read more) | |
Test Driven Silverlight Body Snatchers Posted: 05 Feb 2010 08:31 AM PST
This posting is part of the Silverlight HyperVideo Platform documentation and a Silverlight Mini-tutorial. The information in this posting, however, should be of interest to anyone writing meaningful Line of Business applications with Silverlight. [This is the first of two parts on Test Driven Development. Part 2 will walk through creating Unit Tests in "real time"]
The premise of the classic 1956 film Invasion of the Body Snatchers is that there are "pod people" among us, who are converting "normal" people into pod people one by one. "Once you are a pod person, you think everyone should be one"Once you begin seeing the benefits of TDD you tend to evangelize; its working great for you and you want everyone to become one. This can be helpful, annoying or alarming depending on who you're talking to. My daughters, for example, are quite sick of hearing about it. "They're here already! You're next! You're next!"It seems reasonable to many developers to create unit tests for their code; but the presumed high cost of doing so implies for waiting for a project that is not in "crunch mode." Most developers will be waiting a long, long, long time. Experience indicates that TDD actually saves time – you spend less time debugging and more time coding. Unfortunately, that sounds like "a good theory" and we all know that In theory, theory and practice are the same, The bigger problem is Isaac Newton. Most of us suffer from Newton's first law (significant inertia) and when confronted with an evangelist, we are governed by his third law (the more you push, the more I push back.) "Give Up! You Can't Get Away From Us! We're Not Going To Hurt You!"That said, for the past few years I've had the nagging sense that I was missing something important. Especially given that some of the folks I respect most in the industry were strong proponents; not least my mentors in all things good: RMSquaredF: Robert (Uncle Bob) Martin and Martin Fowler who laid the ground work and established best practices in their seminal works Refactoring: Improving the Design of Existing Code (Fowler) and Clean Code: A Handbook of Agile Software Craftsmanship (Martin). In the latter book, Robert Martin summarizes his approach which I paraphrase here:
Uncle Bob's premise is that you tremendously reduce your risk and thus your fear because your production code never gets ahead of what you know; and you know it because you've tested for it. "I Don't Want Any Part Of It." |
We'll use the Xaml file approach for enabling the user to maintain the state of the program when suspended or shut down (using local storage), post V1. |
The working design now looks like this (using a relational database for persisting the configuration information, and WCF-RIA Services for moving the objects to the client. (A forthcoming blog entry will walk through that aspect of the implementation in detail)
(Click on image for full size)
Links Vs Units
Links are a unique identification of a Unit, and Units are not represented by a class. A Unit is a set of Items (and the selected item), each item's set of topics (and the selected topic) and each item's set of links (and which links are currently displayed). Notice that units are identified by a URL. In V1 the selected item and selected topic are the first in the set, and this design is used only for configuration.
After v1, we'll move from read-only to read-write, allowing the user to persist the current unit and to recreate the state of the application at a later time.
From Tables To Objects
The diagram above was created to show how the RDB would work, but it is a bit misleading. What we really want is not tables but rather objects. There is a very small jump (in this case) from the tables to the business objects as shown here:
(Click on image for full size)
There are a number of advantages to creating these objects, the most significant of which is that I can go ahead and implement the configuration without regard to how these objects were created, providing two implicit benefits:
- I don't have to get all the WCF Ria Services code working before I can make configuration work and…
- The design now allows me to substitute virtually any persistence mechanism (database, Xaml configuration files, etc.) to back these business objects.
Further, these objects are part of the ViewModel, and facilitate binding the View to the ViewModel (as discussed in my mini-tutorial on MVVM).
Implementation
We're now (finally) ready to implement this, and as an experiment in open, honest and direct explanation I'm going to do this in real time, documenting my experience of creating the Unit Tests and the classes and their methods as I do it.
One of the contributors to the slhvp project, Abby Fichtner (aka Hacker Chick) said to me just last night,
The great advantage of testing first is that it forces you to think about what the ideal API would be to each of your classes.
Exactically.
The Configuration Objects
The first implementation issue is this: I already have the following objects in the project:
It isn't clear if the existing Item, Link and Topic (location) classes can be used for configuration, and I have a nagging feeling that I want something more. But here is where Agile development comes to the rescue: Design for what you need right now.
Next up, A Real Time Walkthrough of Test-Driven Development….
ASP.NET MVC 2 (Release Candidate 2) Now Available
Posted: 05 Feb 2010 12:44 AM PST
Posted: 04 Feb 2010 11:57 PM PST
Installing and Setting Up and Encoding for IIS 7 Smooth Streaming and Silverlight
Posted: 04 Feb 2010 11:17 PM PST
Installing and Setting Up and Encoding for IIS 7 Smooth Streaming and Silverlight
Posted: 04 Feb 2010 11:17 PM PST
Installing and Setting Up and Encoding for IIS 7 Smooth Streaming and Silverlight
Posted: 04 Feb 2010 11:17 PM PST
Posted: 04 Feb 2010 09:10 PM PST
Developing the world’s first interactive Silverlight banner: Metia’s perspective
Posted: 04 Feb 2010 04:34 PM PST
Back to Basics - Keep it Simple and Develop Your Sense of Smell - From Linq To CSV
Posted: 04 Feb 2010 02:26 PM PST
Upcoming Deal on my Silverlight 4 Book for Blog Subscribers
Posted: 04 Feb 2010 02:37 PM PST
You are subscribed to email updates from "microsoft" via reza in Google Reader To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
No comments:
Post a Comment