> I am also intrigued by the "generic DAO" concept in the tawus blog, but > fail to see how to implement, so far. Would be great if this concept, > if > I am understanding correctly, could be standardized to pick up directly > from > the entities directory for basic CRUD. And similarly pick up from, say, > the services.dao.* package, sub-directory for custom queries on the same > entities. Then, Tapestry could offer a CRUD application out-of-the-box > just > by specifying the entities.
This is somewhat involved as your application might use multiple different peristence units. As such, multiple different instances of the generic dao must be provided by the system, depending on your configured entities. And I actually do not think that a service implementation class such as class GenericDAO<T> extends AbstractDAOBase { public GenericDAO(String persistanceUnit, Class<T> klass) { super(persistanceUnit, klass); } } is really worth the while... > May be the "problem" is, indeed, trying to shoehorn the DAO into Tapestry > as > a service. RESTful API can be (should be) application independent, > loosely > coupled with the application. Trade off being you lose the ability to > inject, use activation context etc. Hm you really want to have an abstract REST API with an exchangeable backend? You are actually free to do this, just register different backend services implementing the REST API and delegate from your controller to these services... Cheers -- Carsten --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org