开发者

Zf - How to pass from "one class per table" to "several tables per classes"?

开发者 https://www.devze.com 2023-02-28 21:17 出处:网络
This is a general question, and I\'m sorry for that. Let\'s say we have this application that as a class per table, so time arrives and we then need to work with data separate between several tables

This is a general question, and I'm sorry for that.

Let's say we have this application that as a class per table, so time arrives and we then need to work with data separate between several tables on our database.

What options do we have here ?

We can:

a) Rely on a ORM (like Doctrine);

b) Create Mappers

c) Create models that represent the joins o开发者_开发技巧r the m:n relation tables.

d) Create database views and have zend to work as if there where a table.

Are those correct? If so what other methods exist? I don't intend to start a debate of this but, I'm starting developing here, and I would like to understand what are the common approaches to deal with this things inside Zend Framework.

Thanks in advance


(a), (b), and (c) all sound good to me. I personally have used (a) and (c). I know little about (d), but my gut instinct is against as I have not seen it very widely described/recommended as a solution. YMMV.

0

精彩评论

暂无评论...
验证码 换一张
取 消