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

, ,

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

, ,

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

, , ,

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

, ,

Mary-Jo shares some of her insight into some of the news around Oslo that may be announced around PDC 08. What interests me is that in my last post I speculated that the Process Server could be some sort of service bus implementation, which seems to be spot on. Yes “Dublin” is the code name for Microsoft’s Distributed Application Server, but hey is that not just a fancy name for or .

I guess when PDC rolls around in a few weeks and more news around what Oslo is and when the bits roll out to developers and architects to see, touch, feel and smell what the CSD and Dev Division guys have come up with is when the real questions need to be asked. All well and good to speculate, I just hope that some parts of the Oslo effort will touch on some of my desires.

 

UPDATE: Mike Taulty has posted links to a whitepaper and a screencast that explain more details about .net 4.0

Technorati Tags: ,,,,

Share/Save/Bookmark

, , , ,

Based on Kavita and Wenlong’s posts (they work with Doug Purdy and Don Box) the .net framework v4 is going to be the building blocks for Oslo.

With .net 4 they are not touting it to be a additive release like 3.0 and 3.5.  Wenlog says that 4.0 will be the next major release since 2.0,

  • Major improvements for WCF and WF
  • Built in dynamic language support
  • adding support for a new language (dynamic) for Oslo’s “model driven” programming

But to get the full picture we are going to have to wait for PDC, when the first CTP bits should be available. I can only predict exciting times ahead, as always more things to learn, I guess its time to open Robert Pickering’s book

Technorati Tags: ,,,,

Share/Save/Bookmark

, , , ,

Oslo has been shrouded in a lot of mystery. Most information on the about Oslo is still speculation. When people think Oslo they think

  • Biztalk V Next
  • Emacs.net
  • Microsoft ESB
  • All of the above and more…

IMHO I believe it to be everything and more, but what proof did i have to support it? Well Doug Purdy announced on his blog about hiring for This raises the question of why another IDE/Text Editor when Visual Studio is very powerful, unless you have tried working with XAML. I digress.

Last night there was posts from Doug Purdy and Don Box that began to unveil bits of what make Oslo.

Doug Describes it as three simple things.

  • A tool that helps people define and interact with models in a rich and visual manner
  • A language that helps people create and use textual domain-specific languages and data models
  • A relational repository that makes models available to both tools and platform components

and Don says that Olso is being created with a couple of intentions

1. We’re making it easier for people to write things down in ways that make sense for the domain they are working in – the common term for this in the wild is modeling.

2. We’re making the things people wrote down accessible to platform components during program execution.

 

Based on this I would take a punt and say that Oslo is going to create a platform for developers to create DSL’s that will be stored in a repository, this DSL is then retrieved and consumed by a visual tool to create on the fly mash-ups of their domain. The key part here is that the visual tool will be something that can be used by Information Workers, Business Analysts, and Project Consultants.

I imagine it to be a tool that enables these Information Workers to use some of Oslo’s features much like using Visio, but instead of static elements there are dynamic objects drawn from the repository that perform a specific business purpose, when put together by the domain expert enables them to perform a task that would have required a developer to perform otherwise.

This is something that is peeking my interest. Wow I can imagine every medium to large business needing something like this. I cant wait for PDC anymore, I just wish I could be there, then again that’s what a Webcast is for.

Doug calls this the “end of the beginning” of his vision of enabling everyone to be a programmer if they can pull something like this of then he may be correct. But I will wait and hold my judgement till I can play with the Bits that should be available at

 

Technorati Tags: ,,,,

Share/Save/Bookmark

, , , ,

Over on the Ado.net blog they have just announced that Devart have just released new Ado.net Data Providers that support the Entity Framework v1.

This is great news for the Entity Framework team. This added support for multiple database vendors is another big plus for choosing the Entity Framework over Linq To Sql.

Just recently I was listening to Steven Forte and Dan Simmons on DNR talking about what the EF, the show revealed a lot of what the Entity Framework team are doing to make this a really great platform. I look forward to seeing what they have for us in the future.

At least for now if you want to use the EF you are no longer restricted to using SQL Server for your data store. Below is a list of Data Providers that will work with the EF as of the 6th of September 2008

Oracle

MySql

PostgresSql

SQLite

Sybase SQL Anywhere

UPDATE: 23-10-08 Added Sybase SQL Anywhere

Share/Save/Bookmark

, ,

The most common use of the ‘@’ is escape character for strings that contain backslashes in them [\]. So as things like code below is possible.

   1: string s = @"c:\windows\system32\";
   2: string s = @"this will retain my \r\n and not change to a line break";

 

But another usage is as an prefix for C# keywords.  In the code below you will notice that the keywords class static and bool are prefixed with the @ prefix.

   1: public class @class
   2: {
   3:     public static void @static(bool @bool)
   4:     {
   5:         if (@bool)
   6:             System.Console.WriteLine("true");
   7:         else
   8:             System.Console.WriteLine("false");
   9:     }
  10: }
  11: public class Class1
  12: {
  13:     [STAThread]
  14:     public static void Main()
  15:     {
  16:         cl\u0061ss.st\u0061tic(true);
  17:         @class.@static(false);
  18:         //class.static(true); //will not work 
  19:     }
  20: }

 

What this also enables is a scenario like the one below, which I do not like.

   1: public class @class
   2: {
   3:     public static void MyCoolMethod(bool @theBoolValue)
   4:     {
   5:         if (theBoolValue)
   6:             System.Console.WriteLine("true");
   7:         else
   8:             System.Console.WriteLine("false");
   9:     }
  10: }
  11: public class Class1
  12: {
  13:     [STAThread]
  14:     public static void Main()
  15:     {
  16:         cl\u0061ss.MyCoolMethod(true);
  17:         @class.MyCoolMethod(false);
  18:     }
  19: }

Spot the difference? In the method signature of MyCoolMethod the boolean parameter has the @ prefix however in the code below where the value of the boolean is being interrogated I have skipped using the identifier. This code will however work exactly the same. The reason for is simple

The identifiers are the same if ‘@’ prefix is removed when used, therefore @theBooleanValue and theBooleanValue are same

To quote

Two identifiers are considered the same if they are identical after the following transformations are applied, in order:

  • The prefix "@", if used, is removed.
  • Each unicode-escape-sequence is transformed into its corresponding Unicode character.
  • Any formatting-characters are removed

 

Most importantly the general advice on using the @ prefix on words that are not keywords  is NOT to use it. And having seen it in used in code have an instant distaste for it. I wonder if FxCop has a rule for checking the usage of the @ prefix for non keywords in identifiers?

 

Technorati Tags: ,,

Share/Save/Bookmark

, ,

Service Broker has a really good C# wrapper interface that comes part of the samples on Codeplex. If you need to work with service broker objects in the managed world then I would recommend using the interface from the .

Most samples I have seen demonstrate communicating within a single database, and hence use the SqlTransaction Class The code below is an example of sending a message to a SSB Service  in a SqlTransaction.

   1: private void SendMsgToSSB()
   2: {
   3:     SqlConnection conn = null;
   4:     SqlTransaction tran = null;
   5:     Conversation dialog = null;
   6:     Service client = null;
   7:     string connString = "Persist Security Info = False; Integrated Security = True; Initial Catalog = MyServiceBrokerDB; Data Source = .; Connect Timeout = 30;"
   8:     try
   9:     {
  10:         conn = new SqlConnection(connString);
  11:         conn.Open();
  12:  
  13:         // Begin a transaction
  14:         tran = conn.BeginTransaction();
  15:  
  16:         // Create a service object
  17:         client = new Service("MyCoolService", conn, tran);
  18:         client.FetchSize = 1;
  19:  
  20:         // Begin a dialog with the MyCoolService
  21:         dialog = client.BeginDialog(
  22:             "MyCoolServiceTarget", null, "DEFAULT",
  23:             TimeSpan.FromMinutes(1), false, conn, tran);
  24:  
  25:         // Create request message
  26:         string outgoingBody = "my really cool msg that broker understands";
  27:         Message request = new Message("DEFAULT",
  28:                                       new MemoryStream(Encoding.UTF8.GetBytes(outgoingBody)));
  29:  
  30:         // Send the message to the service
  31:         dialog.Send(request, conn, tran);
  32:  
  33:         dialog.End(conn, tran);
  34:         tran.Commit(); 
  35:     }
  36:     catch (ServiceException svcEx)
  37:     {//deal with this pesky service exceptions
  38:     }
  39:     finally
  40:     {//clean up here close connections etc.
  41:     }
  42: }

But in scenarios where the transaction needs to be elevated from a lightweight transaction to one that needs the aid of the DTC the SqlTransaction object is not going to cut it for you.

With a simple change (in bold and italicized) you can then support enlisting in a Distributed Transaction.

   1: public void SendMsgToSSB()
   2: {
   3:     SqlConnection conn = null;
   4:     Conversation dialog = null;
   5:     Service client = null;
   6:     string ConnectionString = "Persist Security Info = False; Integrated Security = True; Initial Catalog = MyServiceBrokerDB; Data Source = .; Connect Timeout = 30;";
   7:     try
   8:     {
   9:         conn = new SqlConnection(ConnectionString);
  10:         if (conn.State != ConnectionState.Open)
  11:         {
  12:             conn.Open();
  13:         }
  14:         conn.EnlistTransaction(Transaction.Current);
  15:  
  16:         // Create a service object
  17:         client = new Service("MyCoolService", conn, null);
  18:         client.FetchSize = 1;
  19:  
  20:         // Begin a dialog with the MyCoolService
  21:         dialog = client.BeginDialog(
  22:             "MyCoolServiceTarget", null, "DEFAULT",
  23:             TimeSpan.FromMinutes(1), false, conn, null);
  24:  
  25:         // Create request message
  26:         string outgoingBody = "my really cool msg that broker understands";
  27:         Message request = new Message("DEFAULT",
  28:                                       new MemoryStream(Encoding.UTF8.GetBytes(outgoingBody)));
  29:  
  30:         dialog.Send(request, conn, null);
  31:         dialog.End(conn, null);
  32:     }
  33:     catch (ServiceException ex)
  34:     { //deal with the exception
  35:     }
  36:     finally
  37:     { //clean up
  38:     }
  39: }

 

Again this code has a small issue what about if there is no Transaction available then sending a message without a transaction could be a bad thing. With one more change its ready to support both scenarios.

   1: public void SendMsgToSSB()
   2:   {   SqlTransaction tran = null;
   3:       SqlConnection conn = null;
   4:       Conversation dialog = null;
   5:       Service client = null;
   6:       string ConnectionString = "Persist Security Info = False; Integrated Security = True; Initial Catalog = MyServiceBrokerDB; Data Source = .; Connect Timeout = 30;";
   7:       try
   8:       {
   9:           conn = new SqlConnection(ConnectionString);
  10:           if (conn.State != ConnectionState.Open)
  11:           {
  12:               conn.Open();
  13:           }
  14:           if (Transaction.Current != null)
  15:           {
  16:               conn.EnlistTransaction(Transaction.Current);
  17:           }
  18:           else
  19:           {
  20:               tran = conn.BeginTransaction();
  21:           }