运行时间与设计时间

发布于 2024-08-28 04:27:35 字数 57 浏览 5 评论 0原文

我在某处读到有人可以在运行时访问配置值,但不能在设计时访问。在这种情况下,运行时和设计时有什么区别?

I read somewhere that somebody could access a config value during run time but not during design time. Whats the difference between run time and design time in this context?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

听,心雨的声音 2024-09-04 04:27:35

设计时间是当有人在我们的 Word 文档和 UML 图上签字时兴高采烈地“看起来不错!”运行时是指当我们执行代码时,它会因可怕的崩溃和烧毁而失败。

TDD 这样的技术的优点是它压缩了设计时间和运行时间之间的差距以至于它们是同一件事。这意味着我们可以立即获得关于我们的设计在转化为代码时实际工作方式的反馈,这应该会在我们的代码上线时带来更好的设计并减少尴尬。 YMMV。

Design time is when somebody signs off our word documents and our UML diagrams with a cheery "That looks fine!" Run time is when we execute our code and it fails with a horrible crash and burn.

The advantage of a technique like TDD is that it compresses the gap between design time and run time to the point where they are the same thing. This means we get instant feedback on how our design actually works when translated into code, which should result in a better design and fewer embarrassments when our code goes live. YMMV.

痴情换悲伤 2024-09-04 04:27:35

设计时间是指根据需求创建设计或创建一些 UML 图的时间。

运行时是您实现设计并运行代码的时候。

Design time is when you are creating a design based on the requirements, or creating some UML diagrams.

Run time is when you are implementing your design and running the code.

狼亦尘 2024-09-04 04:27:35

您是在谈论 .NET 应用程序吗?在这种情况下,设计时间可能意味着更具体的事情 - 当您的 GUI 在 Visual Studio 设计器中呈现时。这为您提供了应用程序的工作视图,但它在设计时运行环境。许多 .NET 控件都有 DesignMode 属性它允许您判断控件是否在设计时视图中运行。

Are you talking about .NET applications? In that case design time probably means something more specific - when your GUI is presented within the Visual Studio designer. This gives you a working view of your application, but it is running in a design time environment. Many .NET controls have a DesignMode property that allows you tell whether the control is running in design time view or not.

盗梦空间 2024-09-04 04:27:35

设计时间是当你设计一些代码时

运行时间是当你执行你设计的代码时

design time is when you design some code

run time is when you execute the code you designed

私野 2024-09-04 04:27:35

运行时间是你的程序运行的时间。设计时间是指你的程序被设计出来的时候。

Run time is when your program runs. Design time is when your program is designed.

终陌 2024-09-04 04:27:35

设计时是指开发期间发生的过程,运行时是指应用程序运行时发生的过程。

例如,在应用程序中硬编码的常量是在设计时设置的,例如...

// you need to recompile your solution to change this,
// hence it is said that its value is set at design time.

const string value = "this is set at design time";

而从配置文件中提取的配置值则被认为是在运行时设置的。例如...

// You do not need to recompile your solution to change this,
// hence the value is said to be set at runtime. 

string value = ConfigurationManager.GetValue("section", "key");

Design time refers to processes that take place during development, Runtime refers to processes that take place while the application is running.

For instance, constants that are hardcoded in your application are set at design time, such as...

// you need to recompile your solution to change this,
// hence it is said that its value is set at design time.

const string value = "this is set at design time";

Whereas configuration values that are pulled from a config file would be said to be set at runtime. Such as...

// You do not need to recompile your solution to change this,
// hence the value is said to be set at runtime. 

string value = ConfigurationManager.GetValue("section", "key");
小耗子 2024-09-04 04:27:35

作为开发人员,您必须致力于设计时间(让我们将其理解为“您花在设计和开发应用程序上的时间”,尽管这有点不正确)和运行时间之间的理想平衡,这我的意思是“用户站着看着沙漏等待重要报告呈现的时间”。

过于关注“设计时间”,你可能会用完预定的编程时间,你的客户会退出合同,他会说你的坏话,小猫会死。太少了,正如他们所说,你的程序会很糟糕。请记住,“运输是一项功能,是您的程序应该具备的功能”。。

除非他们所说的“运行时”是“运行时”,而这意味着完全不同的东西。

As a developer, you must aim for the ideal equilibrium between design time (let's take it to mean 'the time you spend designing and developing the app', though it's a bit incorrect) and run time, which I take to mean 'the time the user stands looking at the hourglass waiting for his important report to be rendered'.

Too much focus on 'design time' and you might run out of the scheduled programming time, and your client will pull out of the contract, he'll badmouth you, and kittens will die. Too little, and your program will, as they say, suck. Remember that 'shipping is a feature, one your program should have'.

Unless what they meant by "run time" is "runtime" and that means something else entirely.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文