2010-10-07 47 views
0

我想使用欧芹框架,我想使用GraniteDS进行远程处理。从2.1开始,GraniteDS从您的Java代码生成AS3服务类作为本地代理,并且我想在Parsley中使用这些类。如何在Flex中使用带有GraniteDS的欧芹?

我可以成功注入香菜的服务类,但是当我把他们的任何方法,我得到一个空对象错误

at org.granite.tide::Component/http://www.adobe.com/2006/actionscript/flash/proxy::callProperty()[C:\workspace_\graniteds\as3\framework\org\granite\tide\Component.as:172] 
at library::BookServiceBase/get()[C:\Documents and Settings\MedLineTec\Adobe Flash Builder 4\library\src\library\BookServiceBase.as:36] 

这是因为香菜是创建服务类的实例,而无需实际注入他们与相关的“背景”来做GraniteDS远程处理。我需要弄清楚如何将GraniteDS上下文提供给parsley实例化的服务类。我看到a post on the parsley forums有人推荐:

<parsley:ContextBuilder> 
     <parsley:FlexConfig type="{UserManagerConfig}"/> 
     <parsley:RuntimeConfig instances="{[tideContext]}" /> 
</parsley:ContextBuilder> 

... 

[Bindable] 
private var tideContext:Context = Spring.getInstance().getSpringContext(); 

但是,这并不适用于我。我熟悉GraniteDS,但不熟悉欧芹,所以也许这是解决方案,但正确地应用它是高于我的头。

如果有人使用Swiz或Spring ActionScript等其他框架,那么还请传递该解决方案,因为它可能非常相似。

UPDATE: 我通过读取花岗岩源代码的后我注入香菜(例如bookService的)一个服务,如果用完

private var tideContext:Context = Spring.getInstance().getSpringContext(); 
bookService.meta_init("bookService", tideContext); 

然后我可以成功地使用该服务计算出来。所以我想我只需要知道如何以一种自动的方式来做到这一点,我与所有的服务,我声明在欧芹。

回答

1

我会看看Pimento而不是GraniteDS。它也是一个SpiceFactory ActionScript库,就像Parsley

+0

“随着创作者开始使用不同的技术,所有Spicefactory产品不再被主动维护,最终版本的Pimento和Cinnamon已于2009年8月发布。”来自spicefactory网站的报价 – Edward 2013-02-22 17:38:19