<?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"
	>
<channel>
	<title>Comments on: A new website, and some thoughts on choosing Symfony</title>
	<atom:link href="http://symfonynerds.com/blog/?feed=rss2&#038;p=323" rel="self" type="application/rss+xml" />
	<link>http://symfonynerds.com/blog/?p=323</link>
	<description>Nerds who love the symfony-project</description>
	<pubDate>Wed, 08 Sep 2010 03:37:08 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Humbling experiences: when other programmers write simpler, more elegant code</title>
		<link>http://symfonynerds.com/blog/?p=323#comment-887</link>
		<dc:creator>Humbling experiences: when other programmers write simpler, more elegant code</dc:creator>
		<pubDate>Mon, 01 Mar 2010 01:31:40 +0000</pubDate>
		<guid isPermaLink="false">http://symfonynerds.com/blog/?p=323#comment-887</guid>
		<description>[...] Just this last summer I worked on a project with Scott Meves. We were using the Symfony framework, the same framework that WP Questions is built in. Scott is a true genius when it comes to Symfony. I recall we needed to do some JOIN calls to the [...]</description>
		<content:encoded><![CDATA[<p>[...] Just this last summer I worked on a project with Scott Meves. We were using the Symfony framework, the same framework that WP Questions is built in. Scott is a true genius when it comes to Symfony. I recall we needed to do some JOIN calls to the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Humbling experiences: when other programmers have simpler code &#124; WP Questions</title>
		<link>http://symfonynerds.com/blog/?p=323#comment-779</link>
		<dc:creator>Humbling experiences: when other programmers have simpler code &#124; WP Questions</dc:creator>
		<pubDate>Fri, 08 Jan 2010 22:06:45 +0000</pubDate>
		<guid isPermaLink="false">http://symfonynerds.com/blog/?p=323#comment-779</guid>
		<description>[...] Just this last summer I worked on a project with Scott Meves. We were using the Symfony framework, the same framework that WP Questions is built in. Scott is a true genius when it comes to Symfony. I recall we needed to do some JOIN calls to the [...]</description>
		<content:encoded><![CDATA[<p>[...] Just this last summer I worked on a project with Scott Meves. We were using the Symfony framework, the same framework that WP Questions is built in. Scott is a true genius when it comes to Symfony. I recall we needed to do some JOIN calls to the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lawrence</title>
		<link>http://symfonynerds.com/blog/?p=323#comment-724</link>
		<dc:creator>Lawrence</dc:creator>
		<pubDate>Fri, 11 Dec 2009 20:49:05 +0000</pubDate>
		<guid isPermaLink="false">http://symfonynerds.com/blog/?p=323#comment-724</guid>
		<description>Oncle Tom, there are some very good reasons not to use database views on any project. I have some worries about performance, given the problems described in MySql forums and weblogs such as these: 

http://forums.mysql.com/read.php?100,164811,164999#msg-164999

http://www.mysqlperformanceblog.com/2007/08/12/mysql-view-as-performance-troublemaker/

One can avoid those gotchas if one is careful. And, of course, I expect MySql to get better about handling views. 

I take this approach, of using views, for 4 main reasons: 

1.) Development time - it is quick to let  "symfony propel:build-model" write all of my model code. 

2.) Documentation - I'll be handing this project over to other programmers. Rather than having a dozen custom  JOIN methods scattered through a dozen model classes, future programmers can look in schema.yml and see every JOIN that exists in the application. 

3.) Optimization - for reasons of performance, it's important to build an index on every column that you use in a JOIN, or in a WHERE clause. In the past, I've found it difficult to discover which database table columns were used in WHERE clauses. That is, for years, I would write software, and then try to optimize database performance, which then entailed research into how the database is actually being used. This sometimes gets complicated on projects where multiple programmers were working. Keeping all such data in schema.yml makes things easy (you may regard this as a repeat of #2).

4.) Portability - repeating part of #2 - I understand what you are trying to say about portability. Your point is "What if we later move to a data storage technology that doesn't support JOIN syntax?" For instance, what if in the future we decided we wanted to keep all of our data in a big XML flat file? XML files do not have VIEWS, so what are we going to do then? But I see this issue exactly the opposite way that you see it. Our software is expecting some kind of view that holds a particular kind of data. The schema.yml is the ideal place to record what kind of data the software is expecting, or rather, the views which the software assumes it can rely upon. 

Suppose that 4 years from now the decision is made to move to a XML flat file. Suppose I'm no longer around, and different programmers are in charge of the transition. They should be able to take one glance at schema.yml and see exactly what views of data the software is expecting. Keeping this data all in schema.yml seems much more portable to me than having a dozen or so custom JOIN methods, in a dozen different models, which might need to be re-written. 

Of course, no one is putting a gun to our head and telling us to move to a flat XML file. That is the worst case scenario, and I use it only to address your concerns. What is more likely is that, if the site scaled up and became huge, we might move to a RDBMS that had a more robust handling of VIEWs. For instance, maybe the decision would be made to move to Oracle. Then using a VIEW would offer a big performance advantage over using a JOIN. 

You've probably heard the idea that &lt;a href="http://www.teamlalala.com/blog/2009/08/01/joins-are-evil/" rel="nofollow"&gt;JOINs Are Evil&lt;/a&gt;
If the site got really huge, then we would look for ways to de-normalize our data in ways that allowed for better performance. We might end up relying on temporary, pre-joined table for everything, possibly using an RDBMS that makes this easy (again, Oracle comes to mind). Or, maybe, we would look into the more radical approaches now being explored by technologies like CouchDb or Hadoop. However, this is not a problem that we would try to solve in a method in our model class. The problem eventually becomes bigger and more fundamental than anything you can address in your model class.</description>
		<content:encoded><![CDATA[<p>Oncle Tom, there are some very good reasons not to use database views on any project. I have some worries about performance, given the problems described in MySql forums and weblogs such as these: </p>
<p><a href="http://forums.mysql.com/read.php?100,164811,164999#msg-164999" rel="nofollow">http://forums.mysql.com/read.php?100,164811,164999#msg-164999</a></p>
<p><a href="http://www.mysqlperformanceblog.com/2007/08/12/mysql-view-as-performance-troublemaker/" rel="nofollow">http://www.mysqlperformanceblog.com/2007/08/12/mysql-view-as-performance-troublemaker/</a></p>
<p>One can avoid those gotchas if one is careful. And, of course, I expect MySql to get better about handling views. </p>
<p>I take this approach, of using views, for 4 main reasons: </p>
<p>1.) Development time - it is quick to let  &#8220;symfony propel:build-model&#8221; write all of my model code. </p>
<p>2.) Documentation - I&#8217;ll be handing this project over to other programmers. Rather than having a dozen custom  JOIN methods scattered through a dozen model classes, future programmers can look in schema.yml and see every JOIN that exists in the application. </p>
<p>3.) Optimization - for reasons of performance, it&#8217;s important to build an index on every column that you use in a JOIN, or in a WHERE clause. In the past, I&#8217;ve found it difficult to discover which database table columns were used in WHERE clauses. That is, for years, I would write software, and then try to optimize database performance, which then entailed research into how the database is actually being used. This sometimes gets complicated on projects where multiple programmers were working. Keeping all such data in schema.yml makes things easy (you may regard this as a repeat of #2).</p>
<p>4.) Portability - repeating part of #2 - I understand what you are trying to say about portability. Your point is &#8220;What if we later move to a data storage technology that doesn&#8217;t support JOIN syntax?&#8221; For instance, what if in the future we decided we wanted to keep all of our data in a big XML flat file? XML files do not have VIEWS, so what are we going to do then? But I see this issue exactly the opposite way that you see it. Our software is expecting some kind of view that holds a particular kind of data. The schema.yml is the ideal place to record what kind of data the software is expecting, or rather, the views which the software assumes it can rely upon. </p>
<p>Suppose that 4 years from now the decision is made to move to a XML flat file. Suppose I&#8217;m no longer around, and different programmers are in charge of the transition. They should be able to take one glance at schema.yml and see exactly what views of data the software is expecting. Keeping this data all in schema.yml seems much more portable to me than having a dozen or so custom JOIN methods, in a dozen different models, which might need to be re-written. </p>
<p>Of course, no one is putting a gun to our head and telling us to move to a flat XML file. That is the worst case scenario, and I use it only to address your concerns. What is more likely is that, if the site scaled up and became huge, we might move to a RDBMS that had a more robust handling of VIEWs. For instance, maybe the decision would be made to move to Oracle. Then using a VIEW would offer a big performance advantage over using a JOIN. </p>
<p>You&#8217;ve probably heard the idea that <a href="http://www.teamlalala.com/blog/2009/08/01/joins-are-evil/" rel="nofollow">JOINs Are Evil</a><br />
If the site got really huge, then we would look for ways to de-normalize our data in ways that allowed for better performance. We might end up relying on temporary, pre-joined table for everything, possibly using an RDBMS that makes this easy (again, Oracle comes to mind). Or, maybe, we would look into the more radical approaches now being explored by technologies like CouchDb or Hadoop. However, this is not a problem that we would try to solve in a method in our model class. The problem eventually becomes bigger and more fundamental than anything you can address in your model class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Closer To The Ideal &#187; Blog Archive &#187; WP Questions, a site where WordPress experts can answer WordPress questions for money</title>
		<link>http://symfonynerds.com/blog/?p=323#comment-720</link>
		<dc:creator>Closer To The Ideal &#187; Blog Archive &#187; WP Questions, a site where WordPress experts can answer WordPress questions for money</dc:creator>
		<pubDate>Wed, 09 Dec 2009 23:17:42 +0000</pubDate>
		<guid isPermaLink="false">http://symfonynerds.com/blog/?p=323#comment-720</guid>
		<description>[...] used the Symfony framework to build this site. I&#8217;ve written a somewhat technical post, over on Symfony Nerds, explaining why this was a good choice for [...]</description>
		<content:encoded><![CDATA[<p>[...] used the Symfony framework to build this site. I&#8217;ve written a somewhat technical post, over on Symfony Nerds, explaining why this was a good choice for [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richtermeister</title>
		<link>http://symfonynerds.com/blog/?p=323#comment-719</link>
		<dc:creator>Richtermeister</dc:creator>
		<pubDate>Wed, 09 Dec 2009 21:20:50 +0000</pubDate>
		<guid isPermaLink="false">http://symfonynerds.com/blog/?p=323#comment-719</guid>
		<description>That is a sweet idea you've got there, and you've laid out out a good decision making process. The view idea is brilliant! I'll be using that, thanks.

Rock on.
Daniel</description>
		<content:encoded><![CDATA[<p>That is a sweet idea you&#8217;ve got there, and you&#8217;ve laid out out a good decision making process. The view idea is brilliant! I&#8217;ll be using that, thanks.</p>
<p>Rock on.<br />
Daniel</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oncle Tom</title>
		<link>http://symfonynerds.com/blog/?p=323#comment-718</link>
		<dc:creator>Oncle Tom</dc:creator>
		<pubDate>Wed, 09 Dec 2009 20:56:21 +0000</pubDate>
		<guid isPermaLink="false">http://symfonynerds.com/blog/?p=323#comment-718</guid>
		<description>You could even save code with that : &lt;code&gt;$request-&#62;getParameter('limit', 25)&lt;/code&gt;

Best of all, queries like that should even be abstracted to the AnswersTotalsUsersPeer class, just to have a &lt;code&gt;AnswersTotalsUsersPeer::doSelectByHighestPrizeTotal($request-&#62;getParameter('limit', 25))&lt;/code&gt;

Better action logic. Better reusability.

Symfony is great for sure and like you, I don't think WP is flexible enough, with good performances, to do such things.

However, it's quite strange you create a view, and add some logic in database against managing logic within the code. Which is easier to deploy and maintain.</description>
		<content:encoded><![CDATA[<p>You could even save code with that : <code>$request-&gt;getParameter('limit', 25)</code></p>
<p>Best of all, queries like that should even be abstracted to the AnswersTotalsUsersPeer class, just to have a <code>AnswersTotalsUsersPeer::doSelectByHighestPrizeTotal($request-&gt;getParameter('limit', 25))</code></p>
<p>Better action logic. Better reusability.</p>
<p>Symfony is great for sure and like you, I don&#8217;t think WP is flexible enough, with good performances, to do such things.</p>
<p>However, it&#8217;s quite strange you create a view, and add some logic in database against managing logic within the code. Which is easier to deploy and maintain.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
