Introducing Fluent WCF

About 2 weeks ago Simon and I started to work on building a fluent interface to configure WCF. Our main aim in doing so is to cover the the scenarios of configuring Services and Clients 80% (or 20%) of the time.

Our goals at this stage are

  1. Services over Basic HTTP or TCP
  2. Either No Security and Windows Transport Security
  3. No message level Security
  4. Include Service Meta Data

What this should enable us to do on the Service Host end would look like

var host = new WCFHost()
        .AtAddress("http://localhost:8080/")
        .UsingContract(typeof (IHelloService))
        .WithBinding(new BasicHttpBinding())
        .EnableMex()
        .Start();

I expect more on this shortly.

del.icio.us Tags: ,
  • Share/Save/Bookmark
Update

The last month has been really been one of change. I have moved both home and job and the dust has barely settled. What I can say with some certainty is that moving home is much harder than changing jobs.

During the last month there has been a few requests for Flickrlight and where its at. I still intend to move the code onto codeplex however the finding the time has been my greatest difficulty. If anyone has any experience with setting up a project on codeplex and is volunteering to help it will be appreciated.

del.icio.us Tags: ,
  • Share/Save/Bookmark
LINQ To SQL – Needs our support.

A While back Ian Cooper blogged about the need for active development of LINQ To SQL, he had this to say

As a community, as people begin to realize the suprising power of LINQ to SQL, I would like to see us dispel many of the myths that seem to have grown up around that product. I would like to see us put pressure on the Data Platform team to provide the support for LINQ to SQL that we want going forward. Community reaction is everything and if the LINQ to SQL community remains silent in the face of the more vocal, but probably less numerous, EF community, we won’t get the product we deserve

David Hayden has made a call to Microsoft to Open Source the development of LINQ to SQL in response to the ADO.NET Teams announcement on the future of the Entity Framework and its forgotten other LINQ To SQL.

The ADO.net team says that they will improve LINQ to SQL based on community feedback then there is please head what David Hayden and Ian Cooper are saying.

Simon Segal has previously made a Save LINQ to SQL badge which apart from bring really cool is apt.

So if you want to keep POCO objects free of the IPOCO interface (at least in V1 of EF), I would ask the Data Dudes to set LINQ To SQL Free as per David Hayden’s Suggestion.

  • Share/Save/Bookmark
PDC 08 – Day 2

So like me your one of the many that are not at PDC this year, but you still want to know what’s going check out http://notatpdc.com/

Also check out Jim O’Neil’s PDC Day 2 Wrap Up post.  I have been reading been doing my fair share of reading about all the Oslo, Windows 7 , Azure posts, not forgetting the PDC08 video’s on Chanel 9.  My favourite video so far has been The Future of C# by Anders Hejlsberg 

BTW if you cant find the videos for the session Julia Lerman has taken the effort to describe how to best find the PDC 08 sessions videos.

 

Technorati Tags: ,
  • Share/Save/Bookmark
Silverlight Flickr Image Browser

In my last post about I mentioned creating a simple Flickr Image Browser in Silverlight. Feedback is required please.

Technorati Tags: ,,
  • Share/Save/Bookmark
Flickrlight – Silverlight 2 compatible Flickr API

In learning Silverlight 2 I needed some self imposed tasks, one such task was to build a simple Flickr image browser, among other things. In doing so as most people would I found a .net Flicker API called FlickrNet. However when you try to add a reference to FlickrNet from my Silverlight 2 project I encountered a few issues with projects not loading. However after some research and hacking I was able to . Converting the project was the easy part but it was going to be just too hard to get the entire library working because of its reliance on a lot of calls to methods that are not available in the Silverlight Core CLR.

Therefore I have had to strip the existing FlickrNet functionality down, I have decided to christen it Flickrlight and now have a simple working demo of the Flickr Browser Application.

Flickrlight Demo

  The code is fairly similar to what FlickrNet, for those of you who are familiar with the existing API.

   1: private void btnGetPhoto_Click(object sender, RoutedEventArgs e)
   2: {
   3:     PhotoSearchOptions pso = new PhotoSearchOptions();
   4:     pso.Tags = feedURL.Text;
   5:     Photo p = new Photo();
   6:     p.ApiKey = ApiKey;
   7:     p.Secret = SharedSecret;
   8:     p.OnResponseCompleted += p_OnResponseCompleted;
   9:     p.BeginPhotosSearch(pso);
  10: }

One of the few changes is that the calls being made are Asynchronous and hence require the subscription to the Completed Event.

   1: private void p_OnResponseCompleted(FlickrResponseRecievedCompleteEventArgs<FlickrBase> e)
   2: {
   3:     Action bindToList = () => imageList.ItemsSource = ((Photos)e.ResultValue).PhotoCollection;
   4:     this.Dispatcher.BeginInvoke(bindToList);
   5: }

 

At this stage all I have done was to begin to move the Search for Photos functionality, however over the next few weeks I will move some more of this functionality across. I will also make Flickrlight available on Codeplex (unless someone tells me otherwise). Seeing as this will be my first foray into the world of open source if anyone has any experience with what I should be doing here, your help will be greatly appreciated.

  • Share/Save/Bookmark
The Devils work, in SILVERLIGHT

Hopefully that got your attention. But its not really the devils work. Simon has this theory about why video games and how its the devils work an opinion I do not fully share. Everything in moderation I say including moderation. Anyway I digress , The ninemsn crew has posted a fantastic video of the game QUAKE being ported to SILVERLIGHT yes SILVERLIGHT.

QuakeLight Preview Video

Adam Kinney has a interview with the developer Julien Frelat about the process. I hope we get to see more in the near future.

Technorati Tags: ,,
  • Share/Save/Bookmark
MD5CryptoServiceProvider for Silverlight

The Silverlight clr does not have a MD5  implementation so your on your own when it comes to “signing” calls to REST based web services, like Flickr. A quick google found a clean implementation written in managed code, targeting the compact framework. The managed MD5CryptoServiceProvider was created by GL Conseil/Flow Group SAS. It is available for download from their website, I have also made MD5CryptoServiceProvider Source file available for here for download.

  • Share/Save/Bookmark
How To: Convert a normal Class Library Project to a Silverlight 2.0 Class Library Project

So you want to add a Normal Class Library Project to a Silverlight application, you think to your self how hard could this be despite the Visual Studio Warnings. Well for the most part its fairly simple, however there are a number of problems that I faced when doing exactly that.

Thanks to Neil Mosafi’s post on converting class library project for Silverlight consumption, I found 2 methods of doing the conversion.

1.) Create a NEW Silverlight  Class Library Project and then ADD your EXISTING code files to the project

2.) Hack the csproj file to change its signature (details are courtesy of Neil Mosafi’s post) VS.NET 2008 believes that its a Silverlight Project (don’t forget the changes needs to be made to both the DEBUG as well as RELEASE sections)

Initially I went about making these changes using method 2 however I kept finding a number of issues relating to duplicate references , especially with the HttpWebRequest object and a few other things.

I also needed to change all non generic collections to use their generic equivalents as all non generic collections are not included  in Silverlight 2.0

The Serializable attribute is not part of the coreclr, therefore it has to go, XML Serialization is your friend. Rockford Lhotka has started work on an alternative to the Serializable attribute however its extremely limited at this stage, The Silverlight Serializer may suit your needs so do check it out.

The project I was playing with also used a little bit of XPath Navigation and some other System.XML namespace classes that are not part of the cut down version, so I have to change the code to use Linq to XML

There were a whole bunch of other things that I fixed up and was good to go when I realized that the project changes were not referencing the correct mscorlib and system.xml libraries, however the compiler did not seem to mind to much which baffled me. At this point I decided that the safer way was to go down option 1, simply because I thought it would give a much better jumping off point, lo and behold it has. I am pretty close to having it compile correctly for the Silverlight application which I intend to share.

At the end of this all my advice in converting is to go with method 1, as its just much more fool proof.

  • Share/Save/Bookmark
Every developer must read

Last month I ordered Jimmy Nilsson’s book Applying Domain Drive Design and Patterns along with a couple of others including Patterns of Enterprise Application Architecture, they arrived about a 2 weeks ago.

Finally this week I have started to read ADDP and have been struggling to put it down to do anything else. IMHO this is one of the best Technical books ever written. As a newbie to DDD there is no better starting point than with this book.

Jimmy’s style of writing is very easy to read and understand. The content of course is brilliant, I have just finished reading chapter 2 and feel a few years wiser.

My advice to any developer looking for enlightenment is to read Jimmy’s book. Perfecting the use of Domain Driven Design is not something that comes easy. Even in the smallest application the value of using it is immense. I have a long way to go to become a good developer, and reading this book is going to be a big help in that process.

Technorati Tags:
  • Share/Save/Bookmark