<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 class="" 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 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 : </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">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 class="" 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 class="" 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 class="" style="background-color:yellow">Devoxx</span> France</a>
</div></div></div></div>