You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Jean-Sebastien Delfino (JIRA)" <de...@tuscany.apache.org> on 2008/08/20 02:32:44 UTC

[jira] Commented: (TUSCANY-2556) Need a sample that shows how to bootstrap and use an SCA reference in a client

    [ https://issues.apache.org/jira/browse/TUSCANY-2556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12623855#action_12623855 ] 

Jean-Sebastien Delfino commented on TUSCANY-2556:
-------------------------------------------------

I've committed 3 different HelloWorldClient programs, showing 3 different code patterns.

All are normally declared as SCA components, allowing normal SCA references (with wiring, binding configuration, policy intents etc) to be used to reference remote services, and normal SCA annotations to be used and benefit from the automatic injection of references by the runtime.

HelloWorldClient just stores the helloWorldService reference in a static, allowing the static main() method to use it.

HelloWorldClient2 executes the business logic in a non-static doit() method, stores the singleton instance of the client in static for the static main method to use.

HelloWorldClient3 is similar to (2) without static, main() just calls getService() to get the initialized instance of the client.

More variations are probably possible :)


> Need a sample that shows how to bootstrap and use an SCA reference in a client 
> -------------------------------------------------------------------------------
>
>                 Key: TUSCANY-2556
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2556
>             Project: Tuscany
>          Issue Type: Improvement
>          Components: Java SCA Samples
>            Reporter: Jean-Sebastien Delfino
>            Assignee: Jean-Sebastien Delfino
>             Fix For: Java-SCA-Next
>
>
> Most of our client samples involve a Client program with a main method, code to get a proxy to a 'Client' proxy component, and code in the client proxy component to relay method calls to a remote service.
> That's too complicated, see java/sca/samples/helloworld-ws-reference for an example of that pattern.
> The current SCA programming model allows for a simpler usage, allowing client code to use references directly, simply by representing the client itself as a component.
> I'd like to contribute a new sample to show that simpler usage of the SCA programming model.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.