Wednesday, April 22, 2009
Building Composite WPF Applications at Evansville .NET Users Group
I presented a session last night at the Evansville .NET Users Group in Indiana on building composite applications with Prism 2. It was a great little group with a lot of really good questions. For those that were there, thanks! For those who are interested, here are the slides and demos: Slides Demos
Composite Extensions for Prism 2
I figured that since I wrote my original composite extensions for Prism 1 on an airplane, I should keep up the tradition. On the way home from speaking in Evansville Indiana last night (not surprisingly on Prism), I got all the code in my composite extensions updated to Prism 2. So if you like the modularity and pub-sub events story from Prism and would like to be able to do those same things in a Windows Forms or other kind of .NET application, you can easily do so now with these CompositeExtensions. These extensions allow you to use the modular loading patterns and capabilities of Prism as well as the pub/sub events in a Windows Forms application, or any other kind of application (even console apps, WCF services, etc.). The key pieces remain the same: A CompositeEvent class that has all the same capability as the CompositePresentationEvent class in Prism2, but is not tied to the WPF libraries at all. For the UI thread dispatching capability, it uses the SynchronizationContext class (which is used under the covers by both WPF and Windows Forms, so this class will also work with WPF). A SimpleUnityBootstrapper class that removes the tie to WPF in the bootstrapper by removing the creation of the shell and the region adapter stuff. The code also include a sample Windows Forms application that uses the extensions to load a module and fire and handle pub-sub events. As mentioned in the original post, I also demonstrate a simple way of using the DI container (Unity in this case) to achieve a Region-Manager like UI composition ability in Windows Forms. Check it out and let me know if you have any feedback.
Thursday, March 05, 2009
TFS Build Node Problem Fix
Yesterday (in the midst of trying to get some builds done to get to a release), the Build node of my Team Explorer window for all Team Projects under my main user account went stupid and was displaying a red X for unavailable. Very frustrated, I did some searching and found very little other than one post suggesting that killing my user account and recreating it from scratch would clear the problem. That would also have cost me hours of reconfiguring other programs and settings that are customized under my account, so I dismissed that. Based on that though, I went and created a separate user account and was able to run builds from there and switch back and forth with Switch User to get through the day. The sweet thing was that when I fired up VS 2008 this morning and went to Team Explorer with no project loaded, I noticed a bunch of stuff get spit into my output window. Looking closely, it was a nice little error message from Team System telling me the BuildPackage was not being loaded due to previous errors, and if I wanted to have it try again, just launch VS from the command prompt with the following line: devenv /resetskippkgs Worked like a charm and my environment is totally happy again. You gotta love software that detects its own problems and suggests simple things that actually work to fix it. Well done VSTS team!
Thursday, February 26, 2009
Prism 2 Bits Refresh
Update: Great post by Julian Dominguez from the Prism team here that tells exactly what files changed in case you just want to update those in your source control: http://blogs.southworks.net/jdominguez/2009/02/prism-20-download-bits-refreshed-whats-changed/ In case you have already jumped on downloading Prism 2 (Composite Application Guidance for WPF and Silverlight) when it released about a week ago, time for you to go get some fresh bits. There were a couple of minor issues that have been fixed and the download links now have the updated code behind them. So remove what you have for Prism 2, go to the download links and get the latest. In WPF the main thing affected was that certain containers, TabControl in particular, did not bring their View to the foreground with an Activate call on the region. There was also a build issue for Silverlight projects that was fixed. So go get yer fresh hot bits!
Sunday, February 08, 2009
Avoiding Login Dialogs with TFS Remote Access
I’ve been working on a project for a remote customer for a number of months and something that constantly bugged me is the way TFS wants you to log in every time you open your solution or fire up Team Explorer. Unlike other login dialogs in Windows and Internet Explorer, the one presented by TFS does not have the magic checkbox to “Remember my password”. But at some point I did something on one machine and it stopped asking and was logging me in automatically if I was online. Excellent! Now how to get it to behave the same on my other two dev machines? I did a little thinking and realized that TFS just uses HTTP Web Services for it remote access. The team project I was working on was using SSL and a particular port, lets say it was 8089. So I just fired up the browser, hit http://tfs.somecompany.com:8089 and I got the standard IE login dialog which does have the Save password checkbox. Checked that box, got and error of course because the web service is not designed to be used from the browser, but now whenever I hit the team project in VS through opening the source controlled solution or opening Team Explorer, viola it logs me automatically now. 10 seconds of effort on any machine to avoid the repeated hassles of logins. Nice.
Sunday, January 04, 2009
Friday, January 02, 2009
.NET Technical Forecast 2009
Beginning of the year is always a good time for reflection and speculation on what is to come, so I thought I would put a few thoughts out there on what the technical forecast for 2009 looks like to me. I'll do it in the context of some of the key technologies I work with on a regular basis. WCF: Because this got great adoption from the outset, I don't see a huge change in the rate of adoption of WCF. What I do see is more and more use of the REST programming model that came available in .NET 3.5. Unfortunately, I predict that more people will end up using that model instead of SOAP-based messages than probably should, just because it has the hype right now. REST makes a lot of sense for externally exposed, resource-oriented services to put a minimum bar for consumption of data out there. For secure, reliable enterprise services though, you need the additional protocols that the WS-* stack gives you. Consumption of a SOAP based service is also still far easier due to simple code generation of the proxy. So internal services should still be using SOAP in my opinion, but REST makes perfect sense for public exposure of data, whether read only or read-write. Cloud Services: With the Azure platform announced and PDC, the .NET Services piece of that which has been available for a while in CTP form in its previous incarnation as "BizTalk Services", third party vendors building lots of cloud-like services, expansion of the mobile application market with the explosion of iPhone and the chasing touch devices out there, cloud services will certainly grow in importance and early adopter attention, but since a released Microsoft variant will not come until possibly the very end of 2009 or early 2010, most production projects will probably not accept the risk of building against the platform for at least 6-9 months. WF: One word: hesitation. WF has had very low adoption as it is because it requires a pretty significant shift in the way you think about designing your systems as well as how you go about that. Couple that with a number of rough edges in the programming model and the fact that you have to build a fair amount of infrastructure around your solution to run it effectively in production, and you can understand the slow adoption. It is still a vary rich platform for building complex business applications, but certainly can use some improvement. The good news is, that improvement is coming in .NET 4.0, in a big way. At an SDR I attended in the Spring of 2008, I commented to one of the product team members that I was very pleased because they were fixing or improving every single aspect of the WF model that causes difficulty for me or my customers with the current version. The bad news is that to do that, they are making some pretty sweeping changes in the programming and even hosting model of WF. That doesn't mean that you will have to rewrite anything you build today, there is an easy interop story to run 3.5 workflows and activities in the 4.0 model. But it does mean that if you start building on 3.5 now, you will have to learn a set of skills that you will then have to relearn in about a year to start building things the new way. It is not 100% relearning of course, but the changes are sweeping enough that I would guess that 60-70% of the time you spend on the workflow part of your application will be done at least slightly differently in 4.0 than in 3.5. WPF: Adoption should start to take off more than it has in 2008 due to a combination of factors. One of the impediments are the tools, and those are not going to change substantially until VS 2010 comes out (don't know if that will be its name, but it is reasonable speculation to guess that). However, a bigger impediment has been the learning curve, and having companies willing to bite the bullet to acquire those skills. Competitive pressure, both for the companies and the developers themselves, will continue to mount quickly though as more companies ship nice looking WPF apps that demonstrate the ways you can substantially alter the user experience by using WPF. That will help force people to learn the WPF way of doing things to stay competitive. The other factor is Silverlight adoption. With rapidly growing interest and adoption of Silverlight, companies will quickly realize that the skills investment in either WPF or Silverlight cascades to a large degree into the other technology, so that will allow them to build the best kind of app for their users without needing to master two completely different UI skill sets. And finally of course, the closer we get to better tools, the shorter the period of productivity hits you will have to endure by being on WPF, so that barrier becomes less as well. Silverlight: Although there have been some media hits with a public announcement of dropping Silverlight, there have been many more success stories out there due to Silverlight 2, and I think people are really seeing the light there. Some stuff still belongs in web pages and web forms. But for rich interactive applications that are web delivered, you can't beat Silverlight as a platform when you are a .NET developer. Add to that all the cool new stuff coming to enhance Silverlight development in .NET 4 and VS 10, and you have even more reason to make this a first consideration for any interactive web application. The only caution is similar to what I said about REST services. Don't overuse Silverlight just because it is the shiniest new toy. WPF or Windows Forms smart client apps still make sense for a broad assortment of internal corporate type applications. Economic impacts: OK, the market sucks and we are all feeling the impacts in one way or another. But the fact is that the world already runs on software. And short of a total global economic collapse, we can't stop making or at least maintaining software. So I think there is room for plenty of work in our sector even if things get bad. And if you can align yourself with markets that are doing well, then you should be able to weather the storm. So that is about it. Nothing too startling or earth shaking there. But a view through my eyes based on what I see from working with lots of customers around the globe.
Friday, December 19, 2008
Cloud messaging made easy with Linxter
Want to allow different applications to communicate over the Internet without requiring any service infrastructure of your own and without needing to learn and understand the complexities of WCF? There is now a solution that you might want to take a look at. I've been working with a company called Linxter helping them build out a cloud messaging infrastructure that makes building cloud-connected applications even easier than building them using WCF. Basically they have set up the infrastructure and provided an easy to use SDK that encapsulates all the scary code required to really do reliable messaging over the internet, while supporting occasionally connected scenarios, security, reliability, and other aspects. Basically all you do is download the SDK, add a reference to a single DLL, run a tool to generate a supporting database (file based, SQLite), and start making calls. The API is really simple, you just call CreateMessage to send a message, subscribe to an event to know when you have received a message, and there is a one time step to register your program instance with the back end Linxter Internet Service Bus (ISB) infrastructure. So a simple Hello World app could look something like this: // The API is separated into three interfaces focused on
// the three aspects of using the SDK
ILinxterMessaging messaging = new LinxterSDK();
ILinxterRegistration registration = messaging as ILinxterRegistration;
ILinxterCommunicationChannel commChannels = messaging as ILinxterCommunicationChannel;
// Subscribe so received messages raise an event
messaging.MessageReceived += OnMessageReceived;
// One time step in the life of a program instance - register
registration.RegisterProgramInstance();
// Tell the SDK to start retrieving messages based on a configurable schedule
// On demand also supported
messaging.StartScheduledReceive();
// Create a channel to another instance based on an ID or alias name
ProgramInstanceInfo responder =
commChannels.FindProgramInstances("HelloWorld Responder",
FindProgramInstanceType.ByAlias)[0];
commChannels.CreateRequest(responder, "Invitation message");
// Send on demand or on schedule supported
messaging.SendNow();
// Wait for channel to be opened to the receiver
while (!IsOpenCommunicaitonChannels(commChannels, responder))
{
Console.WriteLine("Waiting for comm channel creation");
Thread.Sleep(1000);
}
// Construct a message to send to the receiver, can be many
List<Guid> receivers = new List<Guid>();
receivers.Add(responder.ProgramInstanceId);
// Each message can have an activity ID to separate different message types
string activityId = "b9501157-be9a-4a98-aab6-1c1e17ac8d99";
// The message body is simply a string
// (in which you can encode whatever data you want, however you want)
Guid msgID = messaging.CreateMessage(receivers, activityId, "Hello World");
// Messages are always queued in the client DB supporting offline scenarios well
messaging.SendNow();
Then of course you need the event handler that receives the messages: static void OnMessageReceived(MessageReceivedEventArgs e)
{
Console.WriteLine("\nNOTICE: Message Received: {0}", e.Body);
}
There is a lot more to it of course, but the point is that you can integrate Linxter into just abobut any kind of .NET program including smart client applications, web applications, and Windows services. You don't have to learn anything about how to get the distributed messaging done, they have done all the work for you.
Eventually there will be support for using Linxter in other platforms, so it can form the glue to integrate applications from different platforms.
Of course you could do these things yourself with WCF and .NET services, but to do it that way you would have to master a much more demanding set of skills and may have to set up some infrastructure of your own. With Linxter, you just need a reference to a library, a few method calls into that library, and an account and your applications can be connected really quickly.
If you want to learn more, you can visit the Linxter Developer site at http://linxterdeveloper.com. You can download the SDK and QuickStarts there as well.
Linxter should be releasing version 1.0 by early 2009, so that is another advantage for the near term compared to building it all yourself with WCF and .NET Servicces.
Check it out and you can give me any feedback, which I can pass along to the development team.
Thursday, November 13, 2008
Visual Studio Connections Slides and Demos
I gave three talks at Visual Studio Connections in Las Vegas this week: - Selecting the Right Client Technology
- This session summarized the capabilities, pros, cons, and influencing factors for deciding between smart client or web, WPF, Windows Forms, ASP.NET, Silverlight and Mobile. It also summarized the client software factories and guidance from Microsoft p&p at the end.
- Leverage Routed Events and Commands in WPF
- This session covered how routed events and commands work in WPF, how to hook them up, how to handle them, how to implement custom commands, and best practices for employing them.
- Developing Service Oriented Workflows
- This session covered building workflow services with WF and WCF. It covered the Send and Receive activities, context bindings, and Workflow Service Host. I showed using workflows as a business process orchestration that calls other services, multiple clients calling into the same workflow, implementing custom send activities to overcome the limitations of the built-in Send Activity, and calling between workflow instances.
You can get the slides and demos for all these sessions here.
|





| August, 2010 (5) |
| July, 2010 (6) |
| June, 2010 (8) |
| May, 2010 (2) |
| April, 2010 (2) |
| January, 2010 (1) |
| December, 2009 (3) |
| November, 2009 (2) |
| October, 2009 (3) |
| September, 2009 (3) |
| August, 2009 (2) |
| July, 2009 (3) |
| May, 2009 (3) |
| April, 2009 (2) |
| March, 2009 (1) |
| February, 2009 (2) |
| January, 2009 (2) |
| December, 2008 (1) |
| November, 2008 (2) |
| October, 2008 (5) |
| September, 2008 (4) |
| August, 2008 (2) |
| July, 2008 (1) |
| June, 2008 (2) |
| May, 2008 (2) |
| April, 2008 (3) |
| February, 2008 (6) |
| January, 2008 (3) |
| December, 2007 (1) |
| November, 2007 (1) |
| October, 2007 (5) |
| September, 2007 (1) |
| July, 2007 (3) |
| June, 2007 (8) |
| April, 2007 (2) |
| March, 2007 (4) |
| February, 2007 (1) |
| December, 2006 (2) |
| November, 2006 (9) |
| October, 2006 (5) |
| September, 2006 (3) |
| August, 2006 (2) |
| July, 2006 (4) |
| June, 2006 (5) |
| May, 2006 (10) |
| April, 2006 (4) |
| March, 2006 (2) |
| February, 2006 (12) |
| January, 2006 (7) |
| December, 2005 (2) |
| November, 2005 (15) |
| October, 2005 (6) |
| September, 2005 (7) |
| August, 2005 (3) |
| July, 2005 (10) |
| June, 2005 (11) |
| May, 2005 (7) |
| April, 2005 (8) |
| March, 2005 (6) |
| February, 2005 (2) |
| January, 2005 (6) |
| December, 2004 (3) |
| November, 2004 (5) |
| October, 2004 (2) |
| September, 2004 (5) |
| August, 2004 (13) |
| July, 2004 (6) |
| June, 2004 (14) |
| May, 2004 (17) |
| April, 2004 (12) |
| March, 2004 (8) |
| February, 2004 (10) |
| January, 2004 (14) |
| December, 2003 (9) |
| November, 2003 (13) |
| October, 2003 (3) |


Sign In
|