How to develop a MVC framework from scratch? [clos

2019-04-15 02:51发布

View is easy to be separated from MC,

but how to separate M and C?The difference seems a little vague to me.

I'm using PHP.

9条回答
该账号已被封号
2楼-- · 2019-04-15 03:34

There's a lot to be said about letting the infinite army of monkeys (like all of us) maintain code that really grabs their attention, and then leveraging that in your own work instead of completely re-inventing the wheel. If you DO decide to create your own MVC framework, I'd encourage you to integrate specialist projects (e.g. an ORM-layer, or templating engine, etc.) that are being developed by people who TRULY LOVE those projects because the result will probably be stronger pieces within your whole, which will ultimately make your framework more successful.

If you look at the MVC's that have been mentioned here (e.g. Zope, Cake, etc.) they all started around roughly the same time when there were no MVC's for PHP, and you see that they all have their own strengths and weaknesses because the developers who created them don't have an equal passion for all facets of their framework.

I say, we're standing on the shoulders of giants anyways, we might as well admit it, incorporate their work into ours, and be honest with ourselves and the world.

-C

查看更多
淡お忘
3楼-- · 2019-04-15 03:39

Here is the step-by-step guide to developing a MVC framework using PHP:

http://phpro.org/tutorials/Model-View-Controller-MVC.html

Really easy, good tutorial.

查看更多
地球回转人心会变
4楼-- · 2019-04-15 03:43

M (Model) = Business Logic

C (Controller) = Application Logic

查看更多
登录 后发表回答