Andre Juffer wrote:
Hi all,
Suppose I am building a 'Cargo' application. From a pure Java
perspective, I would have domain modules such as customers, shipping,
billing, etc, placed in packages like org.foo.cargo.customers,
org.foo.cargo.billing, org.foo.cargo.ui, etc. With maven I would create
a project folder that would contain a single src directory where all the
packages and resources for this application would go.
In the case of a cocoon-based (version 2.2) webapp, would it be correct
to say that the aforementioned domain modules could correspond to
separate 'blocks', each having their own set of xml, xsl, cforms, flow,
java classes, etc files. The Cargo webapp would depend on
these blocks. The folder structure could look like:
./cargo/customers-block
./cargo/billing-block
./cargo/shipping-block
./cargo/cocoon-app (this includes a pom.xml stating the dependency on
the three other blocks).
Would this organization conform to what is considered as good practice
for building a web application with cocoon 2.2?
yes, sounds reasonable.
What exactly would go to
the src folder of the ./cargo/cocoon-app, besides WEB-INF containing
web.xml, application.context.xml, etc. There are also
application.context.xml files in the other blocks. The Carlo application
would rely on Spring for bean creation, database access and transaction
management.
each block can put its Spring bean definitions into META-INF/cocoon/spring. All
those beans are loaded into the _global_ Spring bean context.
Would it make more sense to have a separate block
('classes-resources-block') for all Java classes
instead of distributing them over the various blocks?
yes but I would want to find a better name that reflects the classes that it
contains. Too general names usually mean that the architecture needs some
refinement.
Apart from that, having a block doesn't necessarily require a Cocoon web
application with configured servlet services being part of it. It's also a valid
use case to have blocks that only contain Java resources and Spring beans (e.g.
for domain specific logic).
--
Reinhard Pötz Managing Director, {Indoqa} GmbH
http://www.indoqa.com/en/people/reinhard.poetz/
Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member, PMC Chair [EMAIL PROTECTED]
_________________________________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]