posts - 916, comments - 758, trackbacks - 11

My Links



Post Categories

Misc. Coding


Why do so many people mess up Singletons?

I've written about this a few times now (use the search thingy to find where) but I'm still surprised how many people mess up the Singleton pattern.   For instance take: if (blogSettingsSingleton == null)                 {                     blogSettingsSingleton = new BlogSettings();                 }                 return blogSettingsSingleton;   Looks ok, right? But this is a classic poor pattern when dealing with multi-threaded apps. Why? Look at the initial 'if' statement, and think what happens if multiple treads hit this at the same thread...

posted @ Sunday, January 27, 2008 4:47 PM | Feedback (0) | Filed Under [ .NET Code Snippets Patterns Performance ]

To struct or not to struct

I've been commenting on this post by Bernal Schooley on a method using structs to 'simplify' using ViewState. Bernal has had a couple of posts around ViewState and methods of making it's use simpler. I have to say the comments on the posts are more useful for me that the posts themselves (as is often the way...comments are still on the blog right ). One problem I do have is advocating the use of structs for this don't get me wrong, I am aware of some advantages around structs; which go away slightly when using Generics as the constant...

posted @ Tuesday, October 09, 2007 11:15 AM | Feedback (4) | Filed Under [ .NET Patterns ]

Playing with .NET Remoting

Recently had the chance to dig into remoting in a bit more detail (for the Bulk Mail app I've mentioned before). I have to say, it's both more difficult and a lot easier than I imagined!Having to modify my class to allow use from a remoting client was a little wierd; I wanted to use SingleCall mode - with a simple response to keep performance up, unfortunately this has led to quite a radical reworking of my main Engine class (and subsequent wasn't that tight in the first place). The actual set up of remoting is however amazingly easy, letting me simple switch...

posted @ Tuesday, January 25, 2005 12:02 PM | Feedback (0) | Filed Under [ .NET ASP.NET Patterns ]

Patterns and Practices...suck!

I think I've made it pretty clear in the past that I think that one of the weakest areas of the Microsoft 'developer experience' is the Patterns & Practices area, don't believe me? OK, try and find an article about the Singleton pattern on the site; hint, don't use the Search feature, it returns a link to the Caching Application block  for 'Singleton' and nothing at all for 'Singleton Pattern'! When you do manage to find it (here), you may notice a few things:1. It doesn't really explain where / why you'd want to use it, here's the 'Context' 'You are building an application...

posted @ Tuesday, July 20, 2004 10:42 AM | Feedback (0) | Filed Under [ .NET Long & Rambling Patterns ]

Interesting site - with a focus on Patterns in .NET

Found this site really interesting from Maxim V. Karpov, basically it's a blog with a focus on the use of design patterns in .NET - which I personally think are currently not widely underused but could provide a huge boost to a whole lot of developers. Maxim recently wrote an article looking at the ASP.NET Out Of Process Session State - which is in itself an implementation of the Intercepting Filter pattern. If you're interested in patterns in .NET you could do a lot worse than look at the Microsoft Patterns site - whilst it isn't perfect (I'd personally like to see a...

posted @ Wednesday, March 10, 2004 1:17 PM | Feedback (0) | Filed Under [ Patterns ]

More on Patterns

Found this on the Furrygoat site, this is a truly excellent site on the GoF design patterns (you'll see this alot, it refers to this book - the original book on design patterns). If you're creating applications in any language, I really recommend you get at least a passing knowledge of what patterns are and how they can be used.

posted @ Sunday, September 14, 2003 3:20 PM | Feedback (0) | Filed Under [ Books Patterns ]

Powered by: