java - NoSQL DAO implementation -


i have concluded using dao design best trying achieve, have never tried befor having bit of trouble. i've read documentation , examples know goal having hard time figuring out need include in dao interfaces.

for example have model object has:

public string name; public double baseline; public list<group> groups; public list<indicator> indicators; 

i don't know how i'd create dao interface though? put every method i'd think i'd need in there because know daoimpl class going have actual queries nosql database.

this stands right now:

public interface modeldao {      list<model> getallmodels();      list<model> getmodelbyname(string name);      void updatemodel(model model);      void deletemodel(model model); } 

but example if want update name of model, or add/remove group list of groups? things take care of inside dao class? or address inside of respective dao classes.

sorry if understanding isn't there yet, still trying learn stuff.

you implement either way wanted. important thing make sure objects responsible want them be. interface acts connector between dao , other objects, need make sure object needs can done using methods in interface. however, if put every accessor , mutator in interface, there no point using it, , make functions public (in other words, if that, not using true dao @ all.) speaking, dao should not used if have other objects highly coupled through interface. if decide tht want stick dao structure, should have small number of method swhich perform changes need. example, if need change field called 'name' wouldnt call 'setname()' instead modify name field in other object, call 'updatefields()' through interface (or that.) hope helps, sorry wall of text, complex question answer.


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -