Servlet or EJB design question for Online Store

M

mj

I'm sure this question gets asked all the time, so please bear with
me.

I am creating an online store for our company. As part of the design,
I wanted to seperate the admin/back-office functions into a seperate
webapp. The admin webapp will be located on our local company
intranet. Currently I am planning on using WebWork/Velocity/Hibernate
in the app. My question is about how to best design this in terms or
servlets/ejb. Since both the storefront and the admin apps will share
many of the same functions, if I create seperate webapps, I will be
copying a lot of the same code into both apps. I have never used EJBs
before, but it seems like if I put these shared functions into EJBs, I
could then just call these functions from both my storefront and admin
apps without having to copy any code?

Using this logic, it seems like EJBs are the only way to go to share
code? Is that correct? Has anyone worked on a similar project that can
offer any advice?
 
S

Sudsy

mj wrote:
I am creating an online store for our company. As part of the design,
I wanted to seperate the admin/back-office functions into a seperate
webapp. <snip>

Most of the time you don't need a separate webapp. Investigate the use
of roles for your clients. Admin users can be presented with different
options than regular users. To be specific, check out
javax.servlet.http.HttpServletRequest#isUserInRole( String role )
You don't require a fully-fledged J2EE server to provide this
functionality: a servlet container such as Tomcat can provide all
you need.
 
W

Will Hartung

Sudsy said:
mj wrote:


Most of the time you don't need a separate webapp. Investigate the use
of roles for your clients. Admin users can be presented with different
options than regular users. To be specific, check out
javax.servlet.http.HttpServletRequest#isUserInRole( String role )
You don't require a fully-fledged J2EE server to provide this
functionality: a servlet container such as Tomcat can provide all
you need.

Also, even if you decide to go with seperate WebApps, there's no reason why
the two applications can't share code and classes. Just because they're both
using the same classes doesn't mean you're duplicating code. Just have two
different build options from a single source tree.

Regards,

Will Hartung
([email protected])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top