<?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: Regarding JPA &#8211; is the EntityManager a DAO&#8230;</title>
	<atom:link href="http://blogs.sourceallies.com/2009/09/regarding-jpa-is-the-entitymanager-a-dao/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.sourceallies.com/2009/09/regarding-jpa-is-the-entitymanager-a-dao/</link>
	<description>Technical and process thinking from Source Allies employees</description>
	<lastBuildDate>Mon, 06 Feb 2012 16:35:28 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Sudhakar Ramasamy</title>
		<link>http://blogs.sourceallies.com/2009/09/regarding-jpa-is-the-entitymanager-a-dao/comment-page-1/#comment-16</link>
		<dc:creator>Sudhakar Ramasamy</dc:creator>
		<pubDate>Fri, 09 Oct 2009 15:08:20 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.sourceallies.com/?p=11#comment-16</guid>
		<description>I think the key word is &quot;CRUD apps&quot;. How many apps have you worked on that are strictly  data-entry (create, retrieve, update, delete)?

I had a recent experience where a service class was mixing business logic code with data access code using a DAO. To begin with the class was clearly responsible for two different things.

The moment I had to add some additional processing in the data access code, the class was beginning to bloat. So I extracted the data access code into it&#039;s own service and dao layer and immediately the code became clearer. So I did exactly what this post suggests we may not have to. But then again this wasn&#039;t strictly a &quot;CRUD app&quot;. There was business logic.</description>
		<content:encoded><![CDATA[<p>I think the key word is &#8220;CRUD apps&#8221;. How many apps have you worked on that are strictly  data-entry (create, retrieve, update, delete)?</p>
<p>I had a recent experience where a service class was mixing business logic code with data access code using a DAO. To begin with the class was clearly responsible for two different things.</p>
<p>The moment I had to add some additional processing in the data access code, the class was beginning to bloat. So I extracted the data access code into it&#8217;s own service and dao layer and immediately the code became clearer. So I did exactly what this post suggests we may not have to. But then again this wasn&#8217;t strictly a &#8220;CRUD app&#8221;. There was business logic.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Chrystal</title>
		<link>http://blogs.sourceallies.com/2009/09/regarding-jpa-is-the-entitymanager-a-dao/comment-page-1/#comment-6</link>
		<dc:creator>Jim Chrystal</dc:creator>
		<pubDate>Wed, 16 Sep 2009 16:00:08 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.sourceallies.com/?p=11#comment-6</guid>
		<description>I think we&#039;re on the same page, Paris.  In my prior post I advocate the use of a service layer... just not a separate DAO layer.  And, of course, all services would implement interfaces, so swapping out service implementations would be possible to achieve the desired polymorphic effect.  I would also venture to guess that swapping out a relational database and ORM tool for a Lucene index is probably going to affect all layers of the application, so I don&#039;t know how much of this work could&#039;ve been mitigated by a DAO layer.  That remains to be seen.  Lastly, whether or not Java is the CRUD platform of choice is probably fodder for another thread - I invite you do start such a thread, as I would likely contribute :)</description>
		<content:encoded><![CDATA[<p>I think we&#8217;re on the same page, Paris.  In my prior post I advocate the use of a service layer&#8230; just not a separate DAO layer.  And, of course, all services would implement interfaces, so swapping out service implementations would be possible to achieve the desired polymorphic effect.  I would also venture to guess that swapping out a relational database and ORM tool for a Lucene index is probably going to affect all layers of the application, so I don&#8217;t know how much of this work could&#8217;ve been mitigated by a DAO layer.  That remains to be seen.  Lastly, whether or not Java is the CRUD platform of choice is probably fodder for another thread &#8211; I invite you do start such a thread, as I would likely contribute <img src='http://blogs.sourceallies.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paris Holley</title>
		<link>http://blogs.sourceallies.com/2009/09/regarding-jpa-is-the-entitymanager-a-dao/comment-page-1/#comment-5</link>
		<dc:creator>Paris Holley</dc:creator>
		<pubDate>Wed, 16 Sep 2009 13:51:38 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.sourceallies.com/?p=11#comment-5</guid>
		<description>I agree that in common space now, this really seems like a waste. To put things in perspective however, take a project that I am working on. Built on an older hibernate/spring a few years ago, there was no use of a service/dao layer ( or interfaces for that matter ). Now, there are areas where we want to move form the database to a lucene index, and cannot easily swap out an implementation without breaking functionality. You are right, many CRUD applications will simply pass through to the DAO, but I am all for less logic in your presentation layer. Even if you have a billion getByxxx methods that use the query by example ability in the DAO, its not going to clutter your view classes. Beyond that, should also ask yourself...If all you are doing is dumb CRUD, is Java ( the language ) your best platform?</description>
		<content:encoded><![CDATA[<p>I agree that in common space now, this really seems like a waste. To put things in perspective however, take a project that I am working on. Built on an older hibernate/spring a few years ago, there was no use of a service/dao layer ( or interfaces for that matter ). Now, there are areas where we want to move form the database to a lucene index, and cannot easily swap out an implementation without breaking functionality. You are right, many CRUD applications will simply pass through to the DAO, but I am all for less logic in your presentation layer. Even if you have a billion getByxxx methods that use the query by example ability in the DAO, its not going to clutter your view classes. Beyond that, should also ask yourself&#8230;If all you are doing is dumb CRUD, is Java ( the language ) your best platform?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Chrystal</title>
		<link>http://blogs.sourceallies.com/2009/09/regarding-jpa-is-the-entitymanager-a-dao/comment-page-1/#comment-3</link>
		<dc:creator>Jim Chrystal</dc:creator>
		<pubDate>Tue, 15 Sep 2009 18:32:51 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.sourceallies.com/?p=11#comment-3</guid>
		<description>Fair enough.  However, I&#039;m still leaning towards the use of the service layer - just nixing the DAO layer.  Putting the code in the service has the potential for reuse with a minimal coding penalty, IMHO.</description>
		<content:encoded><![CDATA[<p>Fair enough.  However, I&#8217;m still leaning towards the use of the service layer &#8211; just nixing the DAO layer.  Putting the code in the service has the potential for reuse with a minimal coding penalty, IMHO.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Travis Klotz</title>
		<link>http://blogs.sourceallies.com/2009/09/regarding-jpa-is-the-entitymanager-a-dao/comment-page-1/#comment-2</link>
		<dc:creator>Travis Klotz</dc:creator>
		<pubDate>Tue, 15 Sep 2009 15:29:17 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.sourceallies.com/?p=11#comment-2</guid>
		<description>If I&#039;m writing a view that uses a one or more one-off queries to load the data for the view, I have become a big fan of just injecting the SessionFactory directly into the controller and just getting the work done.  I have wasted too many hours writing calls to service layers that to nothing but make calls to DAO&#039;s that do nothing but encapsulate a query that is used in exactly one place.  Most things we do in Enterprise applications are not as reusable as we would like to think.</description>
		<content:encoded><![CDATA[<p>If I&#8217;m writing a view that uses a one or more one-off queries to load the data for the view, I have become a big fan of just injecting the SessionFactory directly into the controller and just getting the work done.  I have wasted too many hours writing calls to service layers that to nothing but make calls to DAO&#8217;s that do nothing but encapsulate a query that is used in exactly one place.  Most things we do in Enterprise applications are not as reusable as we would like to think.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

