微框架是否适用于大型代码库?
我询问 Flask、Bottle 和expressjs 等微框架的寿命。优点:小、快速、易于管理。
随着代码复杂性和用户群的增长,它们是否打算被替换?还问:它们应该被 Django 或 Pyramid 这样的完整框架取代,还是微框架成为新标准?
I ask about the longevity of microframeworks like Flask, Bottle, and expressjs. Advantages: small, fast, manageable.
Are they intended to be replaced as code complexity and user base grow? Also asked: should they be replaced with a full framework like Django or Pyramid, or are microframeworks the new standard?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
嗯,这有点取决于你所说的增长是什么意思。让我们看看两种可能性:
用户增长。如果您正在构建一个具有相当固定功能的应用程序,并且希望拥有快速扩展的用户群(例如 Twitter),那么微框架可能非常适合可扩展性,因为它已经被精简为最基本的功能 + 您的应用程序代码。
功能增长。如果您的网站需要快速添加许多离散且复杂但通用的功能(论坛、消息传递、商务、迷你应用程序、插件、复杂的 API、博客),那么您可以通过使用完整的功能来节省时间。 - Django 或 Ruby on Rails 等特色框架。
基本上,从长远来看,微框架可能不适合您的应用程序的唯一原因是您是否认为您可以从即插即用功能中受益。由于功能齐全的框架比微框架更高级别,因此您经常会发现功能齐全的解决方案作为开箱即用的插件。博客、身份验证等等。使用微框架,您需要为这些事情推出自己的解决方案,但可以通过社区访问许多较低级别的功能。
Well, it kind of depends on what you mean by growth. Let's look at two possibilities:
User growth. If you're building an application with fairly fixed features which you expect to have a rapidly expanding user-base (like Twitter), then a microframework may be ideally suited for scalability since it's already stripped down to the bare essentials + your application code.
Feature growth. If you have a site which you're expecting to require rapid addition of many discrete and complex yet generic features (forums, messaging, commerce, mini-applications, plugins, complex APIs, blogs), then you may save time by using a full-featured framework like Django or Ruby on Rails.
Basically, the only reason a microframework might be unsuitable for your application in the long term is if you think you would benefit from plug-and-play functionality. Because fully-featured frameworks are higher-level than microframeworks, you'll often find fully-featured solutions as plugins right out of the box. Blogs, authentication, and so on. With microframeworks you're expected to roll your own solutions for these things, but with access to a lot of lower-level functionality through the community.
这取决于(微)框架支持什么,以及为其提供的文档数量。
例如,使用 Flask 的站点需要一个数据库来存储数据。尽管 Flask 没有内置数据库扩展,但还是有可用的扩展。
It depends on what the (micro)framework supports, as well as the amount of documentation provided for it.
For example, a site using Flask needs a database for storing data. Even though Flask does not have a database extension built in, there are extensions available for it.
如果微框架可以处理它,为什么要用其他东西替换它呢?
If the microframework can handle it why replace it with something else?