Simon McClenahan wrote:

I've been sold on the concept of component oriented design, and read through the Avalon online documentation. It's obviously a bit overwhelming at first. I'm trying to figure out how to write a webapp or something similar, and the software architecture behind it.

The project I am currently working on is very simple, implemented as a Java servlet that examines the request parameters, finds a file, calls an external program using Runtime.exec() to convert it to a PDF file, and returns the PDF stream in the response. Understanding SoC, I will want to add logging, security, distributed app server, caching, etc. as development goes on.


Sounds reasonable.


If you have Avalon Merlin installed (http://avalon.apache.org/merlin) the you could try this little demonstration (credits to Timothy Bennett). Its basically a very simple servlet that is provided with component based services from an Avalon container.

$ merlin http://dpml.net/avalon-http/blocks/avalon-http-1.3.block

After executing the above command you will have:

1. a web server running on your machine on port 8080
2. a web app deployed on http://localhost:8080/example/servlets
3. content presented is based on information provided by Avalon components

If you don't have merlin installed I've just punched in the above command on my own machine so you see the result here:

http://www.osm.net:8080/example/servlets

The information used to define this application sceanrio is container in the block file referenced under the merlin command line. This is a simple XML file that describes a container holding a few components necessary to fulfill the appication scenario. You can see the content here:

http://dpml.net/avalon-http/blocks/avalon-http-1.3.block

Here in avalon components tyupically do a specific thing, do it well, show good seperation of concerns, and are well isolated. These characteristics dramatically simply the application deployment process and enable better management and code maintenance. Part of the reason we can achive this is because we deal with fine-grain component defintions that can automatically be composed with other components to create new composite components. Composites can be composed with other composites to create more composites - automatically.

In the example I've shown above your looking at an auto-generated composite component basically doing the sort of thing you describe.

What is step 1 for developing a webapp?


Step one is to understand the component model.
Maybe take a look at the following tutorial - then start playing with some of our web componets. http://avalon.apache.org/merlin/starting/tutorial/index.html


Stephen.

--

Stephen J. McConnell
mailto:[EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to