On Tue, 2002-07-09 at 16:41, [EMAIL PROTECTED] wrote:
> Hi everyone,

Hi Gilles!

> I'm starting a new project based on Fortress.
> I read the examples provided by Marcus and found some material to get
> started.
> 
> Here is a simplistic description of the project :
> 
> There's a business core composed of 3 components :
>     * RawDataProvider (reads data from database)
>     * Computer (does some computation on the datas, and creates some other
> computed datas)
>     * ComputedDataStore (writes new data to database)
> 
>     The main component is Computer (uses RawDataProvider and
> ComputedDataStore) and has a business method : compute(Data[] data);
> 
> Now I would like to be able to launch the computation from :
>     * command line (batch mode)
>     * GUI client
>     * embedded in a server (in my case, it's CORBA, but it could be EJB as
> well)
> 
> Now if Berin, Leo or Peter could answer my 3 questions :)
> 
> 1 - Do I have to write a specific Container for each case ?

no.

> 2 - If so, how would you design them ?

like fortress =)

> 3 - What is the purpose of the container ? Why do we have to write a
> Container at all ?

the container manages your components.

Suppose your DataProvider needs some information on the database to
connect to, the schema of the database, etc.

If you build it as a javabean you would probably provide a few
properties and then set them through your IDE.

In Avalon, you would implement Configurable, write an xml configuration
file, and set up fortress so it provides your DataProvider with the
configuration file (parsed into a Configuration object) at the right
point during execution.

Also, you might have multiple DataProviders that a Computer can work
with. To do this in a 'normal' system, either your Computer component
becomes quite a bit more complex or you introduce an 'intermediate'
component that selects the appropriate DataProvider at runtime.

In Avalon, the 'intermediate' is the ServiceManager (which fortress
creates for you based on how you configure it); and it is quite a good
and powerful 'intermediate' at that.

IOW, you do not *have* to use a container, but if you use avalon
components it can be very handy if you do. Your system becomes more
flexible, loosely coupled, and less complex (hence possibly faster, more
stable, less buggy, ....).

You would only have to write a container if there's a feature you want
from it that is not available in the standard ones. For example, suppose
we didn't have Avalon Phoenix (another container) and you wanted your
components to be exposed through JMX for management. Extending fortress
might be a smart move in that case.

> Thanks for any answer :)

cheers! Hope they weren't too long =)

I'm CCing this to the avalon-users list as that's the best place for
questions like this.

Please do let us know if you have more questions. We'd also very much
like to hear from you if you don't; if you could offer some feedback
about the development process you went through starting avalon
development, that'd be neat!

best regards,

- Leo Simons




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

Reply via email to