java - Is this how you go about calling your Dao's in your service layer? -
in service layer, have method xx, how reference dao classes?
public class someserviceimpl implements someservice public void dosomething(int somethingid){ userdao userdao = this.daofactory().getuserdao(); salesdao salesdao = this.daofactory().getsalesdao(); .. .. .. }
it gets bit this, , hoping if there easier more elegant way?
i use springframework configure application. framework has nice feature enables me inject dependencies service layer. therefore service implementation looks that:
@autowired private userdao userdao; public void dosomething(int somethingid) { userdao.findbyid(somethingid); ... }
Comments
Post a Comment