<?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>Eric Polerecky &#187; WCF</title>
	<atom:link href="http://eric.polerecky.com/archives/category/wcf/feed/" rel="self" type="application/rss+xml" />
	<link>http://eric.polerecky.com</link>
	<description>An outlet for my obsession with technology</description>
	<lastBuildDate>Wed, 08 Sep 2010 21:18:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Dirty Sex: SOA Gone Wong?</title>
		<link>http://eric.polerecky.com/archives/dirty-sex-soa-gone-wong/</link>
		<comments>http://eric.polerecky.com/archives/dirty-sex-soa-gone-wong/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 14:00:00 +0000</pubDate>
		<dc:creator>Eric Polerecky</dc:creator>
				<category><![CDATA[SOA]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[silverlight]]></category>

		<guid isPermaLink="false">http://eric.polerecky.com/?p=466</guid>
		<description><![CDATA[[Disclaimer: This post had a point. ChannelFactory vs. Proxy vs. Hand Rolled Proxy. That point got lost along the way.] The “application” that I am working on is more of a platform then a single application. Our solution contains over 150 projects and is organized into what we call, sub-systems. A sub-system is basically a


No related posts.]]></description>
			<content:encoded><![CDATA[<p>[Disclaimer: This post had a point. ChannelFactory vs. Proxy vs. Hand Rolled Proxy. That point got lost along the way.]</p>
<p>The “application” that I am working on is more of a platform then a single application.<strong> Our solution contains over 150 projects</strong> and is organized into what we call, sub-systems. A sub-system is basically a stand-alone application. sub-systems contain web, shared, service, configuration and testing projects. They can be deployed independently and are designed to be one piece in a larger SOA. These sub-systems are broken down into 5 categories of work. Web (MVC/Silverlight/API), Services, Data (Entities/NHibernate), Queuing, and Support.</p>
<p>For the last years worth of development, with the exception of the silverlight clients talking back to the web server via service reference generated proxy classes, we&#8217;ve been using a Service Factory/Locator pattern. Currently the development team is considering the merits of this implementation and possible alternatives.</p>
<p>Personally; I really like our current design, it follows the basic tenants of SOA and provides many benefits. The benefits out-weight the drawbacks and the drawbacks SHOULD be easy to overcome.</p>
<h4>Cross Sub-System Communication</h4>
<p>Every sub-system has a “shared” library project that houses it’s interfaces. This library is designed to hold only items that need to be shared between sub-systems. Service contracts, request and response messages and data contracts are typical items that should be in the “shared” library project in the sub-system.</p>
<p>When SS-A wants to call a service on SS-B, SS-A adds a project reference to the SS-B’s shared project. Next, SS-A uses our ServiceFactory class to locate and/or create the channel and service client. Now SS-A can work with SS-B’s methods as if they were local and without the need for a service reference or generated proxy class.</p>
<p>Screen-shot here.</p>
<p>We use this pattern because we have control of both the client and server code. </p>
<ol>
<li>Separating the web and app tier.</li>
<li>No need to update ref/proxy when service changed.</li>
<li>Compile time checks.</li>
<li>Testable – Not that we are doing it.</li>
<li>Less code to maintain.</li>
</ol>
<h4>Problems With Current Implementation:</h4>
<ol>
<li>Can’t mock ServiceFactory – I shouldn’t say “can’t”, I just don’t think we’ve tried. Are tests are shit right now anyway.</li>
<li>The Shared project in every sub-system has become a dumping ground for implementations that don’t fit into our current project structure. For example, validators, extensions, repositories, and on and on are in these shared projects. </li>
</ol>
<h4>Shared Sub-System Bloat</h4>
<p>At first this does not sound like a very big deal until you start to work with it. Every class added to the shared projects could potentially have a dependency on another sub-system. When this happens the entire platform starts to break down into <strong>a spider-web of dependency hell.</strong></p>
<p>No really! This is the fucking problem! When I add a reference to a shared project I, by-proxy, add a reference to up to 40 other projects! The shared project in each sub-system should not have ANY references. It should only contain interfaces and/or contracts.</p>
<blockquote><p><em>“The shared project in each sub-system should not have ANY references”</em></p>
</blockquote>
<h4>Serving &amp; Consuming SOA</h4>
<p>There are 2 main sub-systems that act as the services in our SOA. They reside on our application servers, have access to the database, don’t (shouldn’t) communicate with each other and provide a bulk of the business logic. </p>
<p>The consumers of these sub-systems include a web application, console applications, windows services, silverlight web hosts. These systems use the ServiceFactory class to communicate with the application servers. </p>
<h4>F’ing up the program</h4>
<p>The silverlight systems have another hop as they have to send the data down to the client. Our original design was to use RIA Services to emulate being on the server and hopefully write less code. However; since we moved to visual studio 2010 and couldn’t get .NET 4.0 on the servers our team decided to remove RIA. </p>
<p>Now we have a situation where the Silverlight clients need communicate back to their web servers. We used “Right Click-&gt; Add Service Reference” to generate the proxy and a service locator to create the client.</p>
<h4>Knee-Jerk Reactions</h4>
<p>Our dev team, for some crazy reason, is suggesting that having a hand generated service proxy will be easier to mock then one generated via “Add Service Reference”. Also, they are adding “ServiceFactory” like code to the silverlight clients. I don’t know why we can’t use our current implementation by using linked classes in a silverlight class library and more importantly: How this is better in any way?</p>
<h4>Proxy Class Fail</h4>
<p>I feel that the champions for hand rolled proxies are looking at the problem idiosyncratically. The extra work required to keep the client and server code in sync (for both Silverlight and inside the platform) would FAR out weight the benefit of hand rolling proxies. </p>
<p>I just don’t think they realize the amount of use the ServiceFactory gets throughout the platform. </p>
<h4>Testing WCF</h4>
<p>I am far from a testing expert but I am pretty damn good at the googles.</p>
<ol>
<li><a title="http://mokosh.co.uk/post/2009/04/19/prism-2-wpf-and-silverlight-services/" href="http://mokosh.co.uk/post/2009/04/19/prism-2-wpf-and-silverlight-services/">http://mokosh.co.uk/post/2009/04/19/prism-2-wpf-and-silverlight-services/</a> &#8211; (we use prism)</li>
<li><a href="http://houseofbilz.com/archives/2008/11/18/testing-wcf-service-apps-part-0-of-4/">http://houseofbilz.com/archives/2008/11/18/testing-wcf-service-apps-part-0-of-4/</a> &#8211; (we use RhinoMock)</li>
<li><a title="http://stackoverflow.com/questions/2509316/best-way-to-mock-wcf-client-proxy" href="http://stackoverflow.com/questions/2509316/best-way-to-mock-wcf-client-proxy">http://stackoverflow.com/questions/2509316/best-way-to-mock-wcf-client-proxy</a> &#8211; (client proxy)</li>
</ol>
<h4>Governance</h4>
<p>SOA is a complex technology theory that can’t be bought. It requires buy-in from a team, developers and someone to watch over the implementation. Every developer thinks they understand SOA, when asked to implement it they create services and then complain that they don’t need SOA. </p>
<p>When I spent Christmas even developing across 4 layers just to get a fucking coupon onto a page. I bitched but I didn’t break the existing convention. I spent endless hours trying to understand how to fit MVC and SOA into the same project. During my development vietnam, SOA was a pain-in-the-ass, but now that we have a “stable” codebase and have 20/20 I can see how SOA will save our ass when the time comes.&#160; </p>
<h4>Coup d&#8217;état</h4>
<p>A bunch of words go here. They aren’t important. Just know that when implementing SOA the development staff will constantly say things like “this would be so much easer if I could call the database”. SOA is not for developers; it’s for the project and the organization (much like TFS).</p>
<blockquote><p>SOA is not for the developers; it’s for the project and the organization. </p>
</blockquote>
<h4>Concluding</h4>
<p>I think that Silverlight clients should use “Add Service Reference” to generate proxies for a few reasons:</p>
<ol>
<li>Right click “Update Service Reference” is much easier then keeping client and server code in sync. </li>
<li>We are in pretty rapid development.</li>
<li>We can mock the service.</li>
</ol>
<p>Silverlight clients could, not for us, not now, use nant to keep the proxies up-to-date.</p>
<p>All service communication from the web to app tier should use the ServiceFactory pattern.</p>
<p>Console applications, windows services don’t use a consistent pattern. We need to resolve that.</p>
<h4>Explicitly Covering My Ass</h4>
<p>If any of my co-workers happen to read this: I wrote most of the code I’m suggesting needs to be fixed. It’s how I (we) spent my (our) holidays. </p>
<p>I’m just putting some thoughts down so I can understand the situation. I’ve rewrote this a few times when I grasped certain concepts/implementations/reactions/reasons/etc.</p>
<p>I think this sums it up. Now I need to get that one last question answered. </p>
<p><strong><em>Why check in proxies for sub-systems that we have control over the client and server?</em></strong></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://eric.polerecky.com/archives/dirty-sex-soa-gone-wong/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wcf, WebGet and Client Config</title>
		<link>http://eric.polerecky.com/archives/wcf-webget-and-client-config/</link>
		<comments>http://eric.polerecky.com/archives/wcf-webget-and-client-config/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 06:04:11 +0000</pubDate>
		<dc:creator>Eric Polerecky</dc:creator>
				<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://eric.polerecky.com/archives/wcf-webget-and-client-config/</guid>
		<description><![CDATA[try: If you annotate your methods with the WebGet annotation, when a client adds your service as a service ref, there will be no client configuration information. catch: To put that another way, if you use the WebGet annotation it&#8217;s assumed the calling party is going to use rest. finally: if you use the WebGet


No related posts.]]></description>
			<content:encoded><![CDATA[<p>try:<br />
If you annotate your methods with the WebGet annotation, when a client adds your service as a service ref, there will be no client configuration information. </p>
<p>catch:<br />
To put that another way, if you use the WebGet annotation it&#8217;s assumed the calling party is going to use rest.</p>
<p>finally:<br />
if you use the WebGet annotation on your WCF operations they can be called as soap operations</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://eric.polerecky.com/archives/wcf-webget-and-client-config/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dimecasts.net automapper demo</title>
		<link>http://eric.polerecky.com/archives/dimecastsnet-automapper-demo/</link>
		<comments>http://eric.polerecky.com/archives/dimecastsnet-automapper-demo/#comments</comments>
		<pubDate>Tue, 19 May 2009 19:36:19 +0000</pubDate>
		<dc:creator>Eric Polerecky</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[AutoMapper]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://eric.polerecky.com/?p=331</guid>
		<description><![CDATA[I did a short demo of automapper for dimecasts.net. Take a look what do you think? Ha! Dimecasts.net is my phonebook! Ha! No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I did a <a title="AutoMapper DimeCasts.NET Demo" href="http://dimecasts.net/Casts/CastDetails/111" target="_self">short demo</a> of <a title="AutoMapper" href="http://www.codeplex.com/AutoMapper" target="_self">automapper</a> for <a href="http://dimecasts.net/">dimecasts.net</a>. Take a look what do you think?</p>
<p>Ha! Dimecasts.net is my phonebook! <img src='http://eric.polerecky.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p><script type="text/javascript"><!--
var sid=134;var vid=15259;
// --></script><script src="http://www.networkn3.com/scripts/vplay4-start-paused.js" type="text/javascript"></script></p>
<p>Ha!</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://eric.polerecky.com/archives/dimecastsnet-automapper-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
