可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I am looking to start a new project and I am trying to decide which framework to go with. I have been using ASP.Net for a while and enjoy it. My first introduction to web applications was with PHP and I still love it. The project should be a medium sized project maintained by 1 or 2 developers with a potential to grow. The only pros and cons are can think of are as follows:
ASP.Net MVC
Pros
- Big community support and increasing
- Seems to be fully featured
Cons
- Getting a dedicated server will be expensive.
- A licensed version of SQL Server will be expensive
Zend Framework Pros
- Also a fairly large community
- Free, using the typical LAMP setup
Cons
- Not as mainstream
- Might contain possible limitations
Lastly, I have enjoyed working with ASP.Net's concept of Master pages. Does ASP.Net MVC still support this and does Zend Framework have something similar. I think that Zend offers something called templating and it looks close to Master pages.
What is your opinion?
回答1:
I think ZF has more going for it based on your requirements. The cons you've listed against ZF are rather subjective, but the cost of ASP.NET is definite.
There's definitely a rich community working on Zend Framework and its 1.0 release came well over a year ago, so it's stable and reliable.
Zend Framework supports a two step view, where a view template is rendered inside a layout template. I think this satisfies your need for master pages.
It seems you have equal love for PHP and ASP. If I was making the decision, I'd work with whatever I'm most confident using, or which would be most relevant for the future.
回答2:
I've tried both Zend Framework and ASP.NET MVC, and my impression is that ASP.NET MVC is the easiest to develop with. ZF takes a lot of time to learn and it also takes too much time (in my opinon) to set up. ZF also limits you in many cases, making you build large workarounds for things that ought to be implemented by default in the framework. Many of the libraries ZF offers are also made for very specific use cases, and are difficult to customize.
With ASP you can have an application up and running in no time. Any changes you want to make to the default setup is richly documented. You also have the advantage of a 'real' programming language like C#. The MVC pattern combined with a real programming language makes it easy to unit test, especially good if you're into test driven developement. My pros list of ASP.NET MVC is:
- Easy localization and globalization with the .NET framework
- Master Pages is much easier to use and more flexible than the layout model in ZF
- You get all the good things from ASP.NET like SiteMap and the like
- Linq
- Microsoft Entity Framework / NHibernate / Spring.NET
About the cost of the server and the SQLServer, many hosting companies provide dedicated servers at fairly decent prices.
回答3:
Just passing through and saw this. As someone who's used ASP.Net for a couple of years and Zend Framework for a couple of years (PHP itself for many years and ASP.Net MVC briefly) I would definitely choose PHP and ZF. I have found the exact opposite and don't see how anyone could find anything in ASP.Net to be more flexible. I think what most people mean by "flexible" is that the IDE does alot of code completion or the framework scaffolds everything for them. The later is the exact opposite of flexible. To be honest ZF may be overly flexible. This is why the documentation while extensive doesn't seem to cover everything. Re-usability with ZF for my projects has been off the charts. Its definitely been better than plain ASP.Net.
You're probably going to find the same features in both as most are standard for an MVC framework and probably more in ZF. The Zend_Db library works alot like LINQ and any dynamicaly typed language will win out on DB access (hence the reason .Net had to add it for LINQ). ZF has a built-in URL routing system as well...nothing amazing there about .Net MVC. Master pages is handled by the layout system in ZF and to be honest you could have been doing master pages with raw PHP years ago. I don't know where comments about a "real" language would come from...PHP and ZF projects are capable of being unit tested. I do it all the time. If your roots aren't in C/C++ then usually a "real" language means it forces you to write OO code. Given any other option you won't because you don't know how to enforce it yourself.
In conclusion check out the features in both for yourself. From years of watching it happen firsthand I can tell you the .Net crowd will tell you about all sorts of "exclusive" .Net features that stem from a lack of actually having decent knowledge of other technologies and frameworks. The truth is that most if not all of the features are available on other platforms...many being older than the .Net implementations.
回答4:
I have been .Net (C#, VB.Net, Asp.Net) developer for the past 8 years and developed a few web apps. For my most recent project, I had to dust off my PHP skills. The customer preferred a fully open source platform. I have decided for PHP + Zend Framework + mySql on Linux server. The learning curve is steep at the beginning, but once you pick up the skills, you will get very fast and productive.
回答5:
If you are worried about the license costs, then perhaps you should use another database?
PostgreSQL and mySQL is often sufficient.
回答6:
Yes you can have master pages for your views in ASP.NET MVC Framework as well, it works pretty much the same as in Webforms.
回答7:
If you are planning to do business, take a look at Microsoft's Empower and BizSpark programs. They can help you with the licensing costs until your business can stand on its feet.
回答8:
i dont understand why people listing cons in .NET that MSSQL is expensive .NET have MYSQL API that supports MYSQL and other Databases.
回答9:
The dedicated server MIGHT cost $10 more for a Windows platform. Might. And you can get good deals for hosting with MSSQL Server as well. And will you need a dedicated server to begin with? Good luck with the project though!
回答10:
I am working on .net for 3 years.
.net framework has some cons such as expensive cost of database and host.
But you can use ms sql express which has a free license.
The problem with .net is: It doesn't have an active community like php,
which is so important!
For years I had this problem whenever I needed a component, I had to search a lot
for a free version of a component. However in php everything is free!
But in general I think developing software in .net is faster and easier because when you are
coding and designing, this is VS that is doing most of things for you.
And especially coding in .net keep you away from most of details because it has a very nice abstraction.
回答11:
I work with both professionally and creating enterprise level applications. Both approaches are completely valid, supported, documented, and well implemented with a skilled developer.
What is nice with .NET in general is the fact that you have a comprehensive end to end solution. From Visual Studio to IIS to SQL Server and ever where in between, it's all created by one company to work seamlessly together. You also have some pretty outstanding performance from a compiled language and a massive framework that's integrated into the entire delivery system.
PHP is a language with a bad rep from what seems to be a large number of poor developers. It's a huge community with developers of vastly different skill levels. It also doesn't help that it's a fairly misdirected community with more forks in design patters than your kitchen drawer. Many different frameworks, many different cms, and some are really bloated and slow. Zend Framework is certainly enterprise worthy, and I've enjoyed programming with it. ZF2 is now out, which seems to catch it up closer to the more progressive competitors in the OS arena, like rails and Django, although scaffolding still appears to be a blatant MIA feature (although available in Yii) for those that dont want to really develop, but just rapidly automagically create CRUD functionality.
All in all, you can develop great sites with both. I think C#.NET MVC with Razor will be a great option if you're want to learn "the right way" to do things and you dont have experience in MVC and writing DRY code. However, if you are an experienced developer and know what you're doing, you can do the same in PHP (which lets bad programmers get away with absolutely horrific code successfully).
回答12:
According to my experience, ZF is not hard to learn, especially if you understand MVC/ROR. CakePHP is more similar with ROR, but it is only suitable for small web sites.
You may wanna to take a look at "A Basic Quick Starter for ZF New Guys": http://blog.sunnyboy.me/2013/05/20/14848/
回答13:
At first, i recommend not to use PHP but a better language, Python for example. You code less, faster, more stable and with less maintenance issues. I'm currently using the Pylons-Framework and am very happy with it.
Anyway, if you want to stay with PHP, it depends on how flexible you want to be, means, how much the framework shall do for you.
Recently I ran into a bundle of problems using CodeIgniter, which is a fast and leightweight framework that does, ehm, not much for you but only the "frame". There is a fork named "Kohana" which is besser concerning the licensing, but poorly documented.
Zend ist very powerful but complicated - what what is more an PHP- than a Zend-Problem though.
Symfony is also powerful and complete. It's totally derived from Ruby on Rails, and I never had a PHP-Project where i used all the Symfony-features. It has a really nice scaffolding.
From all PHP-Frameworks i tried, I liked CakePHP most. It seems like a middle-way between complexity and an easy-to-use approach.
All serious PHP-Frameworks support standard-applications like templating, modeling and caching.
回答14:
As a developer I think it is more abt asp.net and php. I know asp.net more than php, so I will suggest asp.net. Also you can't have power of linq with php,which is a very big advantage.
Zend has been here from some time, Asp.net MVC is still new. What I have seen is that alot developers are more comfortable with traditional methods than MVC.
MS has open sourced MVC, so its community will grow for sure.
回答15:
* Getting a dedicated server will be expensive.
what do you mean by dedicated server? You have to host any website whether you use ASP.NET MVC or PHP+Zend framework.
* A licensed version of SQL Server will be expensive
Depending on the size of your database, you can use free version sql express from Microsoft or MYSQL. ASP.NET MVC works with any database under the hood.
Besides I do not like the way you have to use the whole '_' thing to mean Zend/File as Zend_File. Whats up with that? ASP.NET MVC is well crafted, and is open source, and has an integrated url routing system built.
回答16:
i am also deciding between the 2 + Ruby on Rails ...
i am using Zend Framework 1.8.2 and like it (started abt ~3 mths ago). its learning curve is steep. but i now quite like it. apart from MVC it has Zend_Forms with allows me to even separate the "input" logic and validation with is nice.
templating is achieved through Zend_Layouts and Zend_View. i dunno how to change layouts yet (now i have the whole site using the same layout ...) but i think its possible.
but after Zend Framework for a while i know is hard and now is exploring if theres any better frameworks .. so ASP.NET MVC and Ruby on Rails
1st impression on ASP.NET MVC is ok maybe need to know how they do forms and validation. apart from that ... i feel LINQ is GREAT!
for Ruby on Rails i like the auto generation of Models and Forms at the same time. speed things up alot but need to know whether customization of these auto generated forms will be easy. watched a screencast at the official site and incorporating AJAX seems easy .
回答17:
If you're going for PHP I would try another framework, I didn't like Zend framework very much.
Why not try CakePHP maybe?
There are a lots of PHP-MVC frameworks better than Zend.
Check this http://www.mustap.com/phpzone_post_73_top-10-php-mvc-frameworks
回答18:
Choose Symfony and use ZF components inside it :) Sf has awesome documentation to read, rich community + features. Sf just embeds many open source tools well inside it like Twig, Doctrine, Unit Testing, Asset optimization tools (Uglify JS, YUI compressor), Swiftmailer, Monolog ...