[TYPO3-mvc] Database structure when using ExtBase

Jochen Rau jochen.rau at typoplanet.de
Wed May 27 12:20:01 CEST 2009


Hi Sebastian,

On 2009-05-27 11:42:07 +0200, Sebastian Gebhard 
<s.gebhard at markenmotiv.de> said:

> I was taking a look at the ext_tables.sql of blog_example.
> 
> Tables defined there are:
> 
> tx_blogexample_domain_model_blog
> tx_blogexample_domain_model_post
> tx_blogexample_domain_model_comment
> tx_blogexample_domain_model_tag
> tx_blogexample_post_tag_mm
> 
> 1. Do I get it right that every table that's NOT a mm-relation table 
> has to/should include "domain_model"?

It's the other way around. Every relation table must follow the naming 
convention

tx_{extensionname (lowercase)}_{last part of left table}_{last part of 
right table}_mm

Tables which correspond to a extension class must follow the naming convention

tx_{extensionname (lowercase)}_{1st levelsubfolder inside 
"Classes"}_{1nd level subfolder inside "Classes"}_{...}_{last part of 
the class name (lowercase}

> Blog has a property posts

o.k.

> Post has the properties blog_uid and blog_table

That is a back-reference we hopefully get rid of.

> 2. Are bidirectional relationships needed/recommended?

It depends on the use case. Don't implement bidirectional navigation if 
you don't need it.

> 3. Why does blog_table exist?

It's for compatibility reasons.

> 3 fields/properties for one 1:n relationship seems unneccessary complex to me..

3 fields are o.k. (because this is hidden from the Domain Model). 3 
properties is too complex. We plan to have a property Blogs inside Post 
holding references to the Blog objects (like FLOW3 already does).

Regards
Jochen

-- 
"Every nit picked is a bug fixed"



More information about the TYPO3-project-typo3v4mvc mailing list