I think he means value objects or domain models. You can't usefully have the container create an instance of Movie because movie is a data- carrying node. It's a bit like having the IoC container create any random Map you might need. If it's a named Map that is a central store for something, then sure, but if I'm creating a Map of values to be used elsewhere that has limited life-span and/or will be populated from the database then re-generated in another user session - these are examples of things you wouldn't put into the container. But, you might put the thing that creates them into the container as a service.

For example, if you have DAOs to persist and look-up "Movie" and "Person" where Person is assigned to various roles (screenwriter, actor, director), then that DAO may also have creation methods to give you new instances of such domain objects. Though for that sort of thing, most persistence frameworks allow you to persist pojos, so the value of doing this may be suspect.

Christian.

On 20-Apr-09, at 19:06 , Thiago H. de Paula Figueiredo wrote:

An example could be for instance domain-model objects, which use services internally. You create them by for instance passing mandatory fields into the constructor.

I don't get this example.

Christian Edward Gruber
e-mail: christianedwardgru...@gmail.com
weblog: http://www.geekinasuit.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to