<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Improving the forms even more</title>
	<atom:link href="http://blog.vworld.at/2009/04/14/improving-the-forms-even-more/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.vworld.at/2009/04/14/improving-the-forms-even-more/</link>
	<description>Software development and software quality</description>
	<lastBuildDate>Thu, 17 Jun 2010 20:00:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: David</title>
		<link>http://blog.vworld.at/2009/04/14/improving-the-forms-even-more/comment-page-1/#comment-2132</link>
		<dc:creator>David</dc:creator>
		<pubDate>Mon, 04 May 2009 10:12:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vworld.at/?p=149#comment-2132</guid>
		<description>All these articles at &lt;a href=&quot;http://webmozarts.com/&quot; rel=&quot;nofollow&quot;&gt;webmozarts.com&lt;/a&gt; and here have started as suggestions, but at the moment Bernhard is working on some proof-of-concept code that implements the desired changes and enhancements (in combination with the community feedback). Up to now all the examples he gives in his blog posts are working (so the screen shots are real).

Last Wednesday we met and he told me that his current codebase is a single file holding all the classes without much documentation or error handling, but he is continuously working on it and once it&#039;s becoming mature enough he will publish his work. He is also still waiting for a more detailed response from Fabien Potencier since we want the new forms system to become a part of the framework and thus Fabien&#039;s opinion is important.</description>
		<content:encoded><![CDATA[<p>All these articles at <a href="http://webmozarts.com/" rel="nofollow">webmozarts.com</a> and here have started as suggestions, but at the moment Bernhard is working on some proof-of-concept code that implements the desired changes and enhancements (in combination with the community feedback). Up to now all the examples he gives in his blog posts are working (so the screen shots are real).</p>
<p>Last Wednesday we met and he told me that his current codebase is a single file holding all the classes without much documentation or error handling, but he is continuously working on it and once it&#8217;s becoming mature enough he will publish his work. He is also still waiting for a more detailed response from Fabien Potencier since we want the new forms system to become a part of the framework and thus Fabien&#8217;s opinion is important.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://blog.vworld.at/2009/04/14/improving-the-forms-even-more/comment-page-1/#comment-2111</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Sun, 03 May 2009 22:08:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vworld.at/?p=149#comment-2111</guid>
		<description>Have you implemented any of these suggestions, or these just suggested features for a future version of symfony?</description>
		<content:encoded><![CDATA[<p>Have you implemented any of these suggestions, or these just suggested features for a future version of symfony?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://blog.vworld.at/2009/04/14/improving-the-forms-even-more/comment-page-1/#comment-1927</link>
		<dc:creator>David</dc:creator>
		<pubDate>Thu, 16 Apr 2009 19:39:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vworld.at/?p=149#comment-1927</guid>
		<description>Today Bernhard and I found a few minutes during the linux weeks fair to discuss the forms issues face 2 face and close in on a general consensus. Besides other things we decided that the separators where a bad idea in the way I added them. He will summarize our current point of view in the following days at &lt;a href=&quot;http://webmozarts.com/&quot; rel=&quot;nofollow&quot;&gt;webmozarts.com&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Today Bernhard and I found a few minutes during the linux weeks fair to discuss the forms issues face 2 face and close in on a general consensus. Besides other things we decided that the separators where a bad idea in the way I added them. He will summarize our current point of view in the following days at <a href="http://webmozarts.com/" rel="nofollow">webmozarts.com</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andreas</title>
		<link>http://blog.vworld.at/2009/04/14/improving-the-forms-even-more/comment-page-1/#comment-1920</link>
		<dc:creator>Andreas</dc:creator>
		<pubDate>Thu, 16 Apr 2009 08:25:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vworld.at/?p=149#comment-1920</guid>
		<description>I agree with Bernhard on the separators belonging to the presentation layer, but I think field groups make sense (and are, in fact, needed). Whether a group is later rendered as a fieldset, div, or not at all should be left to the formatter, but groups of fields make sense from a form logic perspective as well.</description>
		<content:encoded><![CDATA[<p>I agree with Bernhard on the separators belonging to the presentation layer, but I think field groups make sense (and are, in fact, needed). Whether a group is later rendered as a fieldset, div, or not at all should be left to the formatter, but groups of fields make sense from a form logic perspective as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bernhard</title>
		<link>http://blog.vworld.at/2009/04/14/improving-the-forms-even-more/comment-page-1/#comment-1898</link>
		<dc:creator>Bernhard</dc:creator>
		<pubDate>Tue, 14 Apr 2009 19:15:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vworld.at/?p=149#comment-1898</guid>
		<description>I too think that we must take care not to mix up the MVC concepts. Once we add separators and stuff like that to the form, it will be very hard to know what belongs where.

Conceptually, the form is only a collection of fields, but not their presentation. The presentation is handled by the widgets, the formatters and (finally) the template. So any presentation logic belongs there, the form is just the glue to keep all the objects together.

I&#039;ll come back at some more of your points in my next post.</description>
		<content:encoded><![CDATA[<p>I too think that we must take care not to mix up the MVC concepts. Once we add separators and stuff like that to the form, it will be very hard to know what belongs where.</p>
<p>Conceptually, the form is only a collection of fields, but not their presentation. The presentation is handled by the widgets, the formatters and (finally) the template. So any presentation logic belongs there, the form is just the glue to keep all the objects together.</p>
<p>I&#8217;ll come back at some more of your points in my next post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://blog.vworld.at/2009/04/14/improving-the-forms-even-more/comment-page-1/#comment-1897</link>
		<dc:creator>David</dc:creator>
		<pubDate>Tue, 14 Apr 2009 18:52:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vworld.at/?p=149#comment-1897</guid>
		<description>@kjaer: looks like a valid solution too, although the inGroup() line seems duplicate to me ;-)</description>
		<content:encoded><![CDATA[<p>@kjaer: looks like a valid solution too, although the inGroup() line seems duplicate to me <img src='http://blog.vworld.at/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kjaer</title>
		<link>http://blog.vworld.at/2009/04/14/improving-the-forms-even-more/comment-page-1/#comment-1896</link>
		<dc:creator>kjaer</dc:creator>
		<pubDate>Tue, 14 Apr 2009 18:28:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vworld.at/?p=149#comment-1896</guid>
		<description>&lt;pre lang=&quot;php&quot;&gt;
$group_user_stuff = $this-&gt;addGroup(&#039;user_stuff&#039;, &#039;Personal information&#039;);
$group_user_stuff-&gt;addField(&#039;name&#039;)
                 -&gt;setWidgetAttributes(array(&#039;max_length&#039; =&gt; 15))
                 -&gt;setValidatorOptions(array(&#039;max_length&#039; =&gt; 15))
                 -&gt;inGroup(&#039;user_stuff&#039;);
&lt;/pre&gt;
Would be my solution.</description>
		<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$group_user_stuff</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addGroup</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'user_stuff'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Personal information'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$group_user_stuff</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addField</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span>
                 <span style="color: #339933;">-&gt;</span><span style="color: #004000;">setWidgetAttributes</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'max_length'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">15</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                 <span style="color: #339933;">-&gt;</span><span style="color: #004000;">setValidatorOptions</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'max_length'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">15</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
                 <span style="color: #339933;">-&gt;</span><span style="color: #004000;">inGroup</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'user_stuff'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Would be my solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://blog.vworld.at/2009/04/14/improving-the-forms-even-more/comment-page-1/#comment-1893</link>
		<dc:creator>David</dc:creator>
		<pubDate>Tue, 14 Apr 2009 11:42:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vworld.at/?p=149#comment-1893</guid>
		<description>Thanks for your suggestions!

You&#039;re right with the grouping, I thought so too. In fact we would even have to go one step further and define some kind of ordering of the fields allowing things like:

&lt;pre lang=&quot;php&quot;&gt;
$this
  -&gt;addField(&#039;name&#039;)
  -&gt;inGroup(&#039;user_stuff&#039;)
  -&gt;before(&#039;email&#039;);
&lt;/pre&gt;
or 
&lt;pre lang=&quot;php&quot;&gt;
$this
  -&gt;addField(&#039;name&#039;)
  -&gt;inGroup(&#039;user_stuff&#039;)
  -&gt;atPosition(2);
&lt;/pre&gt;

As for the separators: one could easily implement this using &quot;dummy&quot; label widgets with a custom formatter. If it becomes widely used in that way, there should be an easy accessor to it, because it will be used anyway but could be more comfortable for the programmer. But seen that way it is a minor issue anyway and not important for now, so perhaps it&#039;s better to leave it out.

It&#039;s quite difficult where to draw the line between form and template. Even the input widgets contain code that could be seen as template related, and it&#039;s the same for the formatters. Perhaps the solution could be to replace the formatters with something like partials, but on the other hand this creates new ties between the form component and the templating framework.</description>
		<content:encoded><![CDATA[<p>Thanks for your suggestions!</p>
<p>You&#8217;re right with the grouping, I thought so too. In fact we would even have to go one step further and define some kind of ordering of the fields allowing things like:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span>
  <span style="color: #339933;">-&gt;</span><span style="color: #004000;">addField</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span>
  <span style="color: #339933;">-&gt;</span><span style="color: #004000;">inGroup</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'user_stuff'</span><span style="color: #009900;">&#41;</span>
  <span style="color: #339933;">-&gt;</span><span style="color: #004000;">before</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span>
  <span style="color: #339933;">-&gt;</span><span style="color: #004000;">addField</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span>
  <span style="color: #339933;">-&gt;</span><span style="color: #004000;">inGroup</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'user_stuff'</span><span style="color: #009900;">&#41;</span>
  <span style="color: #339933;">-&gt;</span><span style="color: #004000;">atPosition</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>As for the separators: one could easily implement this using &#8220;dummy&#8221; label widgets with a custom formatter. If it becomes widely used in that way, there should be an easy accessor to it, because it will be used anyway but could be more comfortable for the programmer. But seen that way it is a minor issue anyway and not important for now, so perhaps it&#8217;s better to leave it out.</p>
<p>It&#8217;s quite difficult where to draw the line between form and template. Even the input widgets contain code that could be seen as template related, and it&#8217;s the same for the formatters. Perhaps the solution could be to replace the formatters with something like partials, but on the other hand this creates new ties between the form component and the templating framework.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: naholyr</title>
		<link>http://blog.vworld.at/2009/04/14/improving-the-forms-even-more/comment-page-1/#comment-1890</link>
		<dc:creator>naholyr</dc:creator>
		<pubDate>Tue, 14 Apr 2009 09:45:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.vworld.at/?p=149#comment-1890</guid>
		<description>About grouping : Instead of relying on the order instructions are called, I&#039;d be more explicit.
&lt;pre lang=&quot;php&quot;&gt;
  $this-&gt;addGroup(&#039;user_stuff&#039;, &#039;Personal information&#039;);
  $this-&gt;addField(&#039;name&#039;)
       -&gt;setWidgetAttributes(array(&#039;max_length&#039; =&gt; 15))
       -&gt;setValidatorOptions(array(&#039;max_length&#039; =&gt; 15))
       -&gt;inGroup(&#039;user_stuff&#039;);
&lt;/pre&gt;
Or

&lt;pre lang=&quot;php&quot;&gt;
  $this-&gt;addGroup(&#039;user_stuff&#039;, &#039;Personal information&#039;, array(&#039;name&#039;, &#039;email&#039;));
&lt;/pre&gt;

Both could be supported by the way (even your method could be supported to, but it could be a bit confusing).


For all the other stuff, I&#039;d say +10 to I18N injection, field formatters, submit buttons, +1 to help texts, submit buttons, and required marks, and finally a -1 to separators.
Everything is already a bit messed up in sfForm : we cannot clearly get what is view, what is controller, what is model. And with this we add a little more mess... 

Though, there is clearly a flaw about this rendering thing. I&#039;d think more about a template implementation, or a formRenderer with smart markers :

&lt;pre lang=&quot;php&quot;&gt;
class myFormRenderer
{
  protected $format = &#039;%fields[name]% %separator% %fields[email]% %separator[anotherSeparatorFormat]% %fields[*]%&#039;;
}
&lt;/pre&gt;

Well, that&#039;s far from perfect but the information about how fields must be arranged in the view must be in a view, or at least in a &quot;renderer&quot;.</description>
		<content:encoded><![CDATA[<p>About grouping : Instead of relying on the order instructions are called, I&#8217;d be more explicit.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">  <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addGroup</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'user_stuff'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Personal information'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addField</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#41;</span>
       <span style="color: #339933;">-&gt;</span><span style="color: #004000;">setWidgetAttributes</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'max_length'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">15</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
       <span style="color: #339933;">-&gt;</span><span style="color: #004000;">setValidatorOptions</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'max_length'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">15</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
       <span style="color: #339933;">-&gt;</span><span style="color: #004000;">inGroup</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'user_stuff'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Or</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">  <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addGroup</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'user_stuff'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Personal information'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Both could be supported by the way (even your method could be supported to, but it could be a bit confusing).</p>
<p>For all the other stuff, I&#8217;d say +10 to I18N injection, field formatters, submit buttons, +1 to help texts, submit buttons, and required marks, and finally a -1 to separators.<br />
Everything is already a bit messed up in sfForm : we cannot clearly get what is view, what is controller, what is model. And with this we add a little more mess&#8230; </p>
<p>Though, there is clearly a flaw about this rendering thing. I&#8217;d think more about a template implementation, or a formRenderer with smart markers :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> myFormRenderer
<span style="color: #009900;">&#123;</span>
  protected <span style="color: #000088;">$format</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'%fields[name]% %separator% %fields[email]% %separator[anotherSeparatorFormat]% %fields[*]%'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Well, that&#8217;s far from perfect but the information about how fields must be arranged in the view must be in a view, or at least in a &#8220;renderer&#8221;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
