Solved

J2ee designing questions in terms of EJB

Posted on 2006-07-12
4
210 Views
Last Modified: 2013-11-24
Hi Experts,

while I was reading some of the articles about J2ee and EJB, I had these questions.

* Is web application that was developed in Struts frame always J2ee?

* When developers are designing J2ee web app, EJB is always necessary?

* In order to separate functionality of application components among session beans, entity beans and MDBs, what are things that they consider?

thanks in advance,
0
Comment
Question by:dkim18
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
suprapto45 earned 200 total points
ID: 17096079
>>"Is web application that was developed in Struts frame always J2ee?"
Yes it is. Struts is basically the J2EE framework so if the web application is using Struts, it must be in J2EE. Additionally, only J2EE App Server can run Struts.

>>"When developers are designing J2ee web app, EJB is always necessary? "
Not necessarily. EJB may be powerful but it also took a lot of memory as well as high learning curves. The lighter alternative is now preferred such as Hibernate or etc.

>>"In order to separate functionality of application components among session beans, entity beans and MDBs, what are things that they consider?"
Firstly, normally, sessions beans are always the place where you locate all your business logics. All the complicated and complex things are located there. Entity Bean will only be the representation of your table in database so it just helps you in persisting the data to and from database. MDB plays a different role. It helps you in sending the message to another system. Normally, the session beans will call the MDB to send some messages such as email to the SMTP Server or etc.

I hope that helps
David
0
 
LVL 10

Assisted Solution

by:mukundha_expert
mukundha_expert earned 100 total points
ID: 17096975
>>* In order to separate functionality of application components among session beans, entity beans and MDBs, what >> are things that they consider?

Remember,

Data represention --> Entity Beans
Business Logic --> Session Bean
Communication with other system --> MDB

Business Logic in turn can be logic that depends on the previous state ( stateful session ) and that do not depend on previous state (statless session)
So we have stateful session Bean and stateless session bean.
Depending on your business requirements you can decide on which type of session bean to use.

One more thing to consider here is scalability,
Stateless session beans are more scalable than stateful session beans ( obvious thing ).

Entity beans are used to represent data. the persistence can be either Container managed ( container will take of persistence of data ) or Bean managed ( programmer has to take care of persistence ).

first seperate the application components into components that represent data and that do business logic and that communicate with othersystems,

for data decide on which type of persistence you are going to use
for business logic based on the scenario decide between the stateful and stateless session beans. ( an application can have both the stateless and stateful session beans, stateful session beans can use some functionality of the stateless session beans).


0
 
LVL 10

Expert Comment

by:mukundha_expert
ID: 17096984
>>* When developers are designing J2ee web app, EJB is always necessary?

No. it depends on your application. you need EJB only if the application needs it. if you can develop more scalable application without using EJB then you might prefer not to use EJB's.

0
 
LVL 6

Assisted Solution

by:valipotor
valipotor earned 100 total points
ID: 17334411
1. Actually, Struts is not a part of J2EE, it makes use of J2EE components. JSP & JSF are part of J2EE.
2. EJB is not always necessary. They provide extra services as Security, load balancing, trasactions, etc.
3. Here is a usefull link:
http://www.phptr.com/articles/article.asp?p=31937&seqNum=3&rl=1.

valipotor
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now