<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Hi Antonio!</div><div><br></div><div>Thanks for your feedback! We'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'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">antonio.mailing@gmail.com</a>&gt; escreveu:<br><br></div><blockquote type="cite"><div><div dir="ltr">Hi all,<div><br></div><div>I love Forge because it generates code. And that's why my customers start to love it too. Basically, they look at Forge as the "way to write Java <span class="" style="background-color:yellow">EE</span> code" or if you like "if those guys write code like this, then we should".</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 class="" 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 :&nbsp;</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&nbsp;<br></li><li>REST Endpoint use <b>dynamic queries</b>&nbsp;(the list all method is&nbsp;"SELECT DISTINCT b FROM Book b ORDER BY <a href="http://b.id">b.id</a>"))&nbsp;<br>
</li></ul></div><div>Method names are different and do the same :&nbsp;</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>&nbsp; &nbsp;private EntityManager em;<br>
</li><li>&nbsp; &nbsp;private EntityManager entityManager; &nbsp;// 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&nbsp;this.entityManager instead of&nbsp;directly em in REST)</div>
<div><br></div><div>And there are several examples like this. If Forge is seen as "the way of writing code" maybe something should be created to get homogenized code. PMD, Checkstyle, human review and so one.....&nbsp;</div>
<div><br></div><div>Just wondering....</div><div><div><br></div><div><div class="gmail_extra"><div><br></div>-- <br>Antonio <span class="" style="background-color:yellow">Goncalves</span>&nbsp;<br>Software architect and Java Champion<br>
<br><a href="http://www.antoniogoncalves.org/" target="_blank">Web site</a>&nbsp;|&nbsp;<a href="http://twitter.com/agoncal" target="_blank">Twitter</a>&nbsp;|&nbsp;<a href="http://www.linkedin.com/in/agoncal" target="_blank"><span class="" style="background-color:yellow">LinkedIn</span></a>&nbsp;|&nbsp;<a href="http://www.parisjug.org/" target="_blank">Paris JUG</a>&nbsp;|&nbsp;<a href="http://www.devoxx.fr/" target="_blank"><span class="" style="background-color:yellow">Devoxx</span> France</a>
</div></div></div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>forge-dev mailing list</span><br><span><a href="mailto:forge-dev@lists.jboss.org">forge-dev@lists.jboss.org</a></span><br><span><a href="https://lists.jboss.org/mailman/listinfo/forge-dev">https://lists.jboss.org/mailman/listinfo/forge-dev</a></span></div></blockquote></body></html>