SingingEels : Development Community & Resource

Login

Articles

  • ADO.NET (2)
  • ASP.NET (36)
  • LINQ (5)
  • Security (2)
  • Silverlight (3)
  • SQL (7)
  • Standards (5)
  • WCF (2)

Syndication

  • Articles RSS
  • Blogs RSS

Contribute

  • Our Authors List
  • Member Sign-Up
  • Suggestions Box
Monday, October 29, 2007 : 5:57 AM - (0 comments)

Eels Mini-Update

I'm very excited to say that Google finally updated their "PageRank" stats, and SingingEels is now considered a PageRank 5 website! For those of you who don't know what that means, I'll give a quick explaination. Google's PageRank system judges a site by it's content, popularity and other factors. You rank between a 0 (meaning you're "Joe Shmoe's blog") to a 10 (meaning you are Google or Microsoft)... so to land a 5 is a huge deal!

As far as site updates goes, we've been beyond stagnant (which I'm disappointed in). We are primarily waiting for .NET 3.5 to be fully released, but I know I'm getting very impatient because I love coding with LINQ, extension methods and all that goodness. I promise an entire site update soon.

We've been very busy with our "work work", so the articles have been few, but I'm working on another one about building "connected" websites with AJAX and WCF. I hope to finish it in the next week or two.

Peace,

-Timothy

Tuesday, October 16, 2007 : 7:41 AM - (0 comments)

WCF - Absolutely Amazing

One of my biggest passions in the development world has always been networked programs. For the longest time I've had bitter sweet feelings about Remoting in .NET. Basically, remoting is one of the most beautiful and powerful architectures that .NET has pioneered. The one issue that I've had has been that Remoting in .NET was limited to a "one-way" architecture.

I can't even explain how excited I was when I learned about WCF (released in .NET 3.0 about a year ago) and the "duplex" capabilities thereof... take five minutes, read this article: http://www.codeproject.com/WCF/WCF_Duplex_UI_Threads.asp

Jeff Barnes covers the new features very well and explains some useful "gotchas" that is important to know. For instance thread-afinity and deadlocks (two subjects that I didn't even consider until I realzied the potential dangers).

Kudos To Microsoft

I was curious to see how they would provide support for reaching back to the client connections, so as I read on I caught site of this: "OperationContext.Current". Now, that might not say a lot to you, but it almost made me cry. The idea of a static contextual property that exposes a singleton-like instance back to the client is the perfect way to handle such things (just like HttpContext.Current for you web developers out there).

Again, great article, and great work by Microsoft.

Sunday, October 7, 2007 : 7:40 PM - (1 comment)

Lambda Expressions to Replace Inline Delegates

With .NET 2.0 came a very handy feature of "inline functions" using a very simple 'delegate + method-body' syntax. I quickly adopted this for those quick "one-liners" that seemed pointless to make an actual method for. Example:

this.CancelButton.Click += delegate
{
   this.Response.Redirect("~/View.aspx", true);
};

A function that is basically one line of code, in my opinion, really doesn't need to have a full method created for it. The 'old' way of doing the above would have been something like this:

// This line would be in the OnInit method or something.
this.CancelButton.Click += new EventHandler(this.Cancel_Click);

// And this method is a bit overkill.

private void Cancel_Click(object sender, EventArgs e)
{
   this.Response.Redirect("~/View.aspx", true);
}

Lambda Expressions Replace Inline Delegates

As I pointed out in the title of this blog post, I'm no longer going to be using inline delegates for basically anything. I didn't realize I could do this with lambda expressions until a collegue pointed it out to me, but here is how to accomplish the above using lambda in C#.

this.CancelButton.Click += (sender, args) => this.Response.Redirect("~/View.aspx", true);

It may not look like we've done much, but this is really beautiful! First of all, we are able to utilize the parameters if we wanted to, and secondly we are able to drop the "method body" sytax by removing the { and } characters because this is a one line method.

If you wanted to have multiple lines of code executed, you could do something like this:

this.MyButton.Click += (sender, args)
{
   // any amount of code here... you can also use

   // the "sender" and "args" objects as you'd like.

};

Another great benefit of using the lambda expressions in this way is that you can re-use the same variable names because the are "scope specific". Example:

this.MyButton.Click += (sender, args) => DoSomething();

this.MyOtherButton.Click += (sender, args) => DoSomethingElse();

Enjoy!

Sunday, October 7, 2007 : 7:27 PM - (0 comments)

Bug Fixes and Updates

Sadly, Eels has taken a "break" for the past month of so due to some heafty deadlines at work. As all of the contributors to the site have full time jobs in the development field, we have to step aside sometimes to focus on our assignments (the ones that pay the bills that is).

I've personally been enjoying working with .NET 3.5 (LINQ, and the new language enhancements in C# 3.0) on two of my new projects. One has moved into production already, and the other is due to launch mid to end of November.

I've just finished fixing a few issues on Eels, one major one being that no one could log in due to the transaction log being full :P (it's a SQL thing). So that's been fixed.

We're also in the middle of a major overhaul to .NET 3.5 utilizing LINQ for our data access and some clean AJAX features to update some of the site features. Also, the menu items on the left are going to be changed to a more intuitive design. I clicked on "Write an Article" the other day, forgetting that the link takes me to "how to write an article", as apposed to "Create Article" which is what I wanted to do... sheesh, my own design kills me.

I'll keep you all posted. Hopefully you can see some nice updates soon!

Developer / Architect / Author

Blog Archives

  • June 2009 - (1)
  • January 2009 - (1)
  • November 2008 - (1)
  • October 2008 - (2)
  • September 2008 - (2)
  • August 2008 - (3)
  • July 2008 - (1)
  • June 2008 - (3)
  • May 2008 - (2)
  • April 2008 - (2)
  • March 2008 - (4)
  • February 2008 - (2)
  • December 2007 - (2)
  • November 2007 - (1)
  • October 2007 - (4)
  • September 2007 - (9)
  • August 2007 - (7)

Related Ads

SingingEels.com as of Mar 15 2010 - 03:21:01 PM - (0.0312514)