Design pattern needed: breaking webapp into modules

C

Chris

We've got a webapp that has different modules. Let's say, just as an
example, the modules are Editing, Querying, and Reporting. Each module
has its own set of JSP pages. The modules also have some sub-pages in
common like headers and footers.

We'd really like to distribute the modules independently. A customer
might buy only Editing and Querying, but not Reporting, for example.

One of the modules is open source, which means that we'd like to
distribute it as a complete, standalone project. But we'd also like to
be able to integrate it with the rest of the webapp easily.

Does anyone have a good design pattern for this? I'm struggling with how
to organize the webapp, where to put the pages, how to have independent
projects that share common pages and code, etc. Any ideas appreciated.
 
L

Lew

Chris said:
We've got a webapp that has different modules. Let's say, just as an
example, the modules are Editing, Querying, and Reporting. Each module
has its own set of JSP pages. The modules also have some sub-pages in
common like headers and footers.

We'd really like to distribute the modules independently. A customer
might buy only Editing and Querying, but not Reporting, for example.

One of the modules is open source, which means that we'd like to
distribute it as a complete, standalone project. But we'd also like to
be able to integrate it with the rest of the webapp easily.

Does anyone have a good design pattern for this? I'm struggling with how
to organize the webapp, where to put the pages, how to have independent
projects that share common pages and code, etc. Any ideas appreciated.

EAR - Enterprise ARchive.

Give each web app component its own context. I've done this and it works all
right.
 
D

Daniel Pitts

Chris said:
We've got a webapp that has different modules. Let's say, just as an
example, the modules are Editing, Querying, and Reporting. Each module
has its own set of JSP pages. The modules also have some sub-pages in
common like headers and footers.

We'd really like to distribute the modules independently. A customer
might buy only Editing and Querying, but not Reporting, for example.

One of the modules is open source, which means that we'd like to
distribute it as a complete, standalone project. But we'd also like to
be able to integrate it with the rest of the webapp easily.

Does anyone have a good design pattern for this? I'm struggling with how
to organize the webapp, where to put the pages, how to have independent
projects that share common pages and code, etc. Any ideas appreciated.
I suggest looking into Spring Web Flow, it was design specifically for
this purpose.
 
C

Chris

Lew said:
EAR - Enterprise ARchive.

Give each web app component its own context. I've done this and it
works all right.

Thanks. What I haven't been able to figure out, though, is how to share
the files that are common across modules. When I try to do a jsp include
of a file that isn't in the current webapp, I get an error message to
the effect that I can't access resources outside the current context.
 
L

Lew

Chris said:
Thanks. What I haven't been able to figure out, though, is how to share
the files that are common across modules. When I try to do a jsp include
of a file that isn't in the current webapp, I get an error message to
the effect that I can't access resources outside the current context.

Right. <jsp:include> isn't the way to do it. It's analogous to using
cooperative programs - they wouldn't use each other's variables, but
communicate more indirectly.

If you're selling separate modules to your customers, they will have that
degree of independence anyway.

In the application I did recently that used multiple web modules, we used
<http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html#getContext(java.lang.String)>

then
<http://java.sun.com/javaee/5/docs/a...t.html#getRequestDispatcher(java.lang.String)>

off the new ServletContext to manage the switch between contexts.
 
A

Are Nybakk

Lew said:
EAR - Enterprise ARchive.

Give each web app component its own context. I've done this and it
works all right.

Do you know any easy-to-understand tutorial or something about this
subject? We're having our graduation project this spring and we might
make a solution built on Java EE. Currently we've learned about the Java
EE containers (Servlets, JSP, Session beans) and some Java Persistence.
We're very interested in making modules like Chris is talking about
(offering different "packages"). I've looked a little bit into dynamic
class loading and such some time ago and I thought "aha, we could use
this", but that's not the way to do things in Java EE is it?
 
A

Are Nybakk

Lew said:
Are said:
Do you know any easy-to-understand tutorial or something about this
[Java EE]?

Java? Tutorial? Java tutorial? Java EE tutorial? Hmm, let's see,
where would one go for a Java tutorial, specifically a Java EE
tutorial? Where would one go? Hmmm, could it be ...

<http://java.sun.com/javaee/5/docs/tutorial/doc/>?

=) I meant specifically about modularization and "contexts" as you
mentioned. Any pointer much appreciated.
 

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,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top