<?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: Savant: Why Plugins?</title>
	<atom:link href="http://paul-m-jones.com/archives/99/feed" rel="self" type="application/rss+xml" />
	<link>http://paul-m-jones.com/archives/99?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=savant-why-plugins</link>
	<description>It&#039;s not enough to be smart; you have to actually know things.</description>
	<lastBuildDate>Wed, 16 May 2012 17:27:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<item>
		<title>By: Paul M. Jones</title>
		<link>http://paul-m-jones.com/archives/99/comment-page-1#comment-2171</link>
		<dc:creator>Paul M. Jones</dc:creator>
		<pubDate>Thu, 20 Jan 2005 23:23:11 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/blog/?p=99#comment-2171</guid>
		<description>Heiner, you said &quot;you can also put all commonly used plugins in one file that gets included in every script&quot;.  This is perfectly valid; in fact, the autoload portion of Savant only tries to load the class if it does not already exist.  So if you want to preload a set of plugins, or keep them all in one file and load that file, it&#039;s perfectly acceptable practice.</description>
		<content:encoded><![CDATA[<p>Heiner, you said &#8220;you can also put all commonly used plugins in one file that gets included in every script&#8221;.  This is perfectly valid; in fact, the autoload portion of Savant only tries to load the class if it does not already exist.  So if you want to preload a set of plugins, or keep them all in one file and load that file, it&#8217;s perfectly acceptable practice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heiner</title>
		<link>http://paul-m-jones.com/archives/99/comment-page-1#comment-2170</link>
		<dc:creator>Heiner</dc:creator>
		<pubDate>Thu, 20 Jan 2005 22:52:57 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/blog/?p=99#comment-2170</guid>
		<description>Even if it is quite convenient to autoload Savant plugins based on filenames, you can also put all commonly used plugins in one file that gets included in every script. In my experience, this yields better performance and avoids dozens of includes with 10 lines of code each (especially if you are generating every bit of repetitive HTML thru plugins, as I like to do).

I agree with Lukas concerning the separation of application logic and display logic. The savant object gets the raw data from the application (strings, arrays, objects...), and the template generates all (HTML or other) output, &quot;hardcoded&quot; or via savant plugins. This way it is quite easy to decide (for me at least) what goes where.</description>
		<content:encoded><![CDATA[<p>Even if it is quite convenient to autoload Savant plugins based on filenames, you can also put all commonly used plugins in one file that gets included in every script. In my experience, this yields better performance and avoids dozens of includes with 10 lines of code each (especially if you are generating every bit of repetitive HTML thru plugins, as I like to do).</p>
<p>I agree with Lukas concerning the separation of application logic and display logic. The savant object gets the raw data from the application (strings, arrays, objects&#8230;), and the template generates all (HTML or other) output, &#8220;hardcoded&#8221; or via savant plugins. This way it is quite easy to decide (for me at least) what goes where.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lukas</title>
		<link>http://paul-m-jones.com/archives/99/comment-page-1#comment-2168</link>
		<dc:creator>Lukas</dc:creator>
		<pubDate>Thu, 20 Jan 2005 18:48:37 +0000</pubDate>
		<guid isPermaLink="false">http://paul-m-jones.com/blog/?p=99#comment-2168</guid>
		<description>Its a common misconception in my view that templates should not contain logic. They should just not contain business logic but instead be only concerned with display logic. Some people prever to keep the display logic inside yet another layer, but I find this approach to be too inefficient both performance and also for the designer (since he needs to chunk up the html code into little snippets).

Obiviously something like alternating row colors in a table does not belong in the business logic. I also think that a template should be free to generate plain text, html, xml, pdf, excel or even images. All of this is display logic and belongs into the template.

On the plugins idea the only problem I see with how people use plugins is that they stick few lines of code into separate files. I find this a somewhat annoying style and it probably also doesnt help performance either. Especially with a bytecode cache.</description>
		<content:encoded><![CDATA[<p>Its a common misconception in my view that templates should not contain logic. They should just not contain business logic but instead be only concerned with display logic. Some people prever to keep the display logic inside yet another layer, but I find this approach to be too inefficient both performance and also for the designer (since he needs to chunk up the html code into little snippets).</p>
<p>Obiviously something like alternating row colors in a table does not belong in the business logic. I also think that a template should be free to generate plain text, html, xml, pdf, excel or even images. All of this is display logic and belongs into the template.</p>
<p>On the plugins idea the only problem I see with how people use plugins is that they stick few lines of code into separate files. I find this a somewhat annoying style and it probably also doesnt help performance either. Especially with a bytecode cache.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

