ploeh blog

Mark Seemann's discontinued .NET blog.

Browse by Tags

Tagged Content List
  • Blog Post: TechEd Sessions Sample Code

    Now that both of my TechEd sessions are over, I've had some request for the sample code that I demonstrated at both sessions. The sample code I used at the interactive talk on TDD is attached to this post. The code I demonstrated at my talk on manual and dynamic mocks is available upon request...
  • Blog Post: CovariantCollection

    One of the known limitations of .NET generics is the limited support for covariance. This is sometimes a challenge when it comes to collections. As an example, consider this simple abstract class: public abstract class MyClass { protected MyClass() { } } Okay, so that's not the most exciting class...
  • Blog Post: User Context

    Besides logging, one of the most common types of ambient context is the user. Who is the user? Was the user authenticated? What is the user allowed to do? Since being able to answer these questions are such common requirements in software development, the BCL includes the IPrincipal interface that...
  • Blog Post: Call Contexts vs. ASP.NET

    In my former post on Ambient Contexts , I described how you can use CallContext or Thread Local Storage (TLS) to store a context that is specific to the current context of a call. As it turns out, ASP.NET uses a threading model that disables this approach , since you are not guaranteed that a single...
  • Blog Post: Ambient Context

    These days, I'm becoming increasingly enamored with the idea of implementing cross-cutting concerns using Thread Local Storage (TLS) or the current call context. For the most typical aspects of software, such as security and logging, the .NET framework already takes this approach: Security can...
  • Blog Post: Imperative Configuration

    How can I unit test my application with different configuration settings? A couple of months back, a reader asked me this question, and while I provided an immediate response via email, I think that the question deserves a post of its own. In .NET, using XML-based application configuration is easy...
  • Blog Post: Using Decorators For Inter-Layer Communication

    While I hope that my previous post made it clear that Data Transfer Objects are not my first choice for transferring complex data between layers, I still owe my faithful reader(s) an outline of a better alternative. One option is to define an abstraction (interface or base class) and pass objects...
  • Blog Post: What's An Entity, Anyway?

    These days, I seem to be encountering a lot of entities . Not in the sense of non-corporeal beings as usually depicted in certain science fiction TV shows, but in the sense of data structures. Sometimes, they are called business entities . Although the concept of entities differ from project to project...
  • Blog Post: State Your Dependency Intent

    There are several different ways to implement Dependency Injection (DI), and Martin Fowler describes four of them in his excellent article on IoC/DI . In this article, the first three approaches (Constructor, Property, and Interface Injection) are mainly described as a background for introducing the...
  • Blog Post: Code As Dependency Configuration

    In his article on Inversion of Control and Dependency Injection , Martin Fowler has a quite interesting section towards the end where he talks about how to configure loosely coupled systems. One of his points is that in some cases, it makes more sense to tie it all together using code than by using a...
  • Blog Post: Reasons For Isolation

    Object-oriented applications above some level of complexity are almost always modelled as a layered architecture. While the typical three-layer architecture remains the most widely known, n-layer architecture is also often utilized. Here's a typical design almost anyone can create (in Visio or Power...
  • Blog Post: Authorizing Services

    If you look at the default authorization model for WCF, you will notice that it expects you to implement centralized authorization. While centralized and pluggable authentication makes a lot of sense to me, that's not the case with authorization. Does it really make sense to decouple authorization...
Page 1 of 1 (12 items)