<?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: A missing convention</title>
	<atom:link href="http://cakebaker.42dh.com/2008/10/06/a-missing-convention/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com/2008/10/06/a-missing-convention/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Sat, 13 Mar 2010 15:19:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: dr. Hannibal Lecter</title>
		<link>http://cakebaker.42dh.com/2008/10/06/a-missing-convention/comment-page-1/#comment-112169</link>
		<dc:creator>dr. Hannibal Lecter</dc:creator>
		<pubDate>Fri, 07 Nov 2008 14:37:34 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=874#comment-112169</guid>
		<description>After giving it some thought, I think your suggestion makes sense. My own libs are indeed &quot;vendors&quot;, but obviously there are many situations where I wouldn&#039;t want to mix them with &quot;4th party&quot; vendors :)</description>
		<content:encoded><![CDATA[<p>After giving it some thought, I think your suggestion makes sense. My own libs are indeed &#8220;vendors&#8221;, but obviously there are many situations where I wouldn&#8217;t want to mix them with &#8220;4th party&#8221; vendors :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/10/06/a-missing-convention/comment-page-1/#comment-109840</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Sat, 11 Oct 2008 09:00:14 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=874#comment-109840</guid>
		<description>@naonak, Hannibal: Thanks for your comments!

@naonak: Yes, that&#039;s a step in the right direction!

@Hannibal: The decision is quite simple. You have to ask yourself the following question: would you write tests for it in your application (if you are into testing)? If yes, it goes to the libs folder, else to the vendors folder.</description>
		<content:encoded><![CDATA[<p>@naonak, Hannibal: Thanks for your comments!</p>
<p>@naonak: Yes, that&#8217;s a step in the right direction!</p>
<p>@Hannibal: The decision is quite simple. You have to ask yourself the following question: would you write tests for it in your application (if you are into testing)? If yes, it goes to the libs folder, else to the vendors folder.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dr. Hannibal Lecter</title>
		<link>http://cakebaker.42dh.com/2008/10/06/a-missing-convention/comment-page-1/#comment-109725</link>
		<dc:creator>dr. Hannibal Lecter</dc:creator>
		<pubDate>Fri, 10 Oct 2008 09:00:30 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=874#comment-109725</guid>
		<description>This brings another issue in my mind..

If you create a library, and put it in your new lib folder, then I get the library from you, where do I put it? It&#039;s third party, not maintained by me, but it&#039;s your library. For the sake of the argument, let&#039;s say we&#039;re best pals working in a company together, but on different projects.

Vendors or libs?

(I obviously need coffee ASAP:))</description>
		<content:encoded><![CDATA[<p>This brings another issue in my mind..</p>
<p>If you create a library, and put it in your new lib folder, then I get the library from you, where do I put it? It&#8217;s third party, not maintained by me, but it&#8217;s your library. For the sake of the argument, let&#8217;s say we&#8217;re best pals working in a company together, but on different projects.</p>
<p>Vendors or libs?</p>
<p>(I obviously need coffee ASAP:))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: naonak</title>
		<link>http://cakebaker.42dh.com/2008/10/06/a-missing-convention/comment-page-1/#comment-109720</link>
		<dc:creator>naonak</dc:creator>
		<pubDate>Fri, 10 Oct 2008 08:03:26 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=874#comment-109720</guid>
		<description>Just put this in core.php :

&lt;code&gt;
$vendorPaths = array(APP_DIR . DS . &#039;libs&#039;);
&lt;/code&gt;

You allays need to use &lt;code&gt;App::import(&#039;Vendor&#039;, &#039;my_on_lib&#039;);&lt;/code&gt; but files are physically separated.</description>
		<content:encoded><![CDATA[<p>Just put this in core.php :</p>
<p><code>$vendorPaths = array(APP_DIR . DS . 'libs');</code></p>
<p>You allays need to use <code>App::import('Vendor', 'my_on_lib');</code> but files are physically separated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2008/10/06/a-missing-convention/comment-page-1/#comment-109195</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Tue, 07 Oct 2008 08:50:07 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=874#comment-109195</guid>
		<description>@all: Thanks for your comments!

@nate: I&#039;m looking for a better way to structure cake applications. For me an application consists basically of the following logical parts: model functionality, view functionality, controller functionality, non-MVC functionality, and 3rd party libraries. And so I think this should also be reflected in the structure of the &quot;app&quot; folder and the conventions.

@Brendon: Yes.

@skiedr: Yes, that&#039;s probably the approach I have to adopt myself.

@Chris: Well, not everything does fit into the MVC structure. An example is a utility class which fetches the content of an url, and is used in models and components. Other examples are the classes in the cake/libs folder. If they wouldn&#039;t be part of the framework, where would you place them if you have to write them yourself?

@Hannibal Lecter: *g*. Sure, you can create a subfolder in the &quot;vendors&quot; folder and place your own utility classes there. But as I described in the answer to nate, for me an application consists of five logical parts, MVC plus non-MVC classes and 3rd party libraries, which I think should be represented in the &quot;app&quot; folder. 

@David: For me a vendor class is a class which wasn&#039;t written specifically for cake and hence doesn&#039;t follow the cake conventions. It is usually maintained by someone else. 

On the other hand, a &quot;lib&quot; class (maybe non-MVC class is more suitable) is a class which doesn&#039;t fit into the MVC structure and is written and maintained by myself. 

Somehow it is similar to the &quot;app&quot; and &quot;cake&quot; folder: by convention you work in the &quot;app&quot; folder and you don&#039;t touch the &quot;cake&quot; folder. If we adapt this convention, we could say: you work in the (not yet existing) &quot;libs&quot; folder and you don&#039;t touch the &quot;vendors&quot; folder unless you have to add/update/remove a 3rd party library.</description>
		<content:encoded><![CDATA[<p>@all: Thanks for your comments!</p>
<p>@nate: I&#8217;m looking for a better way to structure cake applications. For me an application consists basically of the following logical parts: model functionality, view functionality, controller functionality, non-MVC functionality, and 3rd party libraries. And so I think this should also be reflected in the structure of the &#8220;app&#8221; folder and the conventions.</p>
<p>@Brendon: Yes.</p>
<p>@skiedr: Yes, that&#8217;s probably the approach I have to adopt myself.</p>
<p>@Chris: Well, not everything does fit into the MVC structure. An example is a utility class which fetches the content of an url, and is used in models and components. Other examples are the classes in the cake/libs folder. If they wouldn&#8217;t be part of the framework, where would you place them if you have to write them yourself?</p>
<p>@Hannibal Lecter: *g*. Sure, you can create a subfolder in the &#8220;vendors&#8221; folder and place your own utility classes there. But as I described in the answer to nate, for me an application consists of five logical parts, MVC plus non-MVC classes and 3rd party libraries, which I think should be represented in the &#8220;app&#8221; folder. </p>
<p>@David: For me a vendor class is a class which wasn&#8217;t written specifically for cake and hence doesn&#8217;t follow the cake conventions. It is usually maintained by someone else. </p>
<p>On the other hand, a &#8220;lib&#8221; class (maybe non-MVC class is more suitable) is a class which doesn&#8217;t fit into the MVC structure and is written and maintained by myself. </p>
<p>Somehow it is similar to the &#8220;app&#8221; and &#8220;cake&#8221; folder: by convention you work in the &#8220;app&#8221; folder and you don&#8217;t touch the &#8220;cake&#8221; folder. If we adapt this convention, we could say: you work in the (not yet existing) &#8220;libs&#8221; folder and you don&#8217;t touch the &#8220;vendors&#8221; folder unless you have to add/update/remove a 3rd party library.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Persson</title>
		<link>http://cakebaker.42dh.com/2008/10/06/a-missing-convention/comment-page-1/#comment-109151</link>
		<dc:creator>David Persson</dc:creator>
		<pubDate>Mon, 06 Oct 2008 21:09:17 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=874#comment-109151</guid>
		<description>For me it feels wrong to put my own classes into a vendors folder, too. 

I really would like to see a change of the default folder structure or an insight into the logic which is behind the current one.

The naming of the vendors folder always irritated me. 
Maybe it&#039;s because I&#039;m not a native speaker and the *only* thing that comes to my mind when I read &quot;vendors&quot; is &quot;3rd party&quot;. 

From the POV of the framework itself, every other lib (not part of MVC) is a vendor lib. 
Following this logic should I put the cake libs (not part of MVC e.g. the Xml class) into my vendors folder? Certainly not.

So... what is a vendor class? What is a lib? And what is actually part of MVC?

Seems nate is right and there is no pattern of seperation (necessary) between libs and vendors.

But when there is no difference between them, then my suggestion is to rename the &quot;vendors&quot; folder to &quot;libs&quot;.  

And how would we import the classes then? 
App::import(&#039;Core&#039; ...) for the core libs
App::import(&#039;App&#039; ...) for the app libs</description>
		<content:encoded><![CDATA[<p>For me it feels wrong to put my own classes into a vendors folder, too. </p>
<p>I really would like to see a change of the default folder structure or an insight into the logic which is behind the current one.</p>
<p>The naming of the vendors folder always irritated me.<br />
Maybe it&#8217;s because I&#8217;m not a native speaker and the *only* thing that comes to my mind when I read &#8220;vendors&#8221; is &#8220;3rd party&#8221;. </p>
<p>From the POV of the framework itself, every other lib (not part of MVC) is a vendor lib.<br />
Following this logic should I put the cake libs (not part of MVC e.g. the Xml class) into my vendors folder? Certainly not.</p>
<p>So&#8230; what is a vendor class? What is a lib? And what is actually part of MVC?</p>
<p>Seems nate is right and there is no pattern of seperation (necessary) between libs and vendors.</p>
<p>But when there is no difference between them, then my suggestion is to rename the &#8220;vendors&#8221; folder to &#8220;libs&#8221;.  </p>
<p>And how would we import the classes then?<br />
App::import(&#8216;Core&#8217; &#8230;) for the core libs<br />
App::import(&#8216;App&#8217; &#8230;) for the app libs</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dr. Hannibal Lecter</title>
		<link>http://cakebaker.42dh.com/2008/10/06/a-missing-convention/comment-page-1/#comment-109135</link>
		<dc:creator>dr. Hannibal Lecter</dc:creator>
		<pubDate>Mon, 06 Oct 2008 18:24:01 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=874#comment-109135</guid>
		<description>A peculiar idea.

Wouldn&#039;t it be more simple to just create a sub-folder in vendors for your own libs? You get both the separation and you can use the built-in App::import(...).</description>
		<content:encoded><![CDATA[<p>A peculiar idea.</p>
<p>Wouldn&#8217;t it be more simple to just create a sub-folder in vendors for your own libs? You get both the separation and you can use the built-in App::import(&#8230;).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Forrette</title>
		<link>http://cakebaker.42dh.com/2008/10/06/a-missing-convention/comment-page-1/#comment-109132</link>
		<dc:creator>Chris Forrette</dc:creator>
		<pubDate>Mon, 06 Oct 2008 17:34:06 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=874#comment-109132</guid>
		<description>I think this is what Nate &amp; Brendon were trying to say, but why wouldn&#039;t you just use the existing models/views/controllers directories to put your classes into as they relate to those three legs of the framework? What&#039;s an example of a class you&#039;ve built like this? I guess can&#039;t quite relate because everything I&#039;ve had to use with Cake has either fit in vendors or just extended one of the existing classes and gone into behaviors/helpers/components.</description>
		<content:encoded><![CDATA[<p>I think this is what Nate &amp; Brendon were trying to say, but why wouldn&#8217;t you just use the existing models/views/controllers directories to put your classes into as they relate to those three legs of the framework? What&#8217;s an example of a class you&#8217;ve built like this? I guess can&#8217;t quite relate because everything I&#8217;ve had to use with Cake has either fit in vendors or just extended one of the existing classes and gone into behaviors/helpers/components.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: skiedr</title>
		<link>http://cakebaker.42dh.com/2008/10/06/a-missing-convention/comment-page-1/#comment-109127</link>
		<dc:creator>skiedr</dc:creator>
		<pubDate>Mon, 06 Oct 2008 16:55:20 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=874#comment-109127</guid>
		<description>I preffer to use app/libs folder for this purpose.
I declare constant APP_LIBS in bootstrap.
And use next import for include my own lib.
App::import(&#039;File&#039;, &#039;MyCoolLib&#039;, true, array(APP_LIBS), &#039;my_cool_lib.php&#039;);</description>
		<content:encoded><![CDATA[<p>I preffer to use app/libs folder for this purpose.<br />
I declare constant APP_LIBS in bootstrap.<br />
And use next import for include my own lib.<br />
App::import(&#8216;File&#8217;, &#8216;MyCoolLib&#8217;, true, array(APP_LIBS), &#8216;my_cool_lib.php&#8217;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brendon Kozlowski</title>
		<link>http://cakebaker.42dh.com/2008/10/06/a-missing-convention/comment-page-1/#comment-109126</link>
		<dc:creator>Brendon Kozlowski</dc:creator>
		<pubDate>Mon, 06 Oct 2008 16:48:46 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/?p=874#comment-109126</guid>
		<description>IMHO, I think he&#039;s looking for a better way of file/class organization and hierarchy.  Since we already have one set up for us within the framework, it makes sense to try to use its own hierarchy and organization to separate out our own.</description>
		<content:encoded><![CDATA[<p>IMHO, I think he&#8217;s looking for a better way of file/class organization and hierarchy.  Since we already have one set up for us within the framework, it makes sense to try to use its own hierarchy and organization to separate out our own.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
