Help

Controls

PermLinkWikiLink

Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

Forum: Seam Users Forum ListTopic List
27. May 2008, 10:25 CET | Link

Hello,

correct me if I'm wrong, but as I understand from what I've read in the manual and on the forum, bijection happens every time I invoke a method on a seam bean, that is, all fields with @In/@Out are written/read by reflection, yes?

I don't know what are the experiences of other users, but in my applications I often use a pattern, where the majority of my beans are stateless beans, which have some other stateless beans injected, and occasionally a conversationally scoped bean.

However, most methods of my stateless beans use only a subset of the injected beans - depending both on the method and on user data. That's why I started to wonder, if it wouldn't be reasonable to provide a lazy option for @In - that is, a bean would be searched in the contexts when a method on it would be invoked for the first time.

There's also another problem, when invoking methods on seam beans when rendering a page, for example in a loop:

<ui:repeat var="x" value="#{list}">
   #{myBean.myMethod(x)}
</ui:repeat>

Again, if I didn't miss something, bijection will happen every time myMethod is called, which in fact isn't really necessary, and in larger applications can make performance to decrease. So maybe it would be possible to inject proxies to the bean once, which would then, when invoked, search for the required bean in the contexts? That would save some writes of the fields. Of course, the search would happen only once on a method call, and after the method completes the state of the search should be reset. This still isn't the optimal performance, but I think it could do better then the current way. Or not? :)

-- Adam

3 Replies:
28. May 2008, 17:01 CET | Link

There won't be any more major changes to the legacy seam core as the future core development will be web beans based.

 

Read about how to report a bug.

30. May 2008, 12:23 CET | Link

Hello,

so any of this will be available in WebBeans? As far as I remember Guice, they inject only once - proxies - a bit of what I was writing here. But did this idea make it to WebBeans as well?

Also, is there any future in Seam, or will I just have to migrate my app to WebBeans style (annotations etc) to keep up-2-date with the newest libs? :)

-- Adam

30. May 2008, 13:28 CET | Link

Read the spec, send feedback :-)

Web Beans Overview

 

Read about how to report a bug.