12

There are lots of web application frameworks available these days, for pretty much every language out there. In your experience, what are their strengths, weaknesses, and unique features? Assuming the luxury of choice, what factors would lead you to consider one over another other?

I'm most interested in people's direct experience with one or more frameworks, rather than an exhaustive comparison of everything out there. Hopefully the SO community has programmers who have good and bad experiences with things like Rails, ASP.NET, Django, TurboGears, or JSF. It would also be great to hear if anyone is using one of the less mainstream frameworks like Seaside or Weblocks.

Programming language is an obvious difference, but a Java vs Ruby flamewar won't be much fun, and most of these frameworks seem to be at least as much an investment in technology, tools and complexity as their language of choice; so I'm more interested in things like:

  • Development speed and convenience
  • Barriers to entry - both in terms of developer training, and of infrastructure needed
  • Lock-in - how much code could you keep if you had to switch frameworks?
  • Flexibility - does the framework dictate your architecture or design? (Whether that would be a good or bad thing is probably best left to a separate discussion.)
  • Performance, scalability, and stability - obviously depending on the developers!
4

3 回答 3

10

I am going to briefly address each area for three popular Python frameworks. This is only based on my personal experiences and observations.

Development speed and convenience

For TurboGears, Pylons, and Django, development speed is roughly equal. Being modern frameworks, it's easy to get started on a new site and start throwing together pages. Python is famously fast to develop and debug and I would put any Python framework as having a shorter development time than any other setup I've worked with (including PHP, Perl, Embedded Perl, and C#/ASP.Net).

Barriers to entry - developer training and infrastructure

If you know Python and are willing to watch a 20 minute video tutorial, you can create a fairly complete wiki-type site from scratch. Or you can walk through a social-bookmarking site tutorial in 30 minutes (including installation). These are TurboGears examples but the other two frameworks have nearly identical tutorials as well.

The test/development infrastructure that comes out of the box with these frameworks is generally enough to complete most sites. At any point, you can swap out components to meet your production environment requirements. For example, SQLite is fine for setting up your models and loading test data, but you will want to install MySQL (for example) before going live or storing large amounts of data.

In all cases, the requirements are very low and dictated entirely by your scalability requirements and not any peculiarities of the framework. If you are comfortable with a certain template language or ORM, it will probably plug right in.

Lock-in

This is a generalized problem across all frameworks. When you select a language, you limit your code-reuse options. When you select a templater, you are again locked in (although that's easier to change, in general, than other things). The same goes for your ORM, database, and so on. There is nothing these frameworks do specifically that will help or hinder lock-in.

Flexibility

It's all about MVC with these three frameworks. As you said, that's a very different discussion!

Performance, scalability, and stability

Well, if you write good code, your site will perform well! Again, this is a problem across all frameworks addressed by different development techniques and is probably way outside the scope of this answer.

于 2008-09-27T01:02:48.480 回答
5

Django vs Struts.

Development speed and convenience.

Django - up and running in the time required to build the model (in Python), define the Admin mappings (2-3 lines of code per model class) and create HTML templates to work with the default master-detail views.

Struts - have to define a database in SQL, then define ORM mappings in iBatis. Then define, test and build various application components, using action classes and JSP template pages. Oh, and I need to define EJB's to move data from application to JSP's. It's all got to compile and I've got to work through numerous details just to get something that fits the compile rules.

Barriers to entry - both in terms of developer training, and of infrastructure needed

Constant across all frameworks and languages. This is pretty much a don't care item. No language or framework is inherently easy to train. All web frameworks have similar infrastructure requirements.

Lock-in - how much code could you keep if you had to switch frameworks?

This doesn't make a lot of sense. If you switch from Tomcat to any of the Tomcat derivatives, you can preserve a lot of Java code. Otherwise, you generally don't preserve much code when you switch framework.

Flexibility - does the framework dictate your architecture or design? (Whether that would be a good or bad thing is probably best left to a separate discussion.)

Actually, that's not a separate discussion. That's the point. Frameworks dictate your architecture -- and that's a good thing. Indeed, the framework is code you don't have to write, test, debug or support. It's a good thing that your application is confined by the framework to a proven, workable structure.

Performance, scalability, and stability - obviously depending on the developers!

Performance is language (not framework). It's design. To an extent, its also implementation configuration.

Scalability is framework (not language). It's design and configuration.

Stability is across the board: OS, language, framework, design, programming, QA and implementation configuration.

于 2008-09-27T01:46:29.530 回答
1

This is an incredibly subjective question.. and that's a tag you ought to add to your question. As several comments have already suggested, you've already specified a pretty good guide; what are you actually asking? There's a billion opinions about this sort of thing and definitely no right answer!

Personally, I started using .html, moved onto php, tried ruby (hated it), discovered Python / DJango.. and have been happy ever since. That's a very unique path to take though (probably) so your mileage may vary :)

于 2008-09-27T00:13:19.533 回答