• 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

MVC Pattern question re: Java Pet Store

 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[Have also posted to Java Forums, but I have better confidence in answers here, both in terms of quality and the number of folks looking!]
I've been examining the Java Pet Store application, specifically focusing on the admin Swing client and how it connects to the servlet. My question is this: would the DataSource class be considered model, controller, or both, and where would you define the breakdown? I have the impression it's both - definitely model (responds to UI changes, UI listens for event changes from DataSource), but also controller in that its the only interface for the client to the application logic on the server. If, for example, my application wanted to provide functionality to add users via the UI, it'd forward that request through the DataSource, right? Which would make the DataSource part of the controller?
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's my $0.02: the MVC pattern applies only to certain components of your application. I would consider certain JavaBeans/EJBs, JSPs, Servlets and even POJO's (plain old Java objects) to be within the scope of MVC. Other parts may interact with these but are not really "part" of the pattern. The DataSource would be one of the latter. IMO, it is part of the persistence layer and interacts with the Model portions of MVC.
HTH
 
reply
    Bookmark Topic Watch Topic
  • New Topic