<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.6" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Interface between Domain layer and Persistence layer</title>
	<link>http://blog.gdinwiddie.com/2007/02/13/interface-between-domain-layer-and-persistence-layer/</link>
	<description>Effective software development</description>
	<pubDate>Thu, 20 Nov 2008 22:53:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.6</generator>

	<item>
		<title>by: gdinwiddie</title>
		<link>http://blog.gdinwiddie.com/2007/02/13/interface-between-domain-layer-and-persistence-layer/#comment-905</link>
		<pubDate>Thu, 15 Mar 2007 22:09:46 +0000</pubDate>
		<guid>http://blog.gdinwiddie.com/2007/02/13/interface-between-domain-layer-and-persistence-layer/#comment-905</guid>
					<description>Joe,

Yes, the DAO gives you data from the persistence layer.  I'm not clear on what is your point.</description>
		<content:encoded><![CDATA[<p>Joe,</p>
<p>Yes, the DAO gives you data from the persistence layer.  I&#8217;m not clear on what is your point.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Joe Gutierrez</title>
		<link>http://blog.gdinwiddie.com/2007/02/13/interface-between-domain-layer-and-persistence-layer/#comment-904</link>
		<pubDate>Thu, 15 Mar 2007 21:52:42 +0000</pubDate>
		<guid>http://blog.gdinwiddie.com/2007/02/13/interface-between-domain-layer-and-persistence-layer/#comment-904</guid>
					<description>I don't know if you are using mock objects or not but anytime I am, I want to make my Interfaces as thin as possible. To me Interfaces are like mini frameworks APIs. The DAO component is responsible for giving you data from the persistence layer. Am I wrong?</description>
		<content:encoded><![CDATA[<p>I don&#8217;t know if you are using mock objects or not but anytime I am, I want to make my Interfaces as thin as possible. To me Interfaces are like mini frameworks APIs. The DAO component is responsible for giving you data from the persistence layer. Am I wrong?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: gdinwiddie</title>
		<link>http://blog.gdinwiddie.com/2007/02/13/interface-between-domain-layer-and-persistence-layer/#comment-810</link>
		<pubDate>Sun, 11 Mar 2007 15:14:55 +0000</pubDate>
		<guid>http://blog.gdinwiddie.com/2007/02/13/interface-between-domain-layer-and-persistence-layer/#comment-810</guid>
					<description>Thanks for the note, Lek.

If the logic behind OutstationEmployees becomes more complex, the code will have to change anyway.  It doesn't matter a lot if the code that changes is in the native language of the app or the SQL query it sends to the database.  (I also don't consider adding a WHERE clause to be "highly optimized SQL.")

Cacheing can certainly help in some situations.  With regard to collections of things, I would reserve caching for things that are needed frequently relative to the rate of change.  Otherwise you'll be invalidating your cache on a frequent basis.

If you can hold the entire contents of your database in memory, then maybe a relational database is the wrong sort of persistence for your application.  I think for most business applications, at least the ones I've developed, holding in memory the data on all employees would be a bigger limitation than writing a SQL query.

In what ways does the "data tier not scale well?"  Certainly it can handle larger amounts of data in mass storage than local memory.  What issues do you have in mind?</description>
		<content:encoded><![CDATA[<p>Thanks for the note, Lek.</p>
<p>If the logic behind OutstationEmployees becomes more complex, the code will have to change anyway.  It doesn&#8217;t matter a lot if the code that changes is in the native language of the app or the SQL query it sends to the database.  (I also don&#8217;t consider adding a WHERE clause to be &#8220;highly optimized SQL.&#8221;)</p>
<p>Cacheing can certainly help in some situations.  With regard to collections of things, I would reserve caching for things that are needed frequently relative to the rate of change.  Otherwise you&#8217;ll be invalidating your cache on a frequent basis.</p>
<p>If you can hold the entire contents of your database in memory, then maybe a relational database is the wrong sort of persistence for your application.  I think for most business applications, at least the ones I&#8217;ve developed, holding in memory the data on all employees would be a bigger limitation than writing a SQL query.</p>
<p>In what ways does the &#8220;data tier not scale well?&#8221;  Certainly it can handle larger amounts of data in mass storage than local memory.  What issues do you have in mind?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: lek</title>
		<link>http://blog.gdinwiddie.com/2007/02/13/interface-between-domain-layer-and-persistence-layer/#comment-765</link>
		<pubDate>Sat, 10 Mar 2007 21:51:27 +0000</pubDate>
		<guid>http://blog.gdinwiddie.com/2007/02/13/interface-between-domain-layer-and-persistence-layer/#comment-765</guid>
					<description>Hi,

&#62;&#62; This can create performance and scalability issues in a hurry. It makes me wonder why people jump to this sort of implementation.

public List getOutstationEmployees() {
  List emps = employeeDao.getEmployeesByAddress(corporateOffice);
  List allEmps = employeeDao.getAllEmployees();
  return CollectionUtils.minus(allEmps, emps);
}

Of course, I could use 1 highly optimized SQL query to find OutstationEmployees. What happen if the logic behind OutstandEmployees become more complex? 

IMHO, data tier doesn't scale well. It might be better if I could move some logic to application server. By applying caching on business logic method using AOP, then I don't have to go data tier everytime when I need list of AllEmployees, OutstationEmployees,...</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>&gt;&gt; This can create performance and scalability issues in a hurry. It makes me wonder why people jump to this sort of implementation.</p>
<p>public List getOutstationEmployees() {<br />
  List emps = employeeDao.getEmployeesByAddress(corporateOffice);<br />
  List allEmps = employeeDao.getAllEmployees();<br />
  return CollectionUtils.minus(allEmps, emps);<br />
}</p>
<p>Of course, I could use 1 highly optimized SQL query to find OutstationEmployees. What happen if the logic behind OutstandEmployees become more complex? </p>
<p>IMHO, data tier doesn&#8217;t scale well. It might be better if I could move some logic to application server. By applying caching on business logic method using AOP, then I don&#8217;t have to go data tier everytime when I need list of AllEmployees, OutstationEmployees,&#8230;
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
