<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Strengthening your domain: Encapsulating operations</title>
	<atom:link href="http://lostechies.com/jimmybogard/2010/03/24/strengthening-your-domain-encapsulating-operations/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/jimmybogard/2010/03/24/strengthening-your-domain-encapsulating-operations/</link>
	<description>Strong opinions, weakly held</description>
	<lastBuildDate>Sun, 19 May 2013 03:22:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: bogardj</title>
		<link>http://lostechies.com/jimmybogard/2010/03/24/strengthening-your-domain-encapsulating-operations/#comment-2245</link>
		<dc:creator>bogardj</dc:creator>
		<pubDate>Tue, 30 Mar 2010 14:57:14 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/03/24/strengthening-your-domain-encapsulating-operations.aspx#comment-2245</guid>
		<description>@Joe

It was a fun experiment that taught me a lot about the C# spec....but otherwise, it just looked wonky after a while.</description>
		<content:encoded><![CDATA[<p>@Joe</p>
<p>It was a fun experiment that taught me a lot about the C# spec&#8230;.but otherwise, it just looked wonky after a while.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://lostechies.com/jimmybogard/2010/03/24/strengthening-your-domain-encapsulating-operations/#comment-2244</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Tue, 30 Mar 2010 14:18:30 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/03/24/strengthening-your-domain-encapsulating-operations.aspx#comment-2244</guid>
		<description>Jimmy,  Whatever happened to that awesome idea you had to use a magic character to replace spaces in your unit test names?</description>
		<content:encoded><![CDATA[<p>Jimmy,  Whatever happened to that awesome idea you had to use a magic character to replace spaces in your unit test names?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: amir</title>
		<link>http://lostechies.com/jimmybogard/2010/03/24/strengthening-your-domain-encapsulating-operations/#comment-2243</link>
		<dc:creator>amir</dc:creator>
		<pubDate>Fri, 26 Mar 2010 01:56:10 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/03/24/strengthening-your-domain-encapsulating-operations.aspx#comment-2243</guid>
		<description>Sorry typo.. it is not Shopper .. but suppose to be ShopOwner

ar customer = new Customer(); 
customer.HasBeenCharged(100,shopOwner); 

or 

customer.HasBeenCharged(new CustomerChargeFees(100,shopOwner)); </description>
		<content:encoded><![CDATA[<p>Sorry typo.. it is not Shopper .. but suppose to be ShopOwner</p>
<p>ar customer = new Customer();<br />
customer.HasBeenCharged(100,shopOwner); </p>
<p>or </p>
<p>customer.HasBeenCharged(new CustomerChargeFees(100,shopOwner)); </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: amir</title>
		<link>http://lostechies.com/jimmybogard/2010/03/24/strengthening-your-domain-encapsulating-operations/#comment-2242</link>
		<dc:creator>amir</dc:creator>
		<pubDate>Thu, 25 Mar 2010 13:15:21 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/03/24/strengthening-your-domain-encapsulating-operations.aspx#comment-2242</guid>
		<description>Ya i agree with you and actually beside using fluent method chain, we can explicit add amount parameter

s.ChargeFeeTo(customer,amount);

Customer will not charge their self, so we need to give this role to correct party. But we still need a method that receive command that reflect the customer state right. I will probably will have IsCharged(amount) in Customer

</description>
		<content:encoded><![CDATA[<p>Ya i agree with you and actually beside using fluent method chain, we can explicit add amount parameter</p>
<p>s.ChargeFeeTo(customer,amount);</p>
<p>Customer will not charge their self, so we need to give this role to correct party. But we still need a method that receive command that reflect the customer state right. I will probably will have IsCharged(amount) in Customer</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bogardj</title>
		<link>http://lostechies.com/jimmybogard/2010/03/24/strengthening-your-domain-encapsulating-operations/#comment-2241</link>
		<dc:creator>bogardj</dc:creator>
		<pubDate>Thu, 25 Mar 2010 12:19:58 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/03/24/strengthening-your-domain-encapsulating-operations.aspx#comment-2241</guid>
		<description>@amir

So if I only call ChargeFeeTo(), and not Amount(), my code compiles, yet the operation is not complete.  Can I charge a fee without an amount?  Probably not, so I&#039;d want to be explicit in my domain with that.</description>
		<content:encoded><![CDATA[<p>@amir</p>
<p>So if I only call ChargeFeeTo(), and not Amount(), my code compiles, yet the operation is not complete.  Can I charge a fee without an amount?  Probably not, so I&#8217;d want to be explicit in my domain with that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: amir</title>
		<link>http://lostechies.com/jimmybogard/2010/03/24/strengthening-your-domain-encapsulating-operations/#comment-2240</link>
		<dc:creator>amir</dc:creator>
		<pubDate>Thu, 25 Mar 2010 03:56:03 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/03/24/strengthening-your-domain-encapsulating-operations.aspx#comment-2240</guid>
		<description>I feel customer.ChargeFee(100m) somehow is not really describe the scenario.

I will prefer to change to

Customer customer = new Customer();

Shopper s = new Shopper();
s.ChargeFeeTo(customer).Amount(100m);

customer.MadePayment(50m);</description>
		<content:encoded><![CDATA[<p>I feel customer.ChargeFee(100m) somehow is not really describe the scenario.</p>
<p>I will prefer to change to</p>
<p>Customer customer = new Customer();</p>
<p>Shopper s = new Shopper();<br />
s.ChargeFeeTo(customer).Amount(100m);</p>
<p>customer.MadePayment(50m);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bogardj</title>
		<link>http://lostechies.com/jimmybogard/2010/03/24/strengthening-your-domain-encapsulating-operations/#comment-2239</link>
		<dc:creator>bogardj</dc:creator>
		<pubDate>Thu, 25 Mar 2010 00:23:54 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/03/24/strengthening-your-domain-encapsulating-operations.aspx#comment-2239</guid>
		<description>@Josh

We could just as easily deducted the amount from the already-calculated balance, instead of recalculating it each time.  The original problem is that it&#039;s expensive to calculate entire swaths of balances, say listing all the customer&#039;s fee&#039;s balances.  Or if you want to query on that information, it becomes quite difficult.

@Mark

In another app we had, all customer catalog prices were cached and pre-built, simply because it was too expensive to calculate up-front.  We had a bounded context around catalog management, and could use events to notify when certain things changed.  Individual prices could then be re-calculated, but now in a domain object format that was centered around price calculation.

The big thing here is that the Fee object is self-consistent.  We can give the Fee object things to help calculations, but ultimately we don&#039;t want half-baked operations.</description>
		<content:encoded><![CDATA[<p>@Josh</p>
<p>We could just as easily deducted the amount from the already-calculated balance, instead of recalculating it each time.  The original problem is that it&#8217;s expensive to calculate entire swaths of balances, say listing all the customer&#8217;s fee&#8217;s balances.  Or if you want to query on that information, it becomes quite difficult.</p>
<p>@Mark</p>
<p>In another app we had, all customer catalog prices were cached and pre-built, simply because it was too expensive to calculate up-front.  We had a bounded context around catalog management, and could use events to notify when certain things changed.  Individual prices could then be re-calculated, but now in a domain object format that was centered around price calculation.</p>
<p>The big thing here is that the Fee object is self-consistent.  We can give the Fee object things to help calculations, but ultimately we don&#8217;t want half-baked operations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Allen</title>
		<link>http://lostechies.com/jimmybogard/2010/03/24/strengthening-your-domain-encapsulating-operations/#comment-2238</link>
		<dc:creator>Mark Allen</dc:creator>
		<pubDate>Wed, 24 Mar 2010 22:16:44 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/03/24/strengthening-your-domain-encapsulating-operations.aspx#comment-2238</guid>
		<description>I have a similar question as Josh. I aspire to building a strong domain model, but I have difficulty balancing that simplicity against complex requirements. Case in point, in our application the formula for calculating the fee is defined in the database and requires a parsing engine to evaluate its amount. It seems silly to try and load that type of functionality into the Fee class, as that class would bloat beyond maintainability. Where do capabilities like these live in the domain model?</description>
		<content:encoded><![CDATA[<p>I have a similar question as Josh. I aspire to building a strong domain model, but I have difficulty balancing that simplicity against complex requirements. Case in point, in our application the formula for calculating the fee is defined in the database and requires a parsing engine to evaluate its amount. It seems silly to try and load that type of functionality into the Fee class, as that class would bloat beyond maintainability. Where do capabilities like these live in the domain model?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henning Anderssen</title>
		<link>http://lostechies.com/jimmybogard/2010/03/24/strengthening-your-domain-encapsulating-operations/#comment-2237</link>
		<dc:creator>Henning Anderssen</dc:creator>
		<pubDate>Wed, 24 Mar 2010 21:40:35 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/03/24/strengthening-your-domain-encapsulating-operations.aspx#comment-2237</guid>
		<description>Josn,
One way to solve that issue would be to send multiple payments in the parameter, such as a list of payments. That would allow you to add multiple payments while recalculating the balance just once.</description>
		<content:encoded><![CDATA[<p>Josn,<br />
One way to solve that issue would be to send multiple payments in the parameter, such as a list of payments. That would allow you to add multiple payments while recalculating the balance just once.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Schwartzberg</title>
		<link>http://lostechies.com/jimmybogard/2010/03/24/strengthening-your-domain-encapsulating-operations/#comment-2236</link>
		<dc:creator>Josh Schwartzberg</dc:creator>
		<pubDate>Wed, 24 Mar 2010 21:17:09 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2010/03/24/strengthening-your-domain-encapsulating-operations.aspx#comment-2236</guid>
		<description>I definitely agree striving for this style of thinking when writing code, but I do have to wonder how you would proceed if calling recalculatebalance() took a long time and you needed to increase it&#039;s performance.   Your first style being a way of handling that, since you could record several times before having to call recalculatebalance(); but of course that leaves you with the original problem. </description>
		<content:encoded><![CDATA[<p>I definitely agree striving for this style of thinking when writing code, but I do have to wonder how you would proceed if calling recalculatebalance() took a long time and you needed to increase it&#8217;s performance.   Your first style being a way of handling that, since you could record several times before having to call recalculatebalance(); but of course that leaves you with the original problem. </p>
]]></content:encoded>
	</item>
</channel>
</rss>
