[FLOW3-general] FLOW3 Application on top of existing database
"Christian Müller (FLOW3 Team)"
christian.mueller at typo3.org
Wed Apr 25 19:53:29 CEST 2012
Hi Alex,
just a quick answer to your last question: You would want to have a
repository for each of your aggregate root objects but the repository
would always extend from our default doctrine repository and you just
need to implement special query methods so in many cases it is just an
empty class.
Cheers,
Christian
On 25/04/12 17:19, Alexander Dick wrote:
> Hi Karsten,
>
> Am 25.04.2012 11:08, schrieb Karsten Dambekalns:
>> Hi.
>>
>> On 24.04.12 10:30, Alexander Dick wrote:
>>> This existing application should be extended by another (independent)
>>> FLOW3 application. The only thing is that I have to access it's database
>>> tables and process the data - only for reading
>>
>> You create models with the properties as you need them to do the
>> processing. Then you use the "Table" and "Column" annotations provided
>> by Doctrine to map those properties to specific table and field names
>> (if needed).
>
> Alright, that sounds awesome, I think this will do it for me.
>
>>
>> For associations you can use "JoinTable" and "JoinColumn" annotations in
>> pretty much the same way.
>>
>
> Yeah :-)
>
>> For added safety you can declare your entities "ReadOnly" to make sure
>> the existing data is really never changed.
>>
>
> Thanks for the hint, this is a good idea!
>
>>> the new application has it's own persistence storage.
>>
>> Um, can you explain that? If that means you want to use two different
>> databases simultaneously, your are out of luck. Right now FLOW3 doesn't
>> do that…
>
> I was a bit unclear, sorry. Actually we could handle it with only one
> database, I just let FLOW3 create it's needed tables in the existing
> database - that's possible I suppose.
>
>>
>> You can create models as usual for the "external" data and code a
>> repository that connects directly to the existing database to read data.
>> A bit more work, but a nice way to encapsulate that workaround and later
>> easily refactor (when FLOW3 eventually supports multiple connections).
>>
>
> Can I work with a default repository? Since I will use only one database
> there will be no special "connector" needed.
>
>> Regards,
>> Karsten
>
> Thanks a lot!
>
> Best regards
> Alex
--
Christian Mueller
TYPO3 Core Team
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the FLOW3-general
mailing list