• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data Abstract Class & MVC

 
Tim Jones
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a method in my Data Abstraction Object (DOA) Class that retrieves data (row by row)from the database. I'd to pass this data (see line 14) to the Controller Class (MVC) where the data will be processed. The Controller Class cannot have direct access because this will be break MVC Convention. Somebody recommended to create an API. I dont know very much about API's and would like some pointers on how to approach this task, including any other alternative methods that maybe available. Thanks



 
Ben Ooms
Ranch Hand
Posts: 47
Debian Eclipse IDE Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming that the controler calls the DAO you could return the resultset to the controler. Let the controler iterate trough the rows and process the data
 
Tim Jones
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ben Ooms wrote:Assuming that the controler calls the DAO you could return the resultset to the controler. Let the controler iterate trough the rows and process the data



The problem is that the Controller cannot call the DAO because will be breaking MVC Rules even though it is technical possible.
 
Ben Ooms
Ranch Hand
Posts: 47
Debian Eclipse IDE Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And if you use Events? Make the Controler a listener of DAO, when DAO has data to process fire a event with the data to process. The controler will as listener do its processing without calling the DAO.
 
Tim Jones
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ben Ooms wrote:And if you use Events? Make the Controler a listener of DAO, when DAO has data to process fire a event with the data to process. The controler will as listener do its processing without calling the DAO.


I'm not sure if this is allowed either, can some confirm?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic