Quantcast

DataApplication as a container?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

DataApplication as a container?

saem
I'm attempting to implement 'HibernateUtil', which is often a class with a number of static methods (random example from the web: http://www.opnworks.com/opentime/api/com/opnworks/timesheet/persistence/HibernateUtil.html), as an object, which will be managed by the application. Then pages should be able to simply make requests of the application for the necessary dependencies for the domain to do its job. I'm wondering how/appropriate way/whether one should use a DataApplication as a container? I'm attempting to use the DAO pattern, the implementation of which is described here (https://www.hibernate.org/328.html), as I'm trying to achieve the following (http://nils.kilden-pedersen.net/DAO_pattern/InnerClassStrategy.html) in order to keep my models, and DAOs very 'pure' as prescribed by SOLID (http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod) and being exceptionally aggressive about testability.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: DataApplication as a container?

saem
For now, I think the solution is to use Application's setMetaData (<a href="http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/Application.html#setMetaData(org.apache.wicket.MetaDataKey, java.io.Serializable)">see api), the parent to WebApplication, which is a parent to DataApplication to store the information I need for Hibernate, and the DAOs.

I'm curious as to whether there might be issues storing a serialized hibernate config in there when it comes to clustering, either many app servers, or sharded databases, or both?
Loading...