Monday, July 23, 2012

Weekly digest #6

Mutexes, Semaphores, Monitors, ReaderWriterLocks, AutoResetEvents & ManualResets oh my, Abhijeet Patel: Up until a few years ago, mainstream programming for the most part did not involve asynchrony and/or parallelism except for the most performance demanding applications. In the multi core world we live in today async and parallel programming have become common place. Libraries such as TPL which provide first class framework level support and keywords like async/await built on TPL provide language support for writing elegant asynchronous code. Win8 Metro style apps built on the WinRT programming model is inherently async to help keep Metro style UIs responsive and fluid. As easy as it might appear to write async programs using these new features we should not forget our roots and the primitive constructs in the .NET framwework that TPL uses behind the scenes. This post provides a quick primer on the synchronization primitives that exist in the framework and the use cases of ech of them.

.NET Memory Management Basics, Chris Farrell: .NET memory management is designed so that the programmer is freed from the chore of consciously having to allocate and dispose of memory resources. It is optimized to work best with the most common patters of usage. However, the more conscious you become of scalability and performance, the more useful an understanding of NET memory management becomes.

MODEL BINDING WITH ASP.NET 4.5 AND VISUAL STUDIO 2012, Jalpesh P. Vadgama: In earlier version of the asp.net we have to bind controls with data source control like SQL Data source, Entity Data Source, Linq Data Source if we want to bind our server controls declaratively. Some developers prefer to write whole data access logic and then bind the data source with databind method. Model binding is something similar to asp.net mvc binding.

Dependency Injection with ASP.NET Web API and Autofac, Ron Cain: In WebApi, we define the basic verbs of our API in a class derived from ApiController.  When an Http request is received, WebApi uses the request URL and the application’s routing tables to map the request to a specific public method in a specific ApiController class.  All parameters for that method are satisfied using normal model binding.  Those parameter values typically come from the URL or from the request body, but model binding allows them to come from almost anywhere.

Using the ASP.NET Web API UrlHelper, Ron Cain: This article describes how to use the UrlHelper class in WebApi to create URL’s that can be used to invoke ApiController methods.   This UrlHelper class uses the application’s route tables to compose the URL, avoiding the need to hard-code specific URL’s into the app.

Choosing an ORM strategy, Jimmy Bogard: One of the mistakes I see people make (and have made myself) is assuming that you must choose exactly one ORM strategy for an entire database/application/system. It’s simply not the case. You can (and should) tailor your ORM strategy to your use case, and make sure you’re picking the right tool (or feature of the tool) for the job.

Friday, July 13, 2012

Weekly digest #5

Targeting Multiple Platforms with Portable Code: Overview,Brandon Bray: In this post, we will look at how you can use Visual Studio to write portable class library assemblies that can run on multiple Microsoft platforms. You can create a portable class library that will run on Windows 8, Windows Phone, and Xbox 360 devices. This post provides an overview of portable class libraries, and will be followed by more in-depth posts on portable code.

Is recursion really bad, Li Chen: After my previous post about the stack space, it appears that there is perception from the feedback that recursion is bad and we should avoid deep recursion. After writing a compiler, I know that the modern computer and compiler are complex enough and one cannot automatically assume that a hand crafted code would out-perform the compiler optimization. The only way is to do some prototype to find out.

How important is HTML5 Off Line, JoeStagner: There are a collection of facilities that are available to developers using HTML5 that enable an HTML5 app to run when no connection to the internet is available.

Integrating Knockout, JSRender, and Tweeter bootstrap with MVC4, Slava Khristich: MVC framework definitely changed the way we write our web applications now with clear separations between presentation layer, data and logic.With HTML5/CSS3 and jQuery we can see significant shift to client site implementations.New libraries like JSRender and Knockout brought even more separations of concerns to client site code.In this short article I would like to show an example of how I implemented integration between MVC4, JSRender, and Knockout.

JavaScript Data Binding Frameworks, Dan Wahlin: Data binding is where it’s at now days when it comes to building client-centric Web applications. Developers experienced with desktop frameworks like WPF or web frameworks like ASP.NET, Silverlight, or others are used to being able to take model objects containing data and bind them to UI controls quickly and easily. When moving to client-side Web development the data binding story hasn’t been great since neither HTML nor JavaScript natively support data binding. This means that you have to write code to place data in a control and write code to extract it. Although it’s certainly feasible to do it from scratch (many of us have done it this way for years), it’s definitely tedious and not exactly the best solution when it comes to maintenance and re-use.

Friday, July 06, 2012

Weekly digest #4

There’s a new .Net Digital Magazine in town… DNC Magazine, Greg Duncan:After serving thousands of online tutorials, tips and tricks for .NET developers for the last 5 years, DotNetCurry (DNC) is proud to present a high quality technical digital magazine for .NET techies. 'DNC Magazine' is a Free, bimonthly digital publication bringing you the latest from the .NET world presented by Microsoft MVP's and industry veterans, with years of experience in software development. This month's edition features hot topics like MVC4, SignalR, Knockout.js, TDD, VS ALM, HTML5, Azure and Metro Applications amongst others. Not to mention, a freewheeling interview with Ayende Rahien, the man behind RavenDB.

INotifyPropertyChanged Implementation for VS2012,Kathleen Dollard: I told some folks at the East Tennessee .NET UG (ETNUG, which was adorably put on the reservation board at the after meeting bar as “Eatnug”) meeting in Knoxville that I would post info on a .NET 4.5 version of INotifyPropertyChanged that used CallerMemberName. I also said I wanted to reference other people rather than making up on my own because I’d rather post something already vetted.

Easy Scaling in XAML (WPF), Robert May: Ran into a problem that needed solving that was kind of fun.  I’m not a XAML guru, and I’m sure there are better solutions, but I thought I’d share mine.

Jazz Up Your C# Code, Charles Wiebe and John Hansen: Maintaining code with complex permissions tends to be difficult, because the code can be distributed across multiple classes. By embedding permissions directly on methods and properties within a class, code is reduced and maintainability is simplified.

Stored procedures DO NOT increase performance, Shivprasad koirala: I assume ☺ that you have clicked on this article / blog because you are an awesome fan of stored procedures (like me) and you cannot see these kind of loose statements. My sincere suggestion would be to read this article once, give a thought on experiments and then the comments sections are always there to throw bricks at me.

SQL SERVER – Retrieve SQL Server Installation Date Time, Pinal Dave: I have been asked this question a number of times and my answer always has been “Search online and you will find the answer.” Every single time someone follows my answer, he finds the accurate answer in just a few clicks. However, this question is getting very popular nowadays, so I decided to answer this question through a blog post.