<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BasePatterns.org &#187; proxy</title>
	<atom:link href="http://basepatterns.org/tag/proxy/feed/" rel="self" type="application/rss+xml" />
	<link>http://basepatterns.org</link>
	<description>Trends in software design</description>
	<lastBuildDate>Thu, 05 Apr 2012 00:13:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Service Selector</title>
		<link>http://basepatterns.org/2009/11/service-selector/</link>
		<comments>http://basepatterns.org/2009/11/service-selector/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 03:43:24 +0000</pubDate>
		<dc:creator>fortuna</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[patterns]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://basepatterns.org/?p=115</guid>
		<description><![CDATA[Sometimes we may have more than one implementation and/or instance of a service to which we need to route requests. Routing may be controlled by a number of different factors, such as the request type, request arguments, runtime configuration, etc.

An implementation of such routing might look something like this:

[java]
public interface SomeService {
  void someMethod();
}

public class RoutingSomeService implements SomeService {

  private Map<String, SomeService> delegates = ...

  private String activeDelegateId = ...

  public void someMethod() {
    SomeService delegate = delegates.get(activeDelegateId);
    if (delegate != null) {
      delegate.someMethod();
    }
    else {
      // XXX: throw runtime exception???
    }
  }
}
[/java]]]></description>
		<wfw:commentRss>http://basepatterns.org/2009/11/service-selector/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

