简体   繁体   中英

Is this a good idea to use Yii Framework with Doctrine 2 ORM?

I love Yii Framework, it works fast, it's pretty cool and easy to develop with. But now I have a problem - I am going to develop Learning Managment System with difficult domain logic and it's not good for me to use Active Record from Yii for my models, it would be better to separate mapping and domain logic.

So I decided to use Doctrine 2 ORM. It's pretty cool too, I liked it when previously I worked with it. But I think it's enough big for not so big Yii Framework.

the main problems are

1) I need some kind of ORM for separate domain logic and mapping. Are there any alternatives for Doctrine 2 ORM?

2) I need good framework to work with this ORM. Is Yii well-suited to use it with Doctrine 2 ORM? Will it lose its benefits when I will use such big and not so fast ORM as Doctrine 2? Maybe it would be better to use Symfony 2 framework to work with Doctrine 2 ORM because they are natively in couple

Thanks

RedBeanPHP is an easy to use open source object relational mapping (ORM) software for Yii framework. Created by Gabor de Mooij in the Netherlands, it is licensed under GPL and New BSD.

RedBeanPHP is used as the database abstraction layer for your Application.

Learn more about RedBeanPHP here: http://www.redbeanphp.com

如果您有复杂的域模型(不仅仅是CRUD),Doctrine2很好,而且它是框架无效的,因此您可以将它与yii2一起使用并仅将Yii2用于传递机制(Web,控制台或其他),只需注意您必须创建数据提供者就像那些预先存在于yii(可能是RepositoryDataProvider或QueryObjectDataProvider)中的那些,但我认为使用一个大的ORM来读取数据特别是报告(网格,列表图表等)不是一个好主意所以我可以使用doctrine进行编写(当域名时)逻辑被应用)和Yii2 Dbal用于阅读,因为Yii2数据库基础设施非常快

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM