<?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: Introduction to the DTO plugin</title>
	<atom:link href="http://www.cacoethes.co.uk/blog/groovyandgrails/introduction-to-the-dto-plugin/feed" rel="self" type="application/rss+xml" />
	<link>http://www.cacoethes.co.uk/blog/groovyandgrails/introduction-to-the-dto-plugin</link>
	<description>A search for meaning in software and life</description>
	<lastBuildDate>Thu, 06 Oct 2011 21:33:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Peter</title>
		<link>http://www.cacoethes.co.uk/blog/groovyandgrails/introduction-to-the-dto-plugin/comment-page-1#comment-1196</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Sun, 24 Apr 2011 18:04:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.cacoethes.co.uk/blog/?p=159#comment-1196</guid>
		<description>This article has one example of adding bindData() to a service:

    http://nerderg.com/Grails

Unfortunately, the standard bindData() method is only available on controllers:

    http://grails.org/doc/latest/ref/Controllers/bindData.html

That&#039;s why you currently have to jump through a few hoops to use get bindData() in a service.

Hope that helps,

Peter</description>
		<content:encoded><![CDATA[<p>This article has one example of adding bindData() to a service:</p>
<p>    <a href="http://nerderg.com/Grails" rel="nofollow">http://nerderg.com/Grails</a></p>
<p>Unfortunately, the standard bindData() method is only available on controllers:</p>
<p>    <a href="http://grails.org/doc/latest/ref/Controllers/bindData.html" rel="nofollow">http://grails.org/doc/latest/ref/Controllers/bindData.html</a></p>
<p>That&#8217;s why you currently have to jump through a few hoops to use get bindData() in a service.</p>
<p>Hope that helps,</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Srinivas</title>
		<link>http://www.cacoethes.co.uk/blog/groovyandgrails/introduction-to-the-dto-plugin/comment-page-1#comment-1195</link>
		<dc:creator>Srinivas</dc:creator>
		<pubDate>Fri, 22 Apr 2011 20:50:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.cacoethes.co.uk/blog/?p=159#comment-1195</guid>
		<description>Peter,

Thank you very much for the response.

I am currently using a constructor in Domain Class that takes DTO as input and assigns data to its variables.

public def RewardAccount(RewardAccountDTO dto) {
        this.accountId = dto.getAccountId();
        this.cards = dto.getCards();
        this.customer = dto.getCustomer();
        this.nickName = dto.getNickName();
        this.transactions = dto.getTransactions();
    }

Are you mentioning that the same can be achieved by writing:
bindData(new RewardAccount(), RewardAccountDTO)
If so, this can be done from services. right? And, where is the bindData() method available? Thanks for the info.</description>
		<content:encoded><![CDATA[<p>Peter,</p>
<p>Thank you very much for the response.</p>
<p>I am currently using a constructor in Domain Class that takes DTO as input and assigns data to its variables.</p>
<p>public def RewardAccount(RewardAccountDTO dto) {<br />
        this.accountId = dto.getAccountId();<br />
        this.cards = dto.getCards();<br />
        this.customer = dto.getCustomer();<br />
        this.nickName = dto.getNickName();<br />
        this.transactions = dto.getTransactions();<br />
    }</p>
<p>Are you mentioning that the same can be achieved by writing:<br />
bindData(new RewardAccount(), RewardAccountDTO)<br />
If so, this can be done from services. right? And, where is the bindData() method available? Thanks for the info.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danil</title>
		<link>http://www.cacoethes.co.uk/blog/groovyandgrails/introduction-to-the-dto-plugin/comment-page-1#comment-1192</link>
		<dc:creator>Danil</dc:creator>
		<pubDate>Fri, 04 Mar 2011 16:48:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.cacoethes.co.uk/blog/?p=159#comment-1192</guid>
		<description>Hi
I have a grails project, structured this way:
- &quot;admin-domain-plugin&quot; (plugin with only domains)
- &quot;admin-app&quot; which embedds &quot;admin-domain-plugin&quot;

i&#039;m writing a module &quot;A&quot; (with it&#039;s own domains), and i want it to communicate by jms with &quot;admin-app&quot; via DTO objects without knowing about admin domains. 

My first idea was to create &quot;admin-dto-plugin&quot;, include &quot;admin-domain-plugin&quot; in it, generate DTOs and than install &quot;admin-dto-plugin&quot; into module. 
The problem is with enums : no DTO objects are generated for them so enums are left in &quot;admin-domain-plugin&quot; and grails is unable to resolve them in module &quot;A&quot;.

Is there any way to force grails to distribute some of sub-plugin&#039;s classes along with plugin (to inherit them)? I don&#039;t want to install &quot;admin-domain-plugin&quot; into module &quot;A&quot;

Thanks in advance</description>
		<content:encoded><![CDATA[<p>Hi<br />
I have a grails project, structured this way:<br />
- &#8220;admin-domain-plugin&#8221; (plugin with only domains)<br />
- &#8220;admin-app&#8221; which embedds &#8220;admin-domain-plugin&#8221;</p>
<p>i&#8217;m writing a module &#8220;A&#8221; (with it&#8217;s own domains), and i want it to communicate by jms with &#8220;admin-app&#8221; via DTO objects without knowing about admin domains. </p>
<p>My first idea was to create &#8220;admin-dto-plugin&#8221;, include &#8220;admin-domain-plugin&#8221; in it, generate DTOs and than install &#8220;admin-dto-plugin&#8221; into module.<br />
The problem is with enums : no DTO objects are generated for them so enums are left in &#8220;admin-domain-plugin&#8221; and grails is unable to resolve them in module &#8220;A&#8221;.</p>
<p>Is there any way to force grails to distribute some of sub-plugin&#8217;s classes along with plugin (to inherit them)? I don&#8217;t want to install &#8220;admin-domain-plugin&#8221; into module &#8220;A&#8221;</p>
<p>Thanks in advance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://www.cacoethes.co.uk/blog/groovyandgrails/introduction-to-the-dto-plugin/comment-page-1#comment-1191</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Mon, 28 Feb 2011 18:25:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.cacoethes.co.uk/blog/?p=159#comment-1191</guid>
		<description>&lt;ol&gt;
  &lt;li&gt;To be honest, I don&#039;t know. It depends on what Dozer does (the plugin uses the Dozer library to map the domain classes to DTOs). I think only properties that are common to the domain class and the DTO are copied across.&lt;/li&gt;
  &lt;li&gt;I think you&#039;re much better off using &#039;new DomainClass(dto)&#039; or &#039;bindData(new DomainClass(), dto)&#039;.&lt;/li&gt;
&lt;/ol&gt;

Hope that helps,

Peter</description>
		<content:encoded><![CDATA[<ol>
<li>To be honest, I don&#8217;t know. It depends on what Dozer does (the plugin uses the Dozer library to map the domain classes to DTOs). I think only properties that are common to the domain class and the DTO are copied across.</li>
<li>I think you&#8217;re much better off using &#8216;new DomainClass(dto)&#8217; or &#8216;bindData(new DomainClass(), dto)&#8217;.</li>
</ol>
<p>Hope that helps,</p>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Srinivas</title>
		<link>http://www.cacoethes.co.uk/blog/groovyandgrails/introduction-to-the-dto-plugin/comment-page-1#comment-1190</link>
		<dc:creator>Srinivas</dc:creator>
		<pubDate>Mon, 28 Feb 2011 16:29:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.cacoethes.co.uk/blog/?p=159#comment-1190</guid>
		<description>Peter,

Two questions:

1. Once the DTOs are generated, if we remove few attributes (and getters/setters), and perform toDTO() at runtime, will it give Exception or only map the available fileds in DTO?

2. We are currently doing DTO -&gt; Domain objects using domain class constructor which takes DTO as input, and use this.s1=dto.getS1() methods.. This is writing lot of code in the constructor. Any short-cut here?

Regards,
Srinivas.</description>
		<content:encoded><![CDATA[<p>Peter,</p>
<p>Two questions:</p>
<p>1. Once the DTOs are generated, if we remove few attributes (and getters/setters), and perform toDTO() at runtime, will it give Exception or only map the available fileds in DTO?</p>
<p>2. We are currently doing DTO -&gt; Domain objects using domain class constructor which takes DTO as input, and use this.s1=dto.getS1() methods.. This is writing lot of code in the constructor. Any short-cut here?</p>
<p>Regards,<br />
Srinivas.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dave</title>
		<link>http://www.cacoethes.co.uk/blog/groovyandgrails/introduction-to-the-dto-plugin/comment-page-1#comment-1166</link>
		<dc:creator>dave</dc:creator>
		<pubDate>Fri, 15 Oct 2010 20:55:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.cacoethes.co.uk/blog/?p=159#comment-1166</guid>
		<description>thanks peter.  i found at least one discussion on the grails-gwt group on the topic and started to draft an email to see if i could get any more or new info out of anyone.  (i&#039;ve since gotten kind of distracted.)

i&#039;m now leaning towards RequestBuilder and JSON just so there is a clearer separation between GWT on the client and grails on the server.  using the gwt plugin, dto, and action handlers it seemed to be getting mixed together a bit too much.

whatever i end up doing i need to make sure that not only are the client and server loosely coupled, but also the code calling into that communication on both ends is also abstracted enough so if i decide to switch anything later it minimizes the risk.

regardless, fun stuff.  :)

thanks again.

dave</description>
		<content:encoded><![CDATA[<p>thanks peter.  i found at least one discussion on the grails-gwt group on the topic and started to draft an email to see if i could get any more or new info out of anyone.  (i&#8217;ve since gotten kind of distracted.)</p>
<p>i&#8217;m now leaning towards RequestBuilder and JSON just so there is a clearer separation between GWT on the client and grails on the server.  using the gwt plugin, dto, and action handlers it seemed to be getting mixed together a bit too much.</p>
<p>whatever i end up doing i need to make sure that not only are the client and server loosely coupled, but also the code calling into that communication on both ends is also abstracted enough so if i decide to switch anything later it minimizes the risk.</p>
<p>regardless, fun stuff.  <img src='http://www.cacoethes.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>thanks again.</p>
<p>dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://www.cacoethes.co.uk/blog/groovyandgrails/introduction-to-the-dto-plugin/comment-page-1#comment-1165</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Fri, 15 Oct 2010 11:19:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.cacoethes.co.uk/blog/?p=159#comment-1165</guid>
		<description>@dave I would ask on the grails-gwt Google group/mailing list. One or two people are using RequestBuilder with JSON responses and they say that&#039;s the best way to go. I don&#039;t have any experience with it myself, but it&#039;s a more natural fit on the server side for Grails. I&#039;m sure you can rejig the command pattern to work with JSON responses.

Sorry, I haven&#039;t done active GWT development for over half a year now and I wasn&#039;t an aficionado in the first place :)</description>
		<content:encoded><![CDATA[<p>@dave I would ask on the grails-gwt Google group/mailing list. One or two people are using RequestBuilder with JSON responses and they say that&#8217;s the best way to go. I don&#8217;t have any experience with it myself, but it&#8217;s a more natural fit on the server side for Grails. I&#8217;m sure you can rejig the command pattern to work with JSON responses.</p>
<p>Sorry, I haven&#8217;t done active GWT development for over half a year now and I wasn&#8217;t an aficionado in the first place <img src='http://www.cacoethes.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dave</title>
		<link>http://www.cacoethes.co.uk/blog/groovyandgrails/introduction-to-the-dto-plugin/comment-page-1#comment-1161</link>
		<dc:creator>dave</dc:creator>
		<pubDate>Tue, 12 Oct 2010 16:48:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.cacoethes.co.uk/blog/?p=159#comment-1161</guid>
		<description>peter, i&#039;m reasonably new to grails but have been working with GWT for a couple years.  i&#039;ve been using both your GWT and DTO plugins in getting going with grails, so first off, thanks for that.  :)

probably because of my previous experience with GWT i&#039;m used to a command pattern approach via GWT-RPC.  been looking at your command pattern blog and now this one.

what i wanted to ask is, what&#039;s your preferred architecture for GWT communication with the server?  i found the comment in one of your responses above:

&gt; No worries. I pretty much agree with you 
&gt; on using a server-side domain model from 
&gt; a client. I prefer the decoupling enabled 
&gt; by DTOs and XML/JSON.

right now i&#039;ve got it working by using the command pattern approach with action handlers, with the action and response command objects wrapping DTO classes.  but i&#039;m just wondering if that&#039;s the best way to go long term, and if a cleaner approach would be to use RequestBuilder (which i don&#039;t have experience with) to call REST apis and render the responses from grails as JSON.  i don&#039;t know if i&#039;m that excited about getting into javascript overlay types and all that in GWT, but it may just be best to bite that bullet and do it.

so, just wondered if you could elaborate a bit on your comment about decoupling enabled by DTOs and XML/JSON and how you actually go about doing that.

thanks!

dave</description>
		<content:encoded><![CDATA[<p>peter, i&#8217;m reasonably new to grails but have been working with GWT for a couple years.  i&#8217;ve been using both your GWT and DTO plugins in getting going with grails, so first off, thanks for that.  <img src='http://www.cacoethes.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>probably because of my previous experience with GWT i&#8217;m used to a command pattern approach via GWT-RPC.  been looking at your command pattern blog and now this one.</p>
<p>what i wanted to ask is, what&#8217;s your preferred architecture for GWT communication with the server?  i found the comment in one of your responses above:</p>
<p>&gt; No worries. I pretty much agree with you<br />
&gt; on using a server-side domain model from<br />
&gt; a client. I prefer the decoupling enabled<br />
&gt; by DTOs and XML/JSON.</p>
<p>right now i&#8217;ve got it working by using the command pattern approach with action handlers, with the action and response command objects wrapping DTO classes.  but i&#8217;m just wondering if that&#8217;s the best way to go long term, and if a cleaner approach would be to use RequestBuilder (which i don&#8217;t have experience with) to call REST apis and render the responses from grails as JSON.  i don&#8217;t know if i&#8217;m that excited about getting into javascript overlay types and all that in GWT, but it may just be best to bite that bullet and do it.</p>
<p>so, just wondered if you could elaborate a bit on your comment about decoupling enabled by DTOs and XML/JSON and how you actually go about doing that.</p>
<p>thanks!</p>
<p>dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ados</title>
		<link>http://www.cacoethes.co.uk/blog/groovyandgrails/introduction-to-the-dto-plugin/comment-page-1#comment-1011</link>
		<dc:creator>ados</dc:creator>
		<pubDate>Tue, 20 Apr 2010 20:50:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.cacoethes.co.uk/blog/?p=159#comment-1011</guid>
		<description>hi,

i have a grails web app and a grails plugin which houses all the domain classes and services that sit on top of these. I have changed the services to return DTOs using the plugin. However , i seem to have to install the dto on the client side (the web app) too, surely i should have to do this ?

Anyway I installed it on both sides, now I am getting a stackoverflow error when i try to do a tostring on my userDTO as it has roleDTos attached to it which in turn has the same userDto attached to itself - so it goes round and round and bombs out. Is there a solution to this without having to exclude some dtos ?</description>
		<content:encoded><![CDATA[<p>hi,</p>
<p>i have a grails web app and a grails plugin which houses all the domain classes and services that sit on top of these. I have changed the services to return DTOs using the plugin. However , i seem to have to install the dto on the client side (the web app) too, surely i should have to do this ?</p>
<p>Anyway I installed it on both sides, now I am getting a stackoverflow error when i try to do a tostring on my userDTO as it has roleDTos attached to it which in turn has the same userDto attached to itself &#8211; so it goes round and round and bombs out. Is there a solution to this without having to exclude some dtos ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alberto</title>
		<link>http://www.cacoethes.co.uk/blog/groovyandgrails/introduction-to-the-dto-plugin/comment-page-1#comment-872</link>
		<dc:creator>Alberto</dc:creator>
		<pubDate>Tue, 02 Feb 2010 23:03:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.cacoethes.co.uk/blog/?p=159#comment-872</guid>
		<description>Ok, thanks to Peter that solved my problem, I was using Springsource Tool Suite, I just had to make a Grails Tools -&gt; Refresh Dependencies.
I&#039;ll write a tutorial on this with all the tips. Thanks again.

Ciao</description>
		<content:encoded><![CDATA[<p>Ok, thanks to Peter that solved my problem, I was using Springsource Tool Suite, I just had to make a Grails Tools -&gt; Refresh Dependencies.<br />
I&#8217;ll write a tutorial on this with all the tips. Thanks again.</p>
<p>Ciao</p>
]]></content:encoded>
	</item>
</channel>
</rss>

