Living .NET...

Musings on .NET, and the like - Manoj G [MVP, Connected Systems Developer]

Browse by Tags

All Tags » .NET (RSS)
Sorry, but there are no more tags available to filter with.
A simple MSMQ Listener helper class
MSMQ simply provides wonderful capabilities when it comes to building asynchronous messaging based applications. You typically run into situations where two applications exchange messages through a queue – one application sends messages to a known...
Posted: Oct 16 2005, 08:00 PM by Manoj G | with 10 comment(s)
Filed under:
Patterns in .NET : Citing the Chain of Responsibility pattern
Chain of Responsibility basically involves “chaining” a set of objects between a sender and receiver, where each object in the chain does some processing on the message that is sent between the sender and the receiver. In the .NET Framework...
Posted: Sep 29 2005, 10:24 PM by Manoj G | with no comments
Filed under:
Manual ADO.NET Transactions and TLS
I have come across several business and data access layer components which have method overloads taking in SqlTransaction (or IDbTransaction) references. The need here is to facilitate ADO.NET manual transactions, where database operations scattered across...
Posted: Sep 18 2005, 07:24 PM by Manoj G | with 1 comment(s)
Filed under:
Tip: Embedding Resources in Assemblies
[Problem]: Many a times, you end up using large string constants (usually placed in text files) in your application code. Typical examples are XSLT templates, SQL scripts and so on. It doesn’t really look nice to have a string constant defined in...
Posted: May 18 2005, 10:01 AM by Manoj G | with no comments
Filed under:
Patterns in .NET: Citing the Strategy pattern
Strategy is a quite frequently used pattern. Strategy pattern involves "d efining a family of algorithms, encapsulating each one, and making them interchangeable. Strategy lets the algorithm vary independently from clients that use it." Essentially strategy...
Posted: Apr 04 2005, 03:17 PM by Manoj G | with 2 comment(s)
Filed under:
Patterns in .NET: Citing the Command Pattern
Of late, I am getting more and more interested in Design Patterns. As Allan Shalloway, in his most excellent book, Design Patterns Explained explains, design patterns are a great way to understand Object Oriented Programming better. Though design patterns...
Posted: Apr 01 2005, 11:10 PM by Manoj G | with no comments
Filed under:
Stream Quips & Traps
I was working with SoapExtension s and my project involved a lot of reading and writing to streams (Yes, in the ProcessMessage method of the SoapExtension). I came across this good article by Jon Skeet which explains the reading of binary data from the...
Posted: Mar 22 2005, 02:19 PM by Manoj G | with no comments
Filed under:
Contexts & Interception revisited
I have always been awed by the concept of Interception and Aspect Oriented Programming (AOP), especially after having seen and used COM+ Services. In very, very simple terms, AOP is about taking concerns or common aspects in the code (like Concurrency...
Posted: Feb 18 2005, 03:23 PM by Manoj G | with 3 comment(s)
Filed under:
Singleton applications
I think it is a fairly common requirement to develop applications such that only a single instance runs at a time. This is where Mutexes, an inter-process thread synchronization primitive comes into picture. This is one good example where no other WaitHandle...
Posted: Jan 20 2005, 08:26 PM by Manoj G | with 1 comment(s)
Filed under:
Path and Environment: Truly useful classes
I always remember doing painful string manipulations on a file path string, either to extract the drive, the file name or the extension bits from the string in VB6. Things are definitely better in .NET. The System.IO.Path class basically abstracts the...
Posted: Dec 16 2004, 02:19 PM by Manoj G | with no comments
Filed under:
Xpath Expressions and XPathNavigator to the rescue
I would like to admit that I have, many a times, taken XML handling for granted and have come with ghastly pieces of code like the one shown below, where all I need is to find out the number of nodes in an Xml document. What I am doing here, is loading...
Posted: Dec 10 2004, 12:03 PM by Manoj G | with no comments
Filed under:
Throw Trap
Often, in exception handling, we would need to re-throw an exception caught in the catch block, after doing some operation (logging the exception, for instance). But, we generally make the mistake of providing the exception argument in the throw expression...
Posted: Oct 24 2004, 06:55 PM by Manoj G | with 1 comment(s)
Filed under:
Process.Start() Quips
It is more than a common requirement to be able to start another process from executing code. For instance, you might want to execute a batch file, run a command line utility of sorts, and so on. This is facilitated in the BCL through System.Diagnostics...
Posted: Oct 23 2004, 05:15 PM by Manoj G | with 25 comment(s)
Filed under:
Tip: StrongNameIdentityPermission
Many a times in your application, you would want to have a security scheme which would ensure that your code is not referenced and misused by other assemblies. For instance, there might be public types representing custom Identities and Principals which...
Posted: Oct 20 2004, 03:04 PM by Manoj G | with 1 comment(s)
Filed under:
Indexer Insights
We all know that types, including interfaces can have a default property. Default properties are used as a short-hand notation for accessing items in an array/collection of objects contained within the object. For e.g. Item is the default property of...
Posted: Oct 15 2004, 05:29 PM by Manoj G | with 3 comment(s)
Filed under:
Tip: Checking whether an Assembly is compiled in Debug or Release Configuration
Often, it may be necessary to inspect whether a particular assembly was compiled with a Debug configuration (or Release configuration). For instance, you might want to run a tool of sorts on a build folder to ensure that all assemblies are compiled in...
Posted: Oct 12 2004, 08:09 PM by Manoj G | with no comments
Filed under:
String.Format: A Simple Tip
More often than not, we end up concatenating strings in our application code, and a bit aggressively. Sometimes, these concatenations can get a ugly, resulting into a mire of single quotes, double quotes and escape sequences. A simple case of not-so lucid...
Posted: Sep 29 2004, 06:43 PM by Manoj G | with 9 comment(s)
Filed under:
Getting the best of the two (otherwise mutually exclusive) worlds together!
We generally don’t talk about .NET and J2EE together unless, it's a heated debate as to which is better and why. Recently, I came across two very interesting tools which, sort of glues the otherwise mutually exclusive worlds together. The first...
Posted: Aug 26 2004, 03:01 PM by Manoj G | with no comments
Filed under:
CallContext
Many a times, it would be necessary to share some common information/data between methods that form a call chain. For example, consider a call chain like the one shown below: A(); --> B() --> C() --> D(); And lets say B,C and D need to access...
Posted: Jul 30 2004, 07:26 PM by Manoj G | with 1 comment(s)
Filed under:
XML API - When to use What?
I came across this old, but excellent MSDN TV presentation, by Don Box, on ways of using XML API or passing XML data around within an Appdomain. The presentation starts off by discussing pros and cons of passing XML in the form of XmlNode and XmlReader...
Posted: Jul 01 2004, 12:23 PM by Manoj G | with no comments
Filed under:
More Posts Next page »