<?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: Should the table definition be in the model?</title>
	<atom:link href="http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/</link>
	<description>baking cakes with CakePHP</description>
	<lastBuildDate>Tue, 16 Mar 2010 17:17:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/comment-page-1/#comment-110253</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Wed, 15 Oct 2008 13:47:46 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/#comment-110253</guid>
		<description>@Rafael: Thanks for your comment!

Yes, that&#039;s true, it wouldn&#039;t work if you want to use &quot;advanced&quot; db stuff. For using such features you probably have to keep working with SQL commands. And at least if you do not have to support different database systems that&#039;s probably ok. For example, in NoseRub we use a very basic migration system which uses SQL scripts.</description>
		<content:encoded><![CDATA[<p>@Rafael: Thanks for your comment!</p>
<p>Yes, that&#8217;s true, it wouldn&#8217;t work if you want to use &#8220;advanced&#8221; db stuff. For using such features you probably have to keep working with SQL commands. And at least if you do not have to support different database systems that&#8217;s probably ok. For example, in NoseRub we use a very basic migration system which uses SQL scripts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rafaelbandeira3</title>
		<link>http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/comment-page-1/#comment-110195</link>
		<dc:creator>rafaelbandeira3</dc:creator>
		<pubDate>Tue, 14 Oct 2008 23:41:50 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/#comment-110195</guid>
		<description>crawl out your posts are always a joy!
it&#039;s certainly a good concept and shouldn&#039;t have a dificult implementation.
The only thing about it is the same thing about migrations: you can&#039;t deal with little bit more complex schemes - like innodb foreign keys, mysql statements (&#039;CURRENT_TIMESTAMP&#039;) - and such... I think not just cake but most of frameworks out there still lack support on &quot;deep&quot; db usage, what makes us keep tide to old SQL commands...</description>
		<content:encoded><![CDATA[<p>crawl out your posts are always a joy!<br />
it&#8217;s certainly a good concept and shouldn&#8217;t have a dificult implementation.<br />
The only thing about it is the same thing about migrations: you can&#8217;t deal with little bit more complex schemes &#8211; like innodb foreign keys, mysql statements (&#8216;CURRENT_TIMESTAMP&#8217;) &#8211; and such&#8230; I think not just cake but most of frameworks out there still lack support on &#8220;deep&#8221; db usage, what makes us keep tide to old SQL commands&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/comment-page-1/#comment-110150</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Tue, 14 Oct 2008 15:27:04 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/#comment-110150</guid>
		<description>@Eddie: Thanks for your comment!

Richard&#039;s approach is already possible with some tools: they allow you to model the tables and generate them in the database. Then you can use bake as usual. That&#039;s probably the easiest way, as it doesn&#039;t require anything that&#039;s not already available.</description>
		<content:encoded><![CDATA[<p>@Eddie: Thanks for your comment!</p>
<p>Richard&#8217;s approach is already possible with some tools: they allow you to model the tables and generate them in the database. Then you can use bake as usual. That&#8217;s probably the easiest way, as it doesn&#8217;t require anything that&#8217;s not already available.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Webb</title>
		<link>http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/comment-page-1/#comment-110074</link>
		<dc:creator>Eddie Webb</dc:creator>
		<pubDate>Mon, 13 Oct 2008 23:29:40 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/#comment-110074</guid>
		<description>Although I love the idea of  tyeing together the validation to the datatype (completely logically).
But I agree with Joel moss and think it would add additional overhead managing the models.
I totally love the idea Richard@Home mentioned about generating models from a Modeling tool.  Awesome.
Ideally the information could be exported to XML including all the validation rules. THen the bake script could pull in the info and leave us out.  I think Paradigm UML has an open format type xml export.</description>
		<content:encoded><![CDATA[<p>Although I love the idea of  tyeing together the validation to the datatype (completely logically).<br />
But I agree with Joel moss and think it would add additional overhead managing the models.<br />
I totally love the idea Richard@Home mentioned about generating models from a Modeling tool.  Awesome.<br />
Ideally the information could be exported to XML including all the validation rules. THen the bake script could pull in the info and leave us out.  I think Paradigm UML has an open format type xml export.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SIFE Ryerson With CakePHP &#124; Open Mode</title>
		<link>http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/comment-page-1/#comment-17631</link>
		<dc:creator>SIFE Ryerson With CakePHP &#124; Open Mode</dc:creator>
		<pubDate>Fri, 05 Oct 2007 17:06:47 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/#comment-17631</guid>
		<description>[...] information in the class declaration, though it does seem to be something that some Cake users are looking at. Having all the fields declared in the class made so much sense and was a convenient point when [...]</description>
		<content:encoded><![CDATA[<p>[...] information in the class declaration, though it does seem to be something that some Cake users are looking at. Having all the fields declared in the class made so much sense and was a convenient point when [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/comment-page-1/#comment-10760</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Thu, 23 Aug 2007 12:37:29 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/#comment-10760</guid>
		<description>@othman: Interesting idea (even though it is not compatible with the idea I described in this article *g*).</description>
		<content:encoded><![CDATA[<p>@othman: Interesting idea (even though it is not compatible with the idea I described in this article *g*).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: othman ouahbi</title>
		<link>http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/comment-page-1/#comment-10750</link>
		<dc:creator>othman ouahbi</dc:creator>
		<pubDate>Wed, 22 Aug 2007 02:01:12 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/#comment-10750</guid>
		<description>what would be good ( altho a bit off topic ) is to have something like:
var $validate = array(&#039;field1&#039;=&gt;&#039;auto&#039;,&#039;field2&#039;=&gt;&#039;auto&#039;);
or even
var $validate = &#039;auto&#039;; // all
cake reads the validation rules from the db ( type, length, etc ) would add to productivity a little more
the less you write, the better it is.</description>
		<content:encoded><![CDATA[<p>what would be good ( altho a bit off topic ) is to have something like:<br />
var $validate = array(&#8216;field1&#8242;=&gt;&#8217;auto&#8217;,'field2&#8242;=&gt;&#8217;auto&#8217;);<br />
or even<br />
var $validate = &#8216;auto&#8217;; // all<br />
cake reads the validation rules from the db ( type, length, etc ) would add to productivity a little more<br />
the less you write, the better it is.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cakebaker</title>
		<link>http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/comment-page-1/#comment-10620</link>
		<dc:creator>cakebaker</dc:creator>
		<pubDate>Sat, 11 Aug 2007 09:26:54 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/#comment-10620</guid>
		<description>@Richard, mbastien: Thanks for your comments.

@Richard: Well, I think it depends on the approach you use whether this idea makes sense. 

If you work on the table level with a tool like DBDesigner, it is more logical to built first the tables and then the models (maybe a tool like &lt;a href=&quot;http://www.cirello.org/dbdesigner2cake/&quot; rel=&quot;nofollow&quot;&gt;dbdesigner4cake&lt;/a&gt; will help in this process). 

But if you work on an object level with an UML tool, this order swaps, it is now more logical to create the models first and then to generate the tables. With that you no longer have to deal with details like foreign keys, it is automatically done for you.

@mbastien: Yes, I agree with you. Currently I am using an Ant script to execute the SQL script so that I don&#039;t have to leave my IDE (eclipse).</description>
		<content:encoded><![CDATA[<p>@Richard, mbastien: Thanks for your comments.</p>
<p>@Richard: Well, I think it depends on the approach you use whether this idea makes sense. </p>
<p>If you work on the table level with a tool like DBDesigner, it is more logical to built first the tables and then the models (maybe a tool like <a href="http://www.cirello.org/dbdesigner2cake/" rel="nofollow">dbdesigner4cake</a> will help in this process). </p>
<p>But if you work on an object level with an UML tool, this order swaps, it is now more logical to create the models first and then to generate the tables. With that you no longer have to deal with details like foreign keys, it is automatically done for you.</p>
<p>@mbastien: Yes, I agree with you. Currently I am using an Ant script to execute the SQL script so that I don&#8217;t have to leave my IDE (eclipse).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mbastien</title>
		<link>http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/comment-page-1/#comment-10610</link>
		<dc:creator>mbastien</dc:creator>
		<pubDate>Sat, 11 Aug 2007 03:59:23 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/#comment-10610</guid>
		<description>Having started with Django and learning CakePHP in my experience having the table definitions a part of the model is another tool that really does speed up productivity quite a bit.  I&#039;d also like being to work solely with all my cake files and less through phpmyadmin on my projects.</description>
		<content:encoded><![CDATA[<p>Having started with Django and learning CakePHP in my experience having the table definitions a part of the model is another tool that really does speed up productivity quite a bit.  I&#8217;d also like being to work solely with all my cake files and less through phpmyadmin on my projects.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard@Home</title>
		<link>http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/comment-page-1/#comment-10580</link>
		<dc:creator>Richard@Home</dc:creator>
		<pubDate>Thu, 09 Aug 2007 15:29:39 +0000</pubDate>
		<guid isPermaLink="false">http://cakebaker.42dh.com/2007/08/04/should-the-table-definition-be-in-the-model/#comment-10580</guid>
		<description>I think it&#039;s a great idea, only *backwards*!

It would make more sense to me if you could create your schema in a dedicated tool (DB Designer for example), and then auto-create your model from that.

DB Designer also has the advantage of being able to update the schema without destroying existing data (as far as it can).

I toyed with the idea of creating a tool that would do this back when I started out with Cake.</description>
		<content:encoded><![CDATA[<p>I think it&#8217;s a great idea, only *backwards*!</p>
<p>It would make more sense to me if you could create your schema in a dedicated tool (DB Designer for example), and then auto-create your model from that.</p>
<p>DB Designer also has the advantage of being able to update the schema without destroying existing data (as far as it can).</p>
<p>I toyed with the idea of creating a tool that would do this back when I started out with Cake.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
