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

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

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