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

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -