Solved

J2ee designing questions in terms of EJB

Posted on 2006-07-12
4
221 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Application launch issue with Apache Tomcat 5 62
diffSum example 4 50
map related example 6 55
Java: How do I open the default windows program for a given file type 3 38
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

789 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