• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Data Abstract Class & MVC

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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



 
Ranch Hand
Posts: 47
Netbeans IDE Eclipse IDE Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Eclipse IDE Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic