On Wed, May 13, 2009 at 8:58 AM, Florian Fernandez
<[email protected]> wrote:
> Dear Raymond and other Tuscany users/developers:
>
> Please feel free to read my comments and further questions inline:
>
>> > 2. Do there exist one or more possibilities to integrate the "ZK Direct
>> > RIA" Open Source framework (http://www.zkoss.org) into an Tuscany-based
>> > web app?
>> > I read about one possibility of integrating ZK with a Spring WebFlow app,
>> > which I suppose could be integrated into Tuscany, couldn't it? Thus, the
>> > following subquestions arise:
>> >
>> > (a) Do this way function in conjuction with Tuscany? I.e., do someone have
>> > some working samples I could take a glimpse at?
>> >
>> > (b) Do there exist a "more direct" integration without involving the
>> > Spring framework? -- A plain JavaSE or may be a JavaEE app would be
>> > preferred.
>> > How would such a solution look like?
>>
>> I'm not an expert on web frameworks. Tuscany/SCA provides a good way to
>> build business logic as components and compose them into solutions in a
>> technology-neutral fashion. In the web 2.0 area, Tuscany allows SCA services
>> to be exposed to JSONRPC or ATOM/RSS Feed so the typical web 2.0 client
>> (such as DOJO) can talk to back-end services. Tuscany also provides a way to
>> model the JavaScript as an SCA component (implementation.widget) with
>> references to other services and inject JavaScript proxies to interact with
>> the JSONRPC services.
>
> Thus, if I got this right, Tuscany are primarily used for the SOAfication of 
> the data access and biz logic layers, and I'm independent of Tuscany 
> capabilities in respect to the (web) presentation layer?!?

Tuscany and SCA _DOES_ also apply to the presentation layer and
provides various means of "SOAfication".

There is a specification that defines how SCA can be used in a JEE web
container. That doesn't mean you need a full JEE application server,
the web aspects of that spec can also be used in a simple web
container like Tomcat or Tuscany provides some of that support and
enhancements to it for standalone web applications using the Tuscany
standalone or OSGi runtimes.

> It's this last-mentioned aspect which is still unclear to me, i.e.:
> How can I combine/package the (ZK-based web) presentation layer code -- that 
> does some WebService and/or JSON-RPC calls to Tuscany-packaged components -- 
> with the Tuscany-based app itself? I'm striving for a plain Tuscany packaging 
> over the three app layers, i.e. to also "convert" the web app presentation 
> logic into Tuscany components. Is this possible?
> (E.g., How is this task fulfilled with JSFs or JSPs in a JavaEE web app fully 
> integrated with Tuscany?)
>

There are two main approaches:

1) Have the web application presentation layer outside of the SCA
domain and access the domain as a remote client calling domain
services
2) Have the web application part of the SCA domain and use SCA
assembly to connect the presentation layer to data access and biz
logic services

The main advantage of (2) is that it enables using the all the
capabilities of SCA such as injection, declarative assembly, easy
re-wiring etc.

The main difference to the presentation layer code between using the
two approaches is with how it gets hold of the services to use. Using
approach (1) the presentation layer code needs to either:

(1a) hardcode the protocol and endpoint of the service and invoke it
using its own support for that protocol. For example if ZK natively
supports JSON-RPC it could use that to invoke Tuscany/SCA services
exposed with <binding.jsonrpc>

(1b) if the ZK application is running locally to the SCA domain it can
get hold of the Tuscany SCADomain or Node object and use the
getService method to get an invocable proxy for the SCA services

Using approach (2) the presentation layer code needs to either:

(2a) if the presentation layer code uses a web technology that has SCA
integration then it simply uses SCA annotations in the presentation
layer code and the Tuscany runtime will inject the required objects

(2b) if the presentation layer code web technology being used does not
support native SCA integration then it needs to get hold of the SCA
ComponentContext and manually look up the required objects

The main advantage of (2b) over (1b) is that it still provides support
for the capabilities of SCA such as declaritive assembly, easy
re-wiring etc.

Option (2a) provides the cleanest approach but it requires specific
Tuscany support the web toolkit being used. Tuscany provides this
integration code for some common web technologies and toolkits like
Servlets, JSP, JSF, Stripes, (and soon Wicket), and Tuscany's
proprietary <implementation.widget>. Tuscany doesn't have any support
for ZK, it would be fairly easy to write that support but we can't do
it here at Apache Tuscany as the ZK license is GPL which is a problem
license so Apache code can't use it directly. We could provide help if
you are interested in writing SCA support in ZK, but we couldn't host
that code within the Tuscany project itself.

There are Tuscany samples demonstrating all these approaches, see the
various web samples in the 1.x or 2.x Tuscany distributions, or for an
easy way to create your own you can use the Tuscany maven archetypes
to easily create a some samples without needing to install any Tuscany
distribution see -
http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Tuscany+Maven+Archetypes

This is an area that we're actively working on in both Tuscany 1.x and
2.x  so we'll been keen to hear and help with what you need so please
do continue trying and asking so we can help make this do what you
need.

   ...ant

Reply via email to