How to build n-layered web architecture with PHP?

前端 未结 2 791
执念已碎
执念已碎 2021-01-14 08:49

I\'m dealing with the 3-tier architecture PHP website.

Now I need to redesign it to suрроrt distributed n-tier architecture. After long hours of research i came to t

相关标签:
2条回答
  • 2021-01-14 09:08

    Everything you want to do is possible with Zend Framework. It follows an MVC architecture and has things like the Zend_Soap component for your services.There is no reason to build some multi-language application when you can keep it all within PHP. Why do you want to use Java so badly?

    0 讨论(0)
  • 2021-01-14 09:32

    From your description I understand the existing application runs on a LAMP stack. PHP integrates nicely into the LAMP stack and scales well with it. Why do you want to migrate this to a Java ecosystem? Reimplementing the business logic in Java means you throw away the essential working part of the existing app. If there already is a working business layer and DAL, why start from scratch again? Wouldn't refactoring be the smarter (and cheaper) alternative?

    In addition, you claim J2EE will provide much better robustness and maintainability. How so? Maintainability is mainly a matter of code architecture and coding style. I am not aware of any pattern in Fowler's PoEAA that cannot be implemented in PHP as well. PHP also provides mature frameworks for UnitTesting, Continuous Integration, ORM, Dependency Injection, Message Queues, Webservices, Deployment, etc. to support your application development.

    Sure, Java is compiled and supports multithreading and has a history in enterprise software architecture and I am not denying that it has language features PHP doesn't have. But the question is, do you need them for this project? And let's not forget that a programming language does nothing on it's own. It's the developer who creates the application and J2EE Spaghetti code is still Spaghetti Code.

    Just my 2c though :)

    0 讨论(0)
提交回复
热议问题