MVC model: JavaBeans vs. EJBs

I have to design and implement a web site for a Travel Booking Agency where users login, book trips and so on...My question is how to design it in the sense of whether use JSP-Servlets-JavaBeans or EJBs. I quite miss the idea when to use the one and when the other in more simpler cases...10x in advance

[310 byte] By [Smurfaa] at [2007-10-2 13:15:20]
# 1

> I have to design and implement a web site for a

> Travel Booking Agency where users login, book trips

> and so on...My question is how to design it in the

> sense of whether use JSP-Servlets-JavaBeans or EJBs.

> I quite miss the idea when to use the one and when

> the other in more simpler cases...10x in advance

It's not either or. It's JSP-servlets-JavaBeans no matter what you do. The question is whether or not to add EJBs to the mix.

%

duffymoa at 2007-7-13 10:46:41 > top of Java-index,Other Topics,Patterns & OO Design...
# 2

"To EJB or to not EJB?"

The answer depends on how well you know EJBs, whether you have access to a Java EE app server with EJB support, etc.

What do you think EJBs are doing for you that you can't do without? If you can't answer that, maybe you don't need them or understand them well enough.

%

duffymoa at 2007-7-13 10:46:41 > top of Java-index,Other Topics,Patterns & OO Design...
# 3
OK, that I understand (JSP-Servlet-JavaBeans), my question is in the context of that type of application do I need EJB, or does such class of application require EJBs. EJB aims at reusability and serialization so...is it necessary?
Smurfaa at 2007-7-13 10:46:41 > top of Java-index,Other Topics,Patterns & OO Design...
# 4
I did not put it correctly: Does something REQUIRE EJBs in order to operate properly (for example whether payment can be done only with EJBs)...
Smurfaa at 2007-7-13 10:46:41 > top of Java-index,Other Topics,Patterns & OO Design...
# 5
I would rather go with loosely coupled and flexible SOAP rather than with highly coupled EJBs. We all know there are a lot of problems with EJBs. Do a google to get the details
kilyasa at 2007-7-13 10:46:41 > top of Java-index,Other Topics,Patterns & OO Design...
# 6
10x all for the ideas...have to stick with Java ( requirements...what to do)..I think I am going to miss the EJBs, too much stuff, not enough time..:)
Smurfaa at 2007-7-13 10:46:41 > top of Java-index,Other Topics,Patterns & OO Design...
# 7

> OK, that I understand (JSP-Servlet-JavaBeans), my

> question is in the context of that type of

> application do I need EJB, or does such class of

> application require EJBs. EJB aims at reusability

> and serialization

Uh, no they don't.

EJBs are a component-based transaction monitoring system. You use them when you want a clustered, highly-available, high throughput, transaction Java enterprise solution. "Enterprise" implies that there are a number of services available to you: naming, queuing, messaging, lifecycle support, connection pools, mail services, etc.

Actually, EJBs have some problems. EJB 3 is an attempt to fix some of them. But people have noticed these problems and tried to deal with them. You can do Java Enterprise Edition without EJBs. Spring allows it.

You don't sound like you know EJBs very well. If you did, you wouldn't have to ask. So I'll turn it around: What makes you think that you need them? What are you solving that makes you think EJBs? Your lack of knowledge suggests that you'd be better off without them.

I just finished a Web app that does database access and serves thousands of users a day on the Internet, and it doesn't use EJBs. We used Sprng and Hibernate. We've been available for the last four months without incident.

%

> so...is it necessary?

duffymoa at 2007-7-13 10:46:41 > top of Java-index,Other Topics,Patterns & OO Design...
# 8

Well, yeah ...I am working on my knowledge ....I am asking about EJBs because they are mentioned in my assignment as a stage of development...After I read quite a bit on them, I couldn't grasp their idea/functionality/benefits perfectly...maybe the examples where not the right ones because the same ones (class of applications let me say ) are given for the JavaBeans and JSP-Servlet development. That is why I was asking...The answer I got here gives me much better idea what I am dealing with...Thank you all for the help and the patience you showed answering my 'silly' questions ;)

Smurfaa at 2007-7-13 10:46:41 > top of Java-index,Other Topics,Patterns & OO Design...