<br><br><div class="gmail_quote">On Tue, Feb 26, 2013 at 10:40 AM, Richard Kennard <span dir="ltr"><<a href="mailto:richard@kennardconsulting.com" target="_blank">richard@kennardconsulting.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Seb,<br>
<br>
It sounds like there may be some convergence here. Your 'macros' library may end up looking very similar to Metawidget's existing HTML5 WidgetBuilder. And<br>
your 'composition plugins' may end up similar to Metawidget's LayoutDecorators and Layouts.<br>
<br>
I'd like to make sure you're not re-inventing the wheel here? Is your main driver that you prefer writing templates in Freemarker to Java code?<br></blockquote><div><br></div><div>Absolutely :) ! A user should be able to read and understand a template / overload them and not forced to write a Java class, a mid-term vision is to be more and more polyglot.</div>
<div>Seb</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Regards.<br>
<br>
Richard.<br>
<div class="im"><br>
On 26/02/2013 8:31 PM, Sebastien Blanc wrote:<br>
> Hi Richard,<br>
> Thanks for your remarks and questions, see my comments inline.<br>
><br>
</div><div><div class="h5">> On Tue, Feb 26, 2013 at 10:06 AM, Richard Kennard <<a href="mailto:richard@kennardconsulting.com">richard@kennardconsulting.com</a> <mailto:<a href="mailto:richard@kennardconsulting.com">richard@kennardconsulting.com</a>>> wrote:<br>
><br>
> Hi Vineet,<br>
><br>
> Thanks for your detailed response.<br>
><br>
> I'm not opposed to the idea of a FreemarkerWidget (or VelocityWidget, or StringTemplateWidget). Indeed, the early versions of Metawidget looked much like<br>
> you describe: a separate, pluggable inspection layer, then a Metawidget to render it.<br>
><br>
> However, we subsequently got a lot of feedback and did many interviews, adoption studies and case studies. This ultimately led to the architecture of<br>
> pluggable WidgetBuilders, WidgetProcessors and Layouts. Let me give you 3 examples of the feedback we got:<br>
><br>
> 1. Widget choice needs to be orthogonal to layout. If you look at your 'master.html.ftl' and 'detail.html.ftl' you have a lot of duplicated code between<br>
> them. Both templates contain <#if... #else to choose between a 'select' box and a 'text' box. This code is going to inflate rapidly once you add your<br>
> date<br>
> pickers, telephone numbers, URLs etc. to the mix. Worse, such code will need to be duplicated across both templates.<br>
><br>
><br>
> Vineet is currently factorizing all the duplicated code into Freemarker's Macros, this Macros library will be shared along the different plugins.<br>
><br>
><br>
> 2. Equally, layout needs to be orthogonal to the wider page. Say I decide I want to use tables with rows and columns, instead of a div-based layout.<br>
> Or say<br>
> I want to use different CSS classes to your 'control-group' and 'controls'. I will have to do it in both templates. But what is *actually* different<br>
> about<br>
> the templates is the choice of search buttons/results versus save/cancel buttons. So the 'middle bit' of each page needs to be orthogonal. This will get<br>
> worse as you add more templates, such as separate 'search', 'view' and 'edit' templates (see the JSF scaffold).<br>
><br>
> With Forge 2.0 in mind, where Plugins/addons will be able to be dependent from each other, inherit from each other, we plan to end up with some basic<br>
> plugins which will offer a lot of flexibility to deliver "Composition plugins". We are also going to introduce a lot of convention over configuration but<br>
> with keeping in mind that the user can always override the conventions.<br>
><br>
><br>
> 3. Developers like to use third-party widget libraries, and also in-house custom widget libraries. If I want to add RichFaces, or PrimeFaces, or a<br>
> mixture<br>
> of both, I want to be able to do so in a way that is orthogonal to all of the above<br>
><br>
> So my concern would be that a FreemarkerWidget would tightly couple widget choice (WidgetBuilders) and layout, and not allow widget processing (which is<br>
> important for other reasons I haven't touched upon). Freemarker does, I agree, offer an attractive level of immedicay and ease-of-editing templates.<br>
> But I<br>
> wonder what your thoughts are on how it scales for some of the points above?<br>
><br>
><br>
> "Scaling" will be partly solved by the new architecture explained above. For sure, there will always be situations where the user wants to introduce his<br>
> supra cool custom widget that don't fits without a lot of hacking but IMO that's beyond the scope of scaffolding. Scaffolding is just to "boost up" a new<br>
> project, it's a one time action, for sure, we can offer entry points for customization but we can't (or don't want to) cover all the specific situations.<br>
><br>
> Regards,<br>
> Seb<br>
><br>
><br>
> Regards,<br>
><br>
> Richard.<br>
><br>
</div></div>> > On 22 February 2013 13:56, Vineet Reynolds Pereira <<a href="mailto:vpereira@redhat.com">vpereira@redhat.com</a> <mailto:<a href="mailto:vpereira@redhat.com">vpereira@redhat.com</a>> <mailto:<a href="mailto:vpereira@redhat.com">vpereira@redhat.com</a><br>
<div><div class="h5">> <mailto:<a href="mailto:vpereira@redhat.com">vpereira@redhat.com</a>>>> wrote:<br>
> ><br>
> > Hi Richard,<br>
> ><br>
> > I'm glad you brought this up, since we've been looking to provide feedback once we've finalized on our usage of the Metawidget APIs. By the way,<br>
> > I'm the one responsible for the use (or abuse) of Metawidget in this manner.<br>
> ><br>
> > The rationale behind the use of Metawidget inspectors alone, is mostly because we want to allow users to modify the generated scaffold. One<br>
> of the<br>
> > examples thrown around was to enable users to generate master-detail views instead of the plain CRUD forms generated by Forge. Another driving<br>
> factor<br>
> > was the need to create or enable creation of scaffold generators for several JS frameworks including but not restricted to AngularJS, Backbone.js,<br>
> > Aerogear etc. Furthermore, there is also a possibility of users needing to bring in plugins and extensions to these frameworks, like Angular-UI or<br>
> > Backbone.Forms, since the base frameworks may not satisfy all needs. From my understanding of the Metawidget pipeline and it's use in the Forge<br>
> Faces<br>
> > and (the earlier) Aerogear scaffold plugins, this would have been possible if a metawidget were created for every use case (one per framework, per<br>
> > widget-type). We attempted to bring in the use of templates written in a familiar templating langu!<br>
> > age (like Freemarker/Velocity/StringTemplate) into the scaffold generation phase to make it easier for users to modify the generated scaffold.<br>
> This<br>
> > is somewhat on the lines of what the Yeoman generators do.<br>
> ><br>
> > Thanks to the APIs you've made available for the Metawidget pipeline, the inspection results could be processed before feeding them to the<br>
> > templates. Every scaffold plugin that could potentially be written, would more or less use this approach, with the sole difference being in the<br>
> > contents of the templates themselves. I hope this explains why I used the Inspectors alone, and not the InspectionResultProcessors and the rest of<br>
> > the pipeline. The inspectors just fit in naturally into the Forge scaffold generation pipeline.<br>
> ><br>
> > Based on the above, I personally think that a FreemarkerWidget (or VelocityWidget, or StringTemplateWidget) would be something to investigate.<br>
> > This is of course a raw idea of mine, and I would like to see if it is possible to use such a metawidget in a type-safe manner with the ability to<br>
> > configure the templates that it would consume. I'm not sure if creating such a widget would deviate from the intention behind the Metawidget<br>
> project.<br>
> ><br>
> > As a side note, I'd also like to point out that there has been interest in supporting various additional HTML5 form input types (telephone<br>
> > numbers, URLs etc.) in the generated scaffold, and this would require extending the JPA/Bean Validation Inspectors in Metawidget.<br>
> ><br>
> > Best regards,<br>
> > Vineet<br>
> ><br>
> > PS: CC'ing the forge-dev list.<br>
> ><br>
> > ----- Original Message -----<br>
</div></div><div class="im">> > > From: "Richard Kennard" <<a href="mailto:richard@kennardconsulting.com">richard@kennardconsulting.com</a> <mailto:<a href="mailto:richard@kennardconsulting.com">richard@kennardconsulting.com</a>> <mailto:<a href="mailto:richard@kennardconsulting.com">richard@kennardconsulting.com</a><br>
> <mailto:<a href="mailto:richard@kennardconsulting.com">richard@kennardconsulting.com</a>>>><br>
</div><div><div class="h5">> > > To: <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>>><br>
> > > Sent: Thursday, February 21, 2013 5:17:29 AM<br>
> > > Subject: Re: [aerogear-dev] Aerogear Forge Plugin<br>
> > ><br>
> > > Seb,<br>
> > ><br>
> > > This looks very cool. I see you have used parts of Metawidget for<br>
> > > some of the implementation? I'd love to hear your thoughts on how it<br>
> > > went and/or any<br>
> > > changes you'd like me to make to Metawidget. For example:<br>
> > ><br>
> > > 1. You have some code in Html5Scaffold that processes the inspection<br>
> > > result returned by CompositeInspector. It does things like<br>
> > > 'Canonicalize all numerical<br>
> > > types in Java to "number" for HTML5 form input type support' and<br>
> > > 'Extract simple type name of the relationship types'. Was there a<br>
> > > reason you didn't factor<br>
> > > this into a Metawidget InspectionResultProcessor<br>
> > > (<a href="http://metawidget.org/doc/reference/en/html/ch02s03.html" target="_blank">http://metawidget.org/doc/reference/en/html/ch02s03.html</a>)?<br>
> > > Specifically BaseInspectionResultProcessor has<br>
> > > some methods to help?<br>
> > ><br>
> > > 2. You appear to be using FreeMarker templates rather than<br>
> > > Metawidget's WidgetBuilders, WidgetProcessors and Layouts (see the<br>
> > > existing Forge JSF scaffold,<br>
> > > Forge GWT scaffold, and Forge Spring scaffold). Could I ask what the<br>
> > > reasons were behind this?<br>
> > ><br>
> > > 3. I have recently implemented a pure client-side, pure run-time,<br>
> > > AngularJS version of Metawidget. If you were interested in a<br>
> > > non-static version of your<br>
> > > scaffold, perhaps you could give it a try?<br>
> > > <a href="http://blog.kennardconsulting.com/2013/01/metawidget-meets-jquery-ui-and-angularjs.html" target="_blank">http://blog.kennardconsulting.com/2013/01/metawidget-meets-jquery-ui-and-angularjs.html</a><br>
> > ><br>
> > > Regards,<br>
> > ><br>
> > > Richard.<br>
> > ><br>
> > > On 20/02/2013 11:49 PM, Jay Balunas wrote:<br>
> > > > Wow!!! Really awesome work guys!!!<br>
> > > ><br>
> > > > On Feb 15, 2013, at 11:15 AM, Sebastien Blanc wrote:<br>
> > > ><br>
> > > >> Hi all !<br>
> > > >> I'm pleased to announce that the first version of the Aerogear<br>
> > > >> Scaffold Plugin for forge is available !<br>
> > > >> It's still an alpha but thanks to the excellent work and help from<br>
> > > >> Vineet we have a working plugin :<br>
> > > >><br>
> > > >> - CRUD Scaffolding based on your entities.<br>
> > > >> - One-to-one , many-to-one relation supported.<br>
> > > >> - AngularJS and bootstrap responsive based.<br>
> > > >> - Aerogear Pipe and Store used.<br>
> > > >><br>
> > > >> There is still a lot to do but you can already play with it, a<br>
> > > >> quickstart is available here and you should be able to create<br>
> > > >> your first Aerogear App in<br>
> > > >> 5 minutes ;) <a href="https://gist.github.com/sebastienblanc/4961324" target="_blank">https://gist.github.com/sebastienblanc/4961324</a><br>
> > > >><br>
> > > >> An example of a generated application can also be found here :<br>
> > > >> <a href="https://github.com/sebastienblanc/scaffoldtester" target="_blank">https://github.com/sebastienblanc/scaffoldtester</a> , please review<br>
> > > >> the generated code (at<br>
> > > >> least the JS and HTML) and report it to me and I will update the<br>
> > > >> templates accordingly.<br>
> > > >><br>
> > > >> Next steps are :<br>
> > > >> - Integrate Search feature (using the DataStore filter facilities)<br>
> > > >> - Integrate Aerogear Pagination (although generic pagination is<br>
> > > >> present now)<br>
> > > >> - Integrate jQueryMobile (will probably be another plugin)<br>
> > > >><br>
> > > >> Enjoy !<br>
> > > >><br>
> > > >> Seb<br>
> > > >><br>
> > > >> _______________________________________________<br>
> > > >> aerogear-dev mailing list<br>
> > > >> <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
</div></div>> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>>> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>><br>
<div class="HOEnZb"><div class="h5">> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>>>><br>
> > > >> <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > > _______________________________________________<br>
> > > > aerogear-dev mailing list<br>
> > > > <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>>><br>
> > > > <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
> > ><br>
> > > _______________________________________________<br>
> > > aerogear-dev mailing list<br>
> > > <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>>><br>
> > > <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
> > ><br>
> ><br>
> > _______________________________________________<br>
> > aerogear-dev mailing list<br>
> > <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>>><br>
> > <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
> ><br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > aerogear-dev mailing list<br>
> > <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>><br>
> > <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
><br>
> _______________________________________________<br>
> aerogear-dev mailing list<br>
> <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a> <mailto:<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>><br>
> <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> aerogear-dev mailing list<br>
> <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
</div></div><div class="HOEnZb"><div class="h5">> <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
<br>
_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
</div></div></blockquote></div><br>