什么是脚手架? 它是特定平台的术语吗?
脚手架,是什么? 这是仅限 Rails 的东西吗?
Scaffolding, what is it? Is it a Rails-only thing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
脚手架,是什么? 这是仅限 Rails 的东西吗?
Scaffolding, what is it? Is it a Rails-only thing?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(11)
它不是一个唯一的 Rails 术语,尽管我认为它起源于那里(至少这是我第一次听到它的地方)。
脚手架是一个框架,允许您使用很少的代码或不需要代码对数据库执行基本的 CRUD 操作。 一般来说,然后您会按照您想要替换脚手架的方式检查并添加代码来管理数据。 它通常只是为了让您快速启动并运行。
It is not a rails only term although I think it originated there (at least that is where I first heard it.)
Scaffolding is a framework that allows you to do basic CRUD operations against your database with little or no code. Generally, you then go through and add the code to manage the data the way you want replacing the scaffolding. It is generally only intended to get you up and running quickly.
它从程序员几乎在每个项目中使用的一些预定义代码创建基本布局,例如:对于数据库数据访问,它可以创建用于创建、读取、更新的 CRUD 方法,删除操作
或者您可以使用它为您的视图/Html 代码创建布局
it creates a basic layout from some predefined code which programmers uses in almost every project , Eg: for database data access it can make a crud method for create, read, update, delete operations
OR you might use it to create layout for your View/Html Code
脚手架正在编写任何不属于业务逻辑但有助于单元测试和集成测试的代码。
这是一个软件工程术语,不受任何框架或编程语言的约束。
Scaffolding is writing any piece of code that would not be part of the business logic but would help in unit testing and integration testing.
This is a software engineering term and not bound to any framework or programming language.
不,脚手架不是特定平台的术语,但是许多人在 Ruby on Rails 或 .NET 上下文中都知道这个术语。
还有很多执行 javascript 脚手架的工具:
这些工具也是称为代码生成器
No, scaffolding is not the term for the specific platform, however many know this term in the context of Ruby on Rails or .NET
There are also plenty of tools that perform javascript scaffolding:
Those tools are also known as code-generators
脚手架是当您不想创建结构的所有部分(例如模型、视图等)并希望一次性生成它们时使用的术语。 很多框架都使用这种技术,我在做 odoo 时研究了它,但给出的大多数参考文献都是 ruby on Rails :)
Scaffolding is the term used when you don't want to create all parts of the structure such as models, views, etc. and want to generate them all in one go. A lot of frameworks use this technique, I studied about it while doing odoo but most of the references given were to ruby on rails :)
脚手架不是特定于平台的。 通俗地说,脚手架工具为新应用程序提供了开箱即用的结构。 通常,使用这样的工具可以更快地获得工作原型。 脚手架工具非常适合新项目,并且可以防止开发人员预先编写大量样板代码。
开源脚手架工具有很多选择。 一个示例是 Hatchify。 如果您有架构,则可以将其放入 Hatchify 中,并在几分钟内构建一个简单的应用程序。
Scaffolding is not platform-specific. In layman's terms, a scaffolding tool provides an out-of-the-box structure for a new application. Typically, using a tool like this will get you a working prototype sooner. Scaffolding tools are great for new projects and prevent developers from having to write a lot of boilerplate code upfront.
There are a lot of options for open source scaffold tools. An example is Hatchify. If you have your schema, you can drop it into Hatchify and have a simple app built in minutes.
脚手架通常是指快速设置应用程序的骨架。 它不仅仅是 Rails,因为其他平台也有它。 它通常也不意味着是一个“最终”系统; 只是第一个、最小的方法。
Scaffolding generally refers to a quickly set up skeleton for an app. It's not rails-only since other platforms have it as well. It's also not generally meant to be a "final" system; merely the first, smallest way to do it.
来自维基百科:
From Wikipedia:
就像建筑工地上真正的脚手架一样,
脚手架
为您提供您的项目的某种(快速、简化、临时)结构,您可以依赖它构建真实项目。它可以(并且现在)用于描述许多事物 - 从抽象数据库层到 Web 应用程序文件夹结构,以及生成和管理项目依赖项。
它不特定于任何语言/技术,就像术语
骨架
或样板
与平台无关一样。它只是从 真正的脚手架(如上所述)。
您构建一些快速、简化的(有时是外部的,有时是临时的)结构,它将帮助您在该临时结构的下方、上方、内部或外部构建真实的、更复杂的最终结构。
.. 就像真正的脚手架一样,脚手架结构旨在支持项目的构建过程,而不是项目本身(有一些例外)。
Just like a real scaffolding in a building construction site,
scaffolding
gives you some kind of a (fast, simplified, temporary) structure for your project, on which you can rely to build the real project.It can be (and is today) used to describe many things - from abstracting DB layers, to web apps folder structures, and to generating and managing project dependencies .
It is not something that is specific to any language / technology, just like the term
skeleton
orboilerplate
is platform agnostic.It is just a term borrowed from real scaffolding (like mentioned above).
You build some fast, simplified, (sometimes external, sometimes temporary) structure that will help you to build the real, more complex, finalized structure under, above, inside or outside of that temporary structure .
.. And just like the real scaffolding, the scaffolding structure is meant to support the building process of the project, rather than the project itself (with some exceptions).
脚手架通常是某种类型的代码生成,您将其指向数据库,该技术创建基本的 CRUD(创建、读取、更新、删除)屏幕。
Scafolding is usually some type of code generation where you point it at a database, and the technology creates basic CRUD (create, read, update, delete) screens.
我相信维基百科和这里的一些答案提供了狭隘和受限的观点。 脚手架不仅仅适用于数据库之上的 CRUD 操作。 脚手架有一个更广泛的目标,即为您提供适用于任何类型技术的骨架应用程序。
Yeoman 是一个现代且有用的脚手架工具。 用他们自己的话来说:
就是这样。 使用脚手架创建快速启动应用程序,作为示例或解决方案的基础。 它可以让你从头开始构建东西,从而更快地提高工作效率。
I believe that Wikipedia and some answers here provides a narrow and restricted view. Scaffolding is not just for CRUD operations on top of a database. Scaffolding has a broader objective to give you a skeleton app for any kind of technology.
Yeoman is a modern and useful tool for scaffolding. Using their own words:
That's it. Use scaffolding to create a quick-start application to work as an example or the foundation of your solution. It makes you productive faster them building things from scratch.