• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception Handling: where?

 
Majid Al-Fifi
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSF app.

There is one class that interacts with all the views(ControllerClass). Only this class has info about the views. this class has another class to handle database access(DBManager).

This database access class doesn't know anything about the views.

I want to inform the views about what is happening in the database but that should be done thru DBManager.

how can I do that? shall i return exceptions to DBManager and if there are no exceptions and operation was ok how can I inform about that?

Thanks,
Majid
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to our JSF forum.
 
Ali Gohar
Ranch Hand
Posts: 572
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not understood your question exactly, please ellaborate more or paste some code to show what do you want to achieve.
 
Majid Al-Fifi
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Controller class has a method


DBManager:


now what is the best way to communicate to the controller what happened with the DBManager. I don't want to access the view from DBManager(not good design)

Thanks,
Majid
 
Ali Gohar
Ranch Hand
Posts: 572
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use FacesMessage to display your message on the view. It can be of type INFO, WARNING, ERROR or FATAL.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic