English 中文(简体)
Bean in ATG
原标题:What is the purpose of Dynamic Bean in ATG
  • 时间:2011-09-30 13:12:54
  •  标签:
  • java
  • atg

I ve read documentation, but there is no definition of the main purpose of Dynamic Bean. I understand how to implement this but dont know why this approach so good.

So could someone tell the situation when it s good to use Dynamic Bean?

增 编

最佳回答

活跃的豆类通常允许你获得和确定可能不是明确成员的领域。 最直接的比较是地图——地图使你能够进入和确定田地而不事先界定。 然而,一个大豆符合标准java idioms(植被/set)。

Unlike a hashmap, however, dyanbeans can enforce constraints more readily (and they hide the underlying data structure implementation, so they can be lazy, or make data connections when being set, etc... ) . For example, you can easily add a getter or setter to your dynabean that is explicit, and the code would read very idiomatically and cleanly interact with other bean apis.

public int getCost()
{ 
    if(this.get("cost")==null)
     return -1;
    return Integer.parseInt(super.get("cost"));
}
问题回答

专题小组中活跃的豆类最有用的部分是,为已经覆盖的那类人提供额外的动态技术应用课程。 首先,请注意,您可以采用动态贝ans(物体、财产、价值)和动态贝ans(植物、财产)静态方法,在不一定与 Java属性相对应的物体上确定或获取财产。 如果你重新使用用活豆登记的单质子,那么它就试图违约使用 Java豆。 箱子中提供了支持,以便与存放项目(财产与存放项目财产相对应;还适用于简况物体,自然是)、DynamoHttpServletRequest(与保留参数相对应)、地图/字典(与钥匙相对应)和DOM Node物体(对应的是Node的采集器/造物)。

为了增加这方面的课程,你需要设立扩大动态技术应用的班级。 例如,假定你想要使HttpSession物体同样使用属性,与HttpSession的采集器和构造相背。 然后,如果你没有习惯的BeanInfo或动态BeanInfo课程,就可以方便地使用动态贝南语。

一旦有了活力,你就可以向有活力的百慕大人登记。 通常,这种做法会进入一个静态的初始阶段,供你重新撰写财产图人时使用。 然而,如果你将另一类财产图绘制在你控制之外(如HttpSession),你就希望提供一种全球范围通用服务,简单地将登记方法称作其专业服务。 然后,你可以把这一服务补充到你的最初服务中。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签