Thanks for the info. a cup of Java, cheers! Sha Jiang
2007/7/8, Matt Raible <[EMAIL PROTECTED]>:
http://issues.appfuse.org/browse/APF-186 On 7/2/07, jiangshachina <[EMAIL PROTECTED]> wrote: > > Hello, > I just be curious with the matter, > anybody can give me some explanation? > > Thanks! > > a cup of Java, cheers! > Sha Jiang > > > jiangshachina wrote: > > > > I'm new to AppFuse, and want to use AppFuse 1.9.4 > > (Webwork+Spring+Hibernate). > > > > UserDao interface extends Dao interface, and BaseDaoHibernate implements > > Dao. > > In my mind, since BaseDaoHibernate implements CRUD operations (yes, the > > javadoc said the same), > > then the class would be reused by other Dao classes, like > > UserDaoHibernate. > > But I don't find any usage of BaseDaoHibernate in UserDaoHibernate > > directly. > > I may be wrong, because UserDaoHibernate extends BaseDaoHibernate, then > > the former is using the latter. > > But now that, for example, BaseDaoHibernate has provided method > > getObject(Class clazz, Serializable id), > > which really uses Spring's templete methods, > > why don't BaseDaoHibernate directly use the method to implements its own > > method getUser(Long userId)? > > In fact, getUser(Long userId) method still uses Spring's templet method > > directly to do CRUD operations. > > I just think we may composite BaseDaoHibernate in others DAOs, like > > converting > > User user = (User) getHibernateTemplate().get(User.class, userId) > > to > > User user = (User) dao.getObject(User.class, userId), > > dao is an instance of Dao/BaseDaoHibernate, also is a field in > > UserDaoHibernate. > > > > As above, my main puzzle is that: in the case, is BaseDaoHibernate needed? > > > > I have the same trouble on BaseService (Manager & BaseManager) > > and other Services (e.g. UserManager & UserManagerImpl). > > > > Additionally, BaseManager has a protected field "dao", > > I think that means we can use the dao in BaseManager's subclasses, > > but actually, the variable "dao" is hidden by subclasses's field "dao". > > That means we cannot use super-dao in sub-managers. > > So I'm also very curious that why AppFuse give the pattern? > > > > Thanks in advance! > > > > a cup of Java, cheers! > > Sha Jiang > > > > -- > View this message in context: http://www.nabble.com/Puzzles-on-DAO---Service-layer--tf4009640s2369.html#a11404476 > Sent from the AppFuse - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- http://raibledesigns.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
