JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Java Application Framework  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友    訂閱主題
reply to topicthreaded modego to previous topicgo to next topic
己加入精華區
by caterpillar at 2007-04-03 23:46
本主題所含的標籤
無標籤
作者 Guice 1.0 釋出 [精華]
linexpmail

好玩就好



發文: 456
積分: 15
於 2007-03-15 01:39 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
google 自用的 DI 架構,用 annotation 來配置,
有興趣的人可以參考看看。

1
2
3
4
5
6
Injector injector = Guice.createInjector(new AbstractModule() {
      protected void configure() {
        bind(Service.class).to(ServiceImpl.class).in(Scopes.SINGLETON);
      }});
Client client = injector.getInstance(Client.class);
client.go();


http://crazybob.org/2007/03/guice-10.html
http://code.google.com/p/google-guice/
http://fisheye3.cenqua.com/browse/google-guice/trunk/test/com/google/inject/InjectorTest.java


reply to postreply to post
不除妄想不求真
作者 Re:Guice 1.0 釋出 [Re:linexpmail]
linexpmail

好玩就好



發文: 456
積分: 15
於 2007-03-28 12:16 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
最近看到 Guice in GWT 一文,對於服務注入 GWT 有興趣的人可以參考看看,
其 BaseServiceImpl 類似 InjectedHttpServlet(Guice) + RemoteServiceServlet(GWT),
把兩個東西連在一起。

Guice in GWT
http://radialmind.blogspot.com/2007/03/guice-in-gwt.html
http://google-web-toolkit.googlecode.com/svn/trunk/user/src/com/google/gwt/user/server/rpc/
http://google-guice.googlecode.com/svn/trunk/servlet/src/com/google/inject/servlet/InjectedHttpServlet.java


reply to postreply to post
不除妄想不求真
作者 Re:Guice 1.0 釋出 [Re:linexpmail]
linexpmail

好玩就好



發文: 456
積分: 15
於 2007-03-29 10:35 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
有篇詳細的比較出爐,雙方的資深開發者各自陳述,看熱鬧之餘,
決定要採用一個框架還是要多看。框架很有意思,方便是方便,
但是被其誕生環境這個框框限制,彈性與維護等要素,每個案子
並不相同,多比較才找得到適合的。

http://jroller.com/page/habuma?entry=guice_vs_spring_javaconfig_a


reply to postreply to post
不除妄想不求真
作者 Re:Guice 1.0 釋出 [Re:linexpmail]
avseq

美若天仙,生性冷漠



發文: 202
積分: 2
於 2007-04-03 09:43 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
linexpmail wrote:
有篇詳細的比較出爐,雙方的資深開發者各自陳述,看熱鬧之餘,
決定要採用一個框架還是要多看。框架很有意思,方便是方便,
但是被其誕生環境這個框框限制,彈性與維護等要素,每個案子
並不相同,多比較才找得到適合的。

http://jroller.com/page/habuma?entry=guice_vs_spring_javaconfig_a

請問這篇文章AOP的範例有人試出來嗎?
我照著作出現錯誤,我已經定義了MinstrelIntercepted annotation還是不行
1
public @interface MinstrelIntercepted {}


1
bindInterceptor( any(), annotatedWith(MinstrelIntercepted.class), new MinstrelInterceptor() );

錯誤訊息
1
2
Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
  The method bindInterceptor(Matcher<? super Class<?>>, Matcher<? super Method>, MethodInterceptor...) in the type AbstractModule is not applicable for the arguments (Matcher<Object>, Matcher<AnnotatedElement>, BeforeHelloMethod)


avseq edited on 2007-04-03 09:45
reply to postreply to post
作者 Re:Guice 1.0 釋出 [Re:avseq]
linexpmail

好玩就好



發文: 456
積分: 15
於 2007-04-03 10:55 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我的環境可以執行,就訊息來看,似乎是沒有
實做 AOP Alliance MethodInterceptor 介面的樣子,
參考看看。


reply to postreply to post
不除妄想不求真
» JWorld@TW »  Java Application Framework

reply to topicthreaded modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8