cancel
Showing results for 
Search instead for 
Did you mean: 

Context mapping vs. Java beans

Former Member
0 Kudos

Hi,

I'm making a "Server" Component (Java Web Dynpro) that exposes a view to other "Client" Components (other Java Web DynPros). The Clients can insert the exposed view into their views to use the Server's services.

The Server, obviously, has to be initialized with specific data from the Client.

At first I thought of creating a context node in the Server, structured with all the attributes needed for its configuration, and then expose that node in the interface. In this way the Client creates a local copy of that node via node mapping and then populates its attributes with values. Once the client populates it in its wdDoInit() method, the embedded view's wdDoInit() method is called and the Server's View can initialize itself.

Now, instead, I was considering using Java Beans (a class that wraps all the data that I've currently put in the context) because:

1- The Client should not be able to alter the Server's configuration once it has been initialized. With context mapping the Client can alter at runtime the configuration node's content.

2- The Server configuration has to be shared between multiple Server's views. When passing a configuration NodeElement as argument to methods shared between views, I've always the problem that I have to deal with the type of the NodeElement (the public interface of the component controller, the private interfaces of the views).

What is the right way to do things in this scenario?

Thanks to anyone who drops an answer,

See you,

Pietro

PS. If it's unclear, let me know!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You can implement some inteface at server,

declare usage of this interface at client.

then,

you can initalise server component by getting that interface from server component,

and calling methods with desired objects as arguments.

other methods of this interface can be used to return server's configuration,

so it will be shared.

Answers (0)