一个大学的 friend 正在使用 Tapestry 框架学习网络编程,他问我是否可以帮他做功课。 作业中有一题说:
What is expansion, and how do we use it?
第一次听说。
你知道那个话题是关于什么的吗?
我有点迷茫。有没有同名的 OOP 原则?
最佳答案
根据 this tutorial它基本上是字符串插值。
First is the way we display the current date and time: ${currentTime}. This syntax is used to access a property of the page object, a property named currentTime. Tapestry calls this an expansion. The value inside the braces is the name of a standard JavaBeans property supplied by the page. As we'll see in later chapters, this is just the tip of the iceberg for what is possible using expansions.
这不是 OO 术语 - 它是 Tapestry 的一部分。
关于java - 什么是扩展,我们如何使用它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6348376/