普通网友 2009-11-27 05:50
浏览 20
已采纳

以程序方式编写一个相当大的,以数据库为中心的PHP应用程序而没有MVC是否合理?

Sorry for the rather subjective question, but I was hoping to get an opinion from someone more experienced than myself on this.

I'm pretty far into an ajax-driven PHP application and, while I have pretty good separation between markup and behavior on the client side, my PHP is slowly becoming a bit of a mess. I'm doing alright so far breaking it up into parts and structuring in a way that I don't have too much repetition, but I'm definitely beginning to see how this can become a burden with enough code. So I've been reading about OOP and MVC and now I'm trying to decide whether it's worth refactoring for CodeIgniter or Kohana. Intuitively, it feels like this would be more work than it's worth, but I know I may be singing a different tune in a little while.

In your experience, is it considered absolutely hackish to write a serious application procedurally today, or are there certain kinds of applications that lend themselves better to procedural/structural programming.

  • 写回答

2条回答 默认 最新

  • doujiao4710 2009-11-27 05:54
    关注

    MVC and OOP are just "ways", amongst others. Yes, they are great, facilitate good struturation of code, and are used a lot, but they are not the only way you can develop an application.

    For instance, Drupal is not using any kind of Object-Oriented code : it's all procedural... And it's a big application, that has lots of success, is used by many people, even on big sites, and for which many people have developped lots of modules... even if it almost doesn't use any class/object !

    I, personnaly, would go with MVC and/or OOP for almost any kind of new application ; just because I know those and they are helpful -- but those are not required when it comes to developping a great application : they help, but you can still have some crappy code if you don't behave when programming ^^

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据