on 05-20-2010 11:46 AM
Hey Experts,
I am using NW CE 7.1 EHP1 for developing an application.I am using Oracle as a database and webdynpro java as UI. I have three options to develop my business logic:
1) Directly access Oracle from Webdynpro Java using Java Class
2) Write my business logic in stateless session bean and use it as java bean model. I can use EJB3.0 for the same.
3) Use webservice as a model which contains my business logic.
I need your help to identify the best option out of the three aforementioned options and why do you think that option is the best.
I appreciate if anyone can list down pros-cons of above options.
Regards
Abhinav Sharma
Hi Abhinav,
The option 1 breaks the MVC concept straighforwardly, so it is not recomended mostly.
If you are going for option 2, then also there is a problem as explained below...
If you have created an EJB Module which communicates with your database via a session bean and if you are using DC of type webdynpro as your UI, then you need to add the Enterprise Application DC (which is created to deploy the EJB Module DC) as dependency in WebDynpro DC, because...
when you create a new model of type Enterprise JavaBean Model in your WebDynpro DC, at that time you have to choose your Enterprise Application DC in the available public parts.
So it is very much clear that if you want to use the same database table access logic written in "Enterprise Application DC" and "Enterprise Application DC" in multiple WebDynpro DCs then it becomes mandatory to add the Enterprise Application DC as a Dependent DC for all those WebDynpro DCs.
The option 3 is the best option as you add the methods of your choice defined in EJB to the Session beans local Interface and then Expose the session bean's local interface as a Web Service.
In this case unlike option 2 there's no dependency on the source code of Enterprise JavaBean or Enterprise Application DC.
I hope this information will help you choose the best option now.
Regards,
Shreyas Pandya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
i think webservice is better.
if you plan to let more other systems read and write Oracle, the webservice can be a template to call and reuse.
Fisher
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhinav,
I have tried 1st and 2nd option in my previous project but found 2nd option much better, cos in this way you can seprate your business logic and UI part and wil be able to achieve MVC concept and it is good practice to follow MVC concept.
Deepak!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Well you can combine all the three. Use java classes for your entities to represent the tables. Create interfaces containing your business functions and implement them in the implementation classes. Wrap them inside the stateless session bean, I mean just call the functions from the session bean business method, don't implement the code there.
Then expose this as webservice and use webservice model to fetch the backend data.
Regards,
Manoj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.