<div dir="ltr">Hey Antonio!<div><br></div><div>You are absolutely correct. We really need to standardize (and improve in general) most of the code that Forge generates. Really it works, but I think that we can do much better to set a good example.</div>
<div><br></div><div>These are good issues to track :)</div><div><br></div><div>~Lincoln</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Oct 20, 2013 at 10:29 PM, George Gastaldi <span dir="ltr">&lt;<a href="mailto:ggastald@redhat.com" target="_blank">ggastald@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>Hi Antonio!</div><div><br></div><div>Thanks for your feedback! We&#39;ll consider your suggestions for the Forge 2 REST code generation and the scaffold. In the meanwhile could you file a JIRA feature request so we don&#39;t lose track of this?</div>
<div><br></div><div>Thank you very much!</div><div><br></div><div>George Gastaldi</div><div><br>Em 20/10/2013, às 14:51, Antonio Goncalves &lt;<a href="mailto:antonio.mailing@gmail.com" target="_blank">antonio.mailing@gmail.com</a>&gt; escreveu:<br>
<br></div><div><div class="h5"><blockquote type="cite"><div><div dir="ltr">Hi all,<div><br></div><div>I love Forge because it generates code. And that&#39;s why my customers start to love it too. Basically, they look at Forge as the &quot;way to write Java <span style="background-color:yellow">EE</span> code&quot; or if you like &quot;if those guys write code like this, then we should&quot;.</div>

<div><br></div><div>I am digging into some details of the generated code (I am writing a blog about several architectural styles starting with Forge) and I feel coding convention should be <span style="background-color:yellow">homogenized</span>. I know extensions are written by different individuals, but some basic coding conventions should be applied. For example, when you generate a web app with REST and Faces scaffolding, you get some difference : </div>

<div><ul><li>Faces Backing Bean use <b>query builder</b> (e.g getAll method is entityManager.createQuery(criteria.select(criteria.from(Book.class))).getResultList(); and <br></li><li>REST Endpoint use <b>dynamic queries</b> (the list all method is &quot;SELECT DISTINCT b FROM Book b ORDER BY <a href="http://b.id" target="_blank">b.id</a>&quot;)) <br>

</li></ul></div><div>Method names are different and do the same : </div><div><ul><li>JSF : getAll<br></li><li>REST : listAll<br></li></ul></div><div><br></div><div>Attributes</div><div><div><ul><li>   private EntityManager em;<br>

</li><li>   private EntityManager entityManager;  // em would be better<br></li></ul></div></div><div>Or the use of <font face="courier new, monospace">this</font> keyword (JSF beans use this.entityManager instead of directly em in REST)</div>

<div><br></div><div>And there are several examples like this. If Forge is seen as &quot;the way of writing code&quot; maybe something should be created to get homogenized code. PMD, Checkstyle, human review and so one..... </div>

<div><br></div><div>Just wondering....</div><div><div><br></div><div><div class="gmail_extra"><div><br></div>-- <br>Antonio <span style="background-color:yellow">Goncalves</span> <br>Software architect and Java Champion<br>

<br><a href="http://www.antoniogoncalves.org/" target="_blank">Web site</a> | <a href="http://twitter.com/agoncal" target="_blank">Twitter</a> | <a href="http://www.linkedin.com/in/agoncal" target="_blank"><span style="background-color:yellow">LinkedIn</span></a> | <a href="http://www.parisjug.org/" target="_blank">Paris JUG</a> | <a href="http://www.devoxx.fr/" target="_blank"><span style="background-color:yellow">Devoxx</span> France</a>
</div></div></div></div>
</div></blockquote></div></div><blockquote type="cite"><div><span>_______________________________________________</span><br><span>forge-dev mailing list</span><br><span><a href="mailto:forge-dev@lists.jboss.org" target="_blank">forge-dev@lists.jboss.org</a></span><br>
<span><a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a></span></div></blockquote></div><br>_______________________________________________<br>

forge-dev mailing list<br>
<a href="mailto:forge-dev@lists.jboss.org">forge-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>
&quot;Simpler is better.&quot;
</div>