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:04:44 UTC

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

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.


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

Posted by ant elder <an...@gmail.com>.
On Wed, Aug 20, 2008 at 1:04 AM, Jean-Sebastien Delfino (JIRA) <
dev@tuscany.apache.org> wrote:

> 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.
>
>
>
I quite like this approach. It didn't used to work due to various bugs but
now that it does should we change most of the samples where its appropriate
to do it this way?

   ...ant

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

Posted by "Jean-Sebastien Delfino (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-2556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625488#action_12625488 ] 

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

I don't see a test.html in sample-calculator-lean.

About the CalculatorClient component, the idea is that clients can be represented as normal components, leveraging the normal wiring, policy etc. resolution, and allowing the application developer to code that client like other components instead of having to use special client APIs. So, yes, the CalculatorClient component is needed :)

CalculatorTest is a test case, different from a client. The idea is to show:
- a client, which eventually gets shipped in an application, it's not a test case and should not be complicated by test considerations;
- a Junit test case, showing how app developers can use a similar component pattern to develop test cases.

> 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.


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

Posted by "Jean-Sebastien Delfino (JIRA)" <de...@tuscany.apache.org>.
    [ 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.


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

Posted by "Jean-Sebastien Delfino (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-2556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625248#action_12625248 ] 

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

I've added a HelloWorldClient5 that shows how to code a client that doesn't depend on Tuscany APIs at all, just uses the standard SCA spec programming model. The client just runs its client logic in a method annotated with an SCA @Init. The client program can then just be launched using the Tuscany launcher as described.

I've also added a calculator-lean sample that shows the same pattern applied to our calculator sample.  The calculator sample is just an assembly of POJOs without any references to remote services. I thought it'd be useful to show that with calculator as well as helloworld-ws-reference-lean sample may confuse the story with the fact that it uses a reference to a remote Web Service.

I've described how to launch calculator-lean sample using the Tuscany launcher in the README.

> 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.


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

Posted by "Dan Becker (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-2556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625383#action_12625383 ] 

Dan Becker commented on TUSCANY-2556:
-------------------------------------

I really like the new samples. They are very useful demos and intros. I will be using calculator-lean as my new intro sample.

Two small comments. For sample-calculator-lean, is there any need for test.html? I don't see it used anywhere, and it might make the sample even more lean. And in Calculator.composite,  any need for the CalculatorClient component? It seems that CalculatorTest has its own entry, and CalculatorClient might be unneeded.

> 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.


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

Posted by "Apostolos Papageorgiou (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-2556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12650582#action_12650582 ] 

Apostolos Papageorgiou commented on TUSCANY-2556:
-------------------------------------------------

Nice examples, i have tested them, i admit i have to examine it a little bit more to have a clear view of the difference and of the reasosn why a proxy (as in the samples) can be needed.

Could you please give some hint (or link) to an implementation of helloworld-ws-reference for the tuscany-eclipse-plugin (i.e. without Launcher, SCADomain package etc.)? I.e. a solution that would complement the example of helloworld-ws-service with the tuscany-eclipse-plugin at http://tuscany.apache.org/build-your-first-web-services-with-tuscany.html

> 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.


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

Posted by "Jean-Sebastien Delfino (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-2556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12623858#action_12623858 ] 

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

Actually... I just added one more variation that shows how to use ComponentContext and get a proxy to the remote service programmatically as an alternative to @Reference injection.

Here are links to the 4 samples:
http://svn.apache.org/repos/asf/tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient.java
http://svn.apache.org/repos/asf/tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient.composite

http://svn.apache.org/repos/asf/tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient2.java
http://svn.apache.org/repos/asf/tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient2.composite

http://svn.apache.org/repos/asf/tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient3.java
http://svn.apache.org/repos/asf/tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient3.composite

http://svn.apache.org/repos/asf/tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/java/helloworld/HelloWorldClient4.java
http://svn.apache.org/repos/asf/tuscany/java/sca/samples/helloworld-ws-reference-lean/src/main/resources/helloworldwsclient4.composite


> 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.