views:

75

answers:

6

I have a class whose sole purpose is to decide, based on a setting, whether to call A) a business layer using a WCF service first or B) the business layer directly.

What is the naming convention for a class the is just a redirector. I was thinking either using "Wrapper" or "Controller" in the class name.

+1  A: 

Why not simply call it Redirector? Good description of what it does, and you don't use overused terms like "Wrapper" or "Controller".

Oded
+1  A: 

At the simplest level, what you are describing is a proxy to your business layer.

As it is directing the dispatch of your remote method invocation, you could call it a dispatcher or director. However, I would expcet something called 'dispatcher' to actually send something to a destination (such as a work unit, or piece of data) and not block waiting for it to complete.

Paul Ruane
+3  A: 

Here are some other good choices.

  • Proxy
  • Facade
  • Surrogate
  • Agent

Come up with a few good candidates and start plugging them into your favorite thesaurus to get alternate ideas.

Brian Gideon
Typically I have also used Proxy for this type of class
Calgary Coder
+3  A: 

I've used façade for classes like this - though I prefer to just let the business layer itself handle the decision when possible.

Jeff Sternal
Does the cedilla actually compile? :) http://en.wikipedia.org/wiki/Cedilla
Robaticus
@Robaticus - it does in C#! But point taken. ;)
Jeff Sternal
LOL, I had *no* idea about that. From now on, all my code will be multilingual just to confuse other devs!
Robaticus
+1  A: 

This sounds somewhat like a Service Locator to me.

That being said, I can't help wanting to name it The Decider.

Chris Shouts
A: 

I typically use the term facade.

Doobi