cancel
Showing results for 
Search instead for 
Did you mean: 

How to reuse

Former Member
0 Kudos

Hi Friends,

I can create different webdynpro components and all components can have different component controllers.

hwo to handle common logic for Model? I mean database data methods written in Java.

I am connecting to database using a Java class.

i have some methods in it.

I want to use this class as a model to be reused in different components.

is it good idea?

is there any other way?

and..

How to handle common data between different components?

How to handle session management, login to database to get data?

Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Nav

Place all model related stuff in the component controller and then access the data in different Iviews using mapping

Do reward points if this helps.

Former Member
0 Kudos

Hi Girish,

That I am doing, but I think placing the code in a Java fiel will be better solution, what do you think?

pravesh_verma
Active Contributor
0 Kudos

Hi Nav,

Putting the code in the java files and then accessing it for values can be much more difficult. It is better to put the code in the controllers.

1) If you want to put the common code for <b>view</b> and <b>window</b> then put it in <b>Component Controller</b>.

2) If you want to put the common code for <b>components</b> the pit it in <b>Interface controller</b>. (Well, this is your case!!).

Putting the common code in the controller is always a better idea since then you can access it from various other components of the same application.

I hope you understood it.. If any problem then kindly revert back.

Also kindly close your earlier thread if the problem is solved. It is better to close thread if you get answer of your question. ()

Regards

Pravesh

PS: Please consider rewarding points if helpful and solved.