<div dir="ltr">And of course, Thomas, if you want to join in you are most welcome to!! You always do really crazy awesome things.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 7, 2013 at 5:09 AM, Vineet Reynolds Pereira <span dir="ltr">&lt;<a href="mailto:vpereira@redhat.com" target="_blank">vpereira@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">Hi Thomas,<br>
   Thanks for raising all of this in a single mail. I&#39;ve more or less faced the same problems. My response is inline.<br>
<br>
Best regards,<br>
Vineet<br>
<div class="im"><br>
----- Original Message -----<br>
&gt; From: &quot;Thomas Frühbeck&quot; &lt;<a href="mailto:fruehbeck@aon.at">fruehbeck@aon.at</a>&gt;<br>
&gt; To: &quot;forge-dev List&quot; &lt;<a href="mailto:forge-dev@lists.jboss.org">forge-dev@lists.jboss.org</a>&gt;<br>
&gt; Sent: Wednesday, March 6, 2013 9:38:07 PM<br>
&gt; Subject: Re: [forge-dev] Forge Scaffold x-Project { Aerogear, Arquillian, Errai, Java EE, RichFaces, Spring } -<br>
&gt; inputs and meetings<br>
&gt;<br>
&gt; Can you please point out the locations of the respective scaffold<br>
&gt; plugins you refer to, and give some introduction to the direction of<br>
&gt; planned development.<br>
<br>
</div>We have two scaffold plugins now whose learnings are being used to create this new plugin:<br>
<br>
1) <a href="https://github.com/forge/scaffold-html5" target="_blank">https://github.com/forge/scaffold-html5</a><br>
This is the AngularJS plugin I&#39;ve been working on<br>
2) <a href="https://github.com/sebastienblanc/scaffold-html5/tree/scaffold-aerogear" target="_blank">https://github.com/sebastienblanc/scaffold-html5/tree/scaffold-aerogear</a><br>
This is a prototype Aerogear+AmgularJS plugin (not to be confused with <a href="https://github.com/forge/scaffold-aerogear/" target="_blank">https://github.com/forge/scaffold-aerogear/</a>).<br>
Sebastian worked on this, and it is based on an older version of the AngularJS plugin.<br>
The differences between the two, are mostly in -<br>
    a) the templates used to create the scaffold,<br>
    b) the static AG libraries and Angular services that are to be created in the generated scaffold.<br>
<br>
If you notice carefully, we&#39;ve decoupled the inspection of entities (using Metawidget inspectors) and the generation of the scaffold (using Freemarker templates) based on the inspection results.<br>
This has been basis for the design of the new scaffold plugin. We&#39;ve put down some notes and event diagram for now:<br>
a. Notes: <a href="https://docs.google.com/document/d/16gi5xQbh1Yk9K0sHUTpWZUhxcDedYFBqzBtUagrN-ZI/edit?usp=sharing" target="_blank">https://docs.google.com/document/d/16gi5xQbh1Yk9K0sHUTpWZUhxcDedYFBqzBtUagrN-ZI/edit?usp=sharing</a><br>

b. Event diagram: <a href="https://docs.google.com/drawings/d/1sCgEUHtqiItIsLH40SEW0KOZefuq9bzLzE6FggaMbaA/edit?usp=sharing" target="_blank">https://docs.google.com/drawings/d/1sCgEUHtqiItIsLH40SEW0KOZefuq9bzLzE6FggaMbaA/edit?usp=sharing</a><br>

<br>
I dont have your GMail address at hand, so if you can provide it, Sebastian can give you access.<br>
<br>
These are very early days, so nothing is set in stone, and this is bound to change as we cater to more usecases.<br>
<div class="im"><br>
&gt; I read from the meeting transcript:<br>
&gt;      - extendable templates to prevent scaffold duplication<br>
&gt;      - conventions must be established<br>
&gt;      - scaffold generate tests<br>
&gt;<br>
&gt; Knowing Faces, Aerogear plugins and my proposed Errai plugin quite<br>
&gt; well<br>
&gt; I find it somewhat amusing to see them all be based on frameworks and<br>
&gt; provide some extendability, yet each in a very distinct and not very<br>
&gt; congruent way - perhaps my bad?<br>
&gt; During building my Errai plugin I found it e.g. difficult to<br>
&gt; implement<br>
&gt; thorough type safety and entity relationships when the calls of the<br>
&gt; scaffold are either per single file/entity (&quot;generateFromEntity&quot;) or<br>
&gt; for<br>
&gt; all files/entities (&quot;generateIndex&quot;), both not so well suited for<br>
&gt; handling of _relationships_.<br>
<br>
</div>I concur with you on this. I&#39;m facing a similar problem involving relationships across classes, but perhaps on a much smaller scale.<br>
I need to access the classes on the other side of the relationship, to choose one among a set of properties, to be used for display in the views.<br>
For example, if I have a model having a Customer -&gt; StoreOrder relation of type 1:M, then I need to know what property of StoreOrder should I display in the Customer views.<br>
If you&#39;re interested, you can see the relevant code in lines 66-83 in the IntrospectorClient class, of the AngularJS plugin:<br>
<a href="https://github.com/forge/scaffold-html5/blob/master/src/main/java/org/jboss/forge/scaffold/html5/IntrospectorClient.java#L66" target="_blank">https://github.com/forge/scaffold-html5/blob/master/src/main/java/org/jboss/forge/scaffold/html5/IntrospectorClient.java#L66</a><br>

<br>
Right now, this need hasn&#39;t been considered in the new plugin, since this looked more like an edge case that didn&#39;t need &quot;standardization&quot; across scaffold providers.<br>
But we can move towards incorporating this into the design, since there are atleast two plugins now that would need something similar.<br>
Personally, I need access to the Metawidget inspection results (or something similar) of the related entity, but I don&#39;t want to incorporate this as is into the design.<br>
That&#39;s mostly because we&#39;d like to see your usecases as well, and how they could be incorporated into the event model.<br>
<div><div class="h5"><br>
&gt;<br>
&gt; Furthermore the development models are interestingly far apart:<br>
&gt;      - Faces: unsafe JSP + converters/handlers/_named_ beans + server<br>
&gt;      side<br>
&gt;      - Errai: compile time type safety, intensive integrity<br>
&gt;      validation,<br>
&gt; client side optimizations<br>
&gt;<br>
&gt; e.g.<br>
&gt;      - the Errai compilation would fail, if a &quot;Form&quot;Composite<br>
&gt;      declared a<br>
&gt; widget that is not found in its HTML template, thus enforcing the<br>
&gt; HTML<br>
&gt; template be generated _together_ with its &quot;Form&quot;Composite<br>
&gt;      - by _re_building only _one_ entity (generateFromEntity) in<br>
&gt;      Errai<br>
&gt; the generated code would possibly fail miserably w/o rebuilding also<br>
&gt; its<br>
&gt; related entities<br>
&gt;<br>
&gt; Honestly I found myself frequently in the miserable position to<br>
&gt; rebuild<br>
&gt; the complete entity model because of interdependencies. Anyway, while<br>
&gt; writing these lines I find interesting possibilities to decouple code<br>
&gt; for more flexibility :-)<br>
&gt;<br>
&gt; I am very interesting in evolving my plugin, so I hope you can give<br>
&gt; some<br>
&gt; idea about the planned templating etc.<br>
<br>
</div></div>Well, we&#39;re using Freemarker in both the plugins. But, we&#39;re leaving the choice of the template engine to the scaffold provider for now, so you could use the Forge parser API if you want to generate new Java classes without relying entirely on text-based templates, or for that matter rely on Seam-Render that you seem to be using, or even use multiple template engines if some of them are better suited than others for emitting certain types of artifacts. There are however some considerations to make though, since the inspection result may not be available in a form that the template engine expects, so an adapter may be necessary. For Freemarker, the inspection result (the input data model for templating) is provided as a Map to the template engine.<br>

<br>
I may not have understood the bit about &quot;rebuilding the complete entity model&quot;, and my assumption here is that the generated scaffold needs to be rebuilt from scratch when changes are made to the JPA entities. This is something that we may not fix right away in the scaffold plugin design, but yes, it would be something to consider. Perhaps it would make sense to have an in-memory model of what needs rebuilding, and what parts of the generated scaffold are &quot;dirty&quot; and need to be regenerated.<br>

<br>
My answer here may be incomplete, since I&#39;ve just briefly looked inside your plugin-errai project, so we could discuss this in depth.<br>
<div class="im"><br>
&gt; If there are not yet clear directions I am ready to scetch out the<br>
&gt; main<br>
&gt; issues I encountered for open discussions.<br>
<br>
</div>That would be great. We&#39;re also preparing a POC (as a Forge plugin) for the new scaffold plugin design and once we have it ready for discussion, we shall be sending out another mail. We could consider these issues of yours during the construction of the POC.<br>

<div class="HOEnZb"><div class="h5"><br>
&gt;<br>
&gt; Thomas<br>
&gt;<br>
&gt;<br>
&gt; Am 06.03.2013 14:38, schrieb Vineet Reynolds Pereira:<br>
&gt; &gt; Hello all,<br>
&gt; &gt;      This is more of a follow up on Lincoln&#39;s mail sent earlier on<br>
&gt; &gt;      the cross-project scaffold team.<br>
&gt; &gt;<br>
&gt; &gt;      Sebastian and I have been working on fleshing out the details<br>
&gt; &gt;      of the new scaffold plugin to handle several requirements, as<br>
&gt; &gt;      part of the single collaborative scaffold initiative. We&#39;re<br>
&gt; &gt;      going to attempt making this work on Forge 1, and port the<br>
&gt; &gt;      design over to Forge 2. While our work so far has covered<br>
&gt; &gt;      fairly decent ground, it is mostly due to the commonalities<br>
&gt; &gt;      in the scaffolds we work on - AngularJS and Aerogear.<br>
&gt; &gt;      JSF/RichFaces, Errai are notable exceptions, and I&#39;d like to<br>
&gt; &gt;      propose a weekly/bi-weekly cross-scaffold team meeting to<br>
&gt; &gt;      pour over the details of this new scaffold plugin, so that<br>
&gt; &gt;      design decisions will attempt to accomodate all projects<br>
&gt; &gt;      (instead of only HTML5 ones). 30 mins should be fine to start<br>
&gt; &gt;      with, stretching to a maximum of an hour (if there are too<br>
&gt; &gt;      many topics to discuss).<br>
&gt; &gt;<br>
&gt; &gt;     I&#39;d like to know what time would be suitable for this<br>
&gt; &gt;     discussion. If we cannot find a suitable time for everyone to<br>
&gt; &gt;     join in, or if you schedules are busy, we could have impromptu<br>
&gt; &gt;     meetings.<br>
&gt; &gt;<br>
&gt; &gt; Thanks,<br>
&gt; &gt; Vineet<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; forge-dev mailing list<br>
&gt; &gt; <a href="mailto:forge-dev@lists.jboss.org">forge-dev@lists.jboss.org</a><br>
&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br>
&gt; &gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; forge-dev mailing list<br>
&gt; <a href="mailto:forge-dev@lists.jboss.org">forge-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/forge-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-dev</a><br>
&gt;<br>
<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></div></div></blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.org" target="_blank">http://ocpsoft.org</a><br>
&quot;Simpler is better.&quot;
</div>